first=$1
second=$2
# Replace
find -name *.cpp -or -name *.h | xargs grep "$first" -l | xargs perl -pi -e "s/$first/$second/g"
a=getDefaultIncludes; b=get_include_dirs_def; find -name "*.py" -or -name "SC*" | xargs grep "$a" -l | xargs perl -pi -e "s/$a/$b/g"
a=abc; b=def; find -name "*.cpp" -or -name "*.h" | xargs grep "$a" -l | xargs perl -pi -e "s/$a/$b/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 | |
git checkout --orphan temp $1 | |
git commit -m "Truncated history" | |
git rebase --onto temp $1 master | |
git branch -D temp |
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
sudo setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll gb,ru | |
# http://crunchbang.org/forums/viewtopic.php?id=6926 |
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 | |
f=$(pwd) | |
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork" | |
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png" | |
sips --resampleWidth 114 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png" | |
sips --resampleWidth 58 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png" | |
sips --resampleWidth 72 "${f}/${1}" --out "${f}/Icon-72.png" |
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
pacpl --to wav *.caf |
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
# Run 'xmodmap ~/.xmodmap-esc' | |
clear Lock | |
keycode 0x42 = Escape | |
# .. or: | |
#xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' | |
#in /etc/rc.local | |
# https://wiki.archlinux.org/index.php/Xmodmap |
UNIX treats the end of line differently than other operating systems. Sometimes when editing files in both Windows and UNIX environments, a CTRL-M character is visibly displayed at the end of each line as ^M in vi.
To remove the ^M characters at the end of all lines in vi, use:
:%s/^V^M//g
git checkout -- filename
You can do it without the --
(as suggested by nimrodm), but if the filename looks like a branch or tag (or other revision identifier), it may get confused, so using --
is best.
You can also check out a particular version of a file:
git checkout v1.2.3 -- filename # tag v1.2.3
git checkout stable -- filename # stable branch
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/sh | |
USAGE="Usage: $0 processName" | |
if [ $# -ne 1 ]; then | |
echo $USAGE | |
exit 1 | |
fi | |
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 | |
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/ | |
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/ | |
cd /usr/share/fonts/truetype/ | |
#TODO: put validation if folder already exists | |
sudo mkdir ttf-monaco |
OlderNewer