Skip to content

Instantly share code, notes, and snippets.

@xandrucea
Last active December 20, 2015 12:39
Show Gist options
  • Save xandrucea/6133070 to your computer and use it in GitHub Desktop.
Save xandrucea/6133070 to your computer and use it in GitHub Desktop.
change filenames inside all subdirs
-----------------------------------
$ for i in * ; do echo $i; mv $i/Localizable.strings $i/RatingLoc.strings; done
for file in *; do mv $file "es_3_$file.dat"; done
convert sound (audio) files from .wav to .mp3
---------------------------------------------
find ./ -name "*.wav" -execdir lame -V 3 -q 0 {} \;
--> you need lame, if not already installed:
http://devsforrest.com/116/installing-lame-on-mac-osx-lion
install brew
------------
- call: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
- brew doctor
- if macports is also installed: sudo mv /opt/local ~/macports
- brew search [software_name]
- brew install [specific_software_name]
convert numbered images inside a folder to another resolution
-------------------------------------------------------------
$ for i in *.png
> do
> convert $i -resize 100x100 $i
> done
ip stuff
--------
route get default
ping [ip]
generate md5 hash
-----------------
md5 [filename]
get size of file in bytes
-------------------------
stat -f%z [filename]
verzeichnisse löschen
---------------------
rm -r <dir> // remove dir recursive
rm -rf <dir> // remove git dir recursive
show actual folder in shell
---------------------------
PS1="\[\033[1;31m\]\u\[\033[0m\] in \[\033[1;32m\]\w\[\033[0m\] on \[\033[1;35m\]\h\[\033[0m\]\n$ "
u --> username
w --> working directory
h --> host
für dauerhaftes speichern:
--------------------------
auf interactiver Oberfläche .bashrc, wenn kein Desktop vorhanden .bash_profile
cd [enter]
.bash_profile öffnen (oder mit touch .bash_profile erstellen)
nano .bash_profile
PS1="\[\033[1;31m\]\u\[\033[0m\] in \[\033[1;32m\]\w\[\033[0m\] on \[\033[1;35m\]\h\[\033[0m\]\n$ "
export PS1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment