This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for files in old*.txt | |
do | |
((i++)) | |
mv $files $(echo $files | sed -E 's/[0-9]+\.txt//')OLDOLD$i.txt | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
openssl base64 -in pudding.png > pudding.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bind '"\C-]":"\C-e\C-u pbcopy <<"EOF"\n\C-y\nEOF\n"' | |
# i might try: | |
# $ echo 'bind \'"\C-]":"\C-e\C-u pbcopy <<"EOF"\n\C-y\nEOF\n"\'' >> ~/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printf "enter username@ip-address: " ; read UIP ; ssh $UIP "mkdir .ssh 2>/dev/null ; echo $(cat $HOME/.ssh/id_rsa.pub) >>.ssh/authorized_keys ; chmod 700 .ssh ; chmod 600 .ssh/authorized_keys" ; echo "hostname=$(ssh $UIP hostname)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat tags.txt | cut -d' ' -f2- | grep -o -v '\ +.+' | tr ' ' '-' | grep -o -E '[a-zA-Z0-9\-]+[a-zA-Z0-9]$' | grep -v '^-' | tr '[A-Z]' '[a-z]' | tr '-' ' ' | sort -u > newtags.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# removes all "extra" whitespace (leaves normal spaces) | |
cat "web.txt" | awk '{$1=$1}1' | |
# removes only leading and trailing whitespace | |
cat "web.txt" | awk '{gsub(/^ +| +$/,"")}1' | |
# this perl command should do the same thing | |
cat "web.txt" | perl -lape 's/^\s+|\s+$//g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -a -- recursive, preserving date/time/ownership (`man rsync`) | |
# -u -- update (only replace/add files that are newer or non-existent on the target) | |
# -v -- verbose output | |
# -z -- compression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat "hello.txt" | sed -E '/src=".+"/ { | |
r boobs.txt | |
d | |
} | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mplayer -vo null -vc null -ao pcm:fast:file=file.wav file.mp3; faac -b 128 -c 44100 -w file.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
nl=$'\n'; cat "hello.txt" | sed -E "s/(<img.+src=\")(.+)(\".+)/\1\\$nl\2\\$nl\3/g" |
OlderNewer