Loading...
More Shell Posts
#!/bin/bash#cpcmd.sh [file1 [file2...]]#Prints out the commands needed to copy the file to your local machine#This will work on any server that also has the same hostname as in your hosts file.#I should update this to detect if a file is a directory, and enable recursion for those commands. If you do it now, it will probably just warn you.if [ -n "$1" ]; thenfor arg; dorecursive=$(if [[ -d $arg ]]; then printf " -r"; fi)printf "scp$recursive \"$(whoami)@$(hostname):"printf `readlink -f $arg`printf "\" .\n"doneelseecho "scp \"$(whoami)@$(hostname):$PWD/*\" ."fi#-----------EDIT:#On the UNT cell machines, you have to do this script instead##!/bin/bash#if [ -n "$1" ]; then# for arg; do# recursive=$(if [[ -d $arg ]]; then printf " -r"; fi)# printf "scp$recursive $(whoami)@$(hostname).eng.unt.edu:"# printf `readlink -f $arg`# printf " .\n"# done#else# echo "scp $(whoami)@$(hostname).eng.unt.edu:$PWD/* ."#fi
#for ssh abuse attemptsaction = %(action_)s%(action_abuseipdb)s[abuseipdb_apikey="", abuseipdb_category="18,22"]actionban = curl --fail --ciphers ecdhe_ecdsa_aes_256_sha --data 'key=<abuseipdb_apikey>' --data-urlencode 'comment=<matches>' --data 'ip=<ip>' --data 'category=<abuseipdb_category>' "https://www.abuseipdb.com/report/json"
#!/usr/bin/env bash#Splits a command across a number of CELL machinesuser=$(whoami)if [[ -z $user ]]; thenecho "whoami failed. Exiting..."exit 1ficommand="$1"if [[ -z $command ]]; thenecho "Need to put in a command."exit 1fishiftarray=("$@")let start=8let stop=18for ((i = $start; i <= $stop; i++)); doextraZero=$(if [[ "$i" -lt 10 ]]; then echo "0"; fi)domain="CELL${extraZero}${i}-CSE.ENG.UNT.EDU"let "index = i - start"echo ${#array[@]}if [[ ${#array[@]} != 0 ]] && [[ $index -ge ${#array[@]} ]]; thenecho "$index > ${#array[@]}"breakfissh -o StrictHostKeyChecking=accept-new "${user}@${domain}" -t "$command ${array[$index]}" &done
# Run "test" script on all packagesnpm run test --workspaces# Tip - this also works:npm run test -ws----------------------------------------------------# Runs "test" only on package-anpm run test --workspace package-a# Tip - this also works:npm run test -w package-a----------------------------------------------------# Install `lodash` on `package-a`npm install lodash --workspace package-a# Install `tap` on `package-b` as a dev dependencynpm install tap --workspace package-b --save-dev# Install `package-a` on `package-b`npm install package-a --workspace package-b# Install `eslint` in all packagesnpm install eslint --workspaces
// check versionnode -v || node --version// list installed versions of node (via nvm)nvm ls// install specific version of nodenvm install 6.9.2// set default version of nodenvm alias default 6.9.2// switch version of nodenvm use 6.9.1
#!/bin/bash#Leif Messinger lsm0147#credit.sh FILEScred="Leif Messinger lsm0147"for bruh; doif [[ $bruh =~ \.cpp|\.c|\.java|\.js ]]; thencomment="//$cred"else#Basically everything else gets a pound sign comment#Pound signs are standard across linux. bash, sed, gawk, python etc#Speaking of which, I need to escape it because of that.comment="\#$cred"fiif [ -s $bruh ]; then#If the file has a shebangif egrep -q '^#!/' $bruh; thensed -i "/^\#!\//a$comment" $bruhelsesed -i "1i$comment" $bruhfielseecho "$comment" > $bruhfidone