Bash substring, prefix, suffix
Substring $ a=teststring $ echo ${a:2:5} ststr Remove prefix (#) $ a=text_test.txt $ echo ${a#*_} test.txt Remove suffix (%) $ a=text_test.txt $ echo ${a%.txt} text_test
Substring $ a=teststring $ echo ${a:2:5} ststr Remove prefix (#) $ a=text_test.txt $ echo ${a#*_} test.txt Remove suffix (%) $ a=text_test.txt $ echo ${a%.txt} text_test
for_window [class="Eclipse" title="Preferences "] floating enable; for_window [class="Eclipse" title="Preferences "] resize set 980 680;for_window [class="Eclipse" title="Preferences "] floating enable; for_window [class="Eclipse" title="Preferences "] resize set 980 680;
$ vim ~/.config/sublime-text-3/Packages/User/Default.sublime-theme [ … { "class": "sidebar_label", "color": [0, 0, 0], "font.bold": false, "font.size": 15, "font.face": "Open Sans" }, { "class": "tab_label", "font.size": 15, "font.face": "Arial" } ]$ vim ~/.config/sublime-text-3/Packages/User/Default.sublime-theme [ … { "class": "sidebar_label", "color": [0, 0, 0], "font.bold": false, "font.size": 15, "font.face": "Open Sans" }, { "class": "tab_label", "font.size": 15, "font.face": Read more about Sublime Text 3: Linux sidebar and tabs fonts[…]
sendmail someone@somewhere.com < somefile
$ cp Font.ttf /usr/local/share/fonts $ fc-cache -v$ cp Font.ttf /usr/local/share/fonts $ fc-cache -v
cat /var/log/auth.log|grep fail|awk ‘{ print $14}’|sort|uniq –count|sort -nrcat /var/log/auth.log|grep fail|awk ‘{ print $14}’|sort|uniq –count|sort -nr
~/.gtkrc-2.0 gtk-font-name="Open Sans 10"~/.gtkrc-2.0 gtk-font-name="Open Sans 10" ~/.config/gtk-3.0/settings.ini [Settings] gtk-font-name = Open Sans 10~/.config/gtk-3.0/settings.ini [Settings] gtk-font-name = Open Sans 10 Soft for changing themes: gtk-chtheme, gtk-theme-switch
Resize all images in current directory to 600px height: for i in *; do mogrify -verbose -resize x600 “$i” ; done Resize all images (*.jpeg, *.jpg, *.JPG) in current directory and subdirectories to 800px height: find -type f -iregex ‘\(.*\.jpeg\)\|\(.*\.jpg\)\|\(.*\.JPG\)’|xargs mogrify -verbose -resize x800
# move full repo svndump /path/to/old-repository > full.dump svnadmin create /path/to/new-repository svnadmin load /path/to/new-repository < full.dumpsvndump /path/to/old-repository > full.dump svnadmin create /path/to/new-repository svnadmin load /path/to/new-repository < full.dump # move only subproject from repo svndump /path/to/old-repository > full.dump cat full.dump | svndumpfilter –drop-empty-revs include subproject > subproject.dump svnadmin create /path/to/new-repository svnadmin load /path/to/new-repository < subproject.dumpsvndump /path/to/old-repository Read more about Moving SVN repos[…]
Enable: echo “1” > /sys/devices/platform/thinkpad_acpi/bluetooth_enable Disable: echo “0” > /sys/devices/platform/thinkpad_acpi/bluetooth_enable