Skip to content

Instantly share code, notes, and snippets.

View keikoro's full-sized avatar
🦈
いいえ

k keikoro

🦈
いいえ
View GitHub Profile
@keikoro
keikoro / compile C on Mac
Last active December 24, 2015 23:49
Compile C on Mac OS X using the command line instead of e.g. Xcode. Requires GCC (GNU Compiler Collection) to be installed, which is part of Command Line Tools (which can be installed through Xcode or as separate developer package).
# gcc start GNU compiler
# -Wall [optional] flag to show warnings (all possible warnings)
# $DESIREDEXECUTABLENAME [optional] name of resulting executable file; otherwise gcc auto-outputs to a.out
# $MYFILE.c C file that should get compiled
gcc -Wall $DESIREDEXECUTABLENAME $MYFILE.c
@keikoro
keikoro / replace group permissions
Created August 11, 2013 18:17
Replace group permissions of certain files.
# ~ find in $HOME
# fdl file types: f = file, d = directory, l = symbolic link
# $GROUP current group permission
# -exec do something with found files
# :$NEWGROUP new group permission (needs leading colon! -> chown owner:group)
# {} placeholder for each found file
# \; escape the semicolon that ends the -exec part of the command
find ~ -type fdl -group $GROUP -print -exec chown :$NEWGROUP {} \;
@keikoro
keikoro / find group permissions
Last active December 20, 2015 22:38
Find files with certain group permissions.
# ~ find in $HOME
# fdl file types: f = file, d = directory, l = symbolic link
# $GROUP current group permission
find ~ -type fdl -group $GROUP -print