aretips
- wget -i equiv using bash and : while read line; do curl -O $line; done < urls3:15 PM Nov 4th from Identica
- use `/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend` in to lock the screen.3:14 PM Nov 4th from Identica
- to resize/convert images, use and bash like this: `for i in $( ls *.JPG ); do convert $i -resize 33% new/$i.jpg; done`3:14 PM Nov 4th from Identica
- in , :set ff=unix to switch a file to unix format, and :set ff=dos to switch it to dos format. [source: lunix.com.au]3:14 PM Nov 4th from Identica
- in , %s/const char\* \(\w\+\);/const char* \1 = "";/g would replace all "const char* var;" to 'const char* var = "";'3:09 PM Nov 4th from Identica
- in bash, seq(1) is useful in loops: for i in `seq -f"%03g" 1 114`; do ls $i*; done [source: tldp.org] 2:55 PM Nov 4th from Identica
- `curl -O [001-114].ext` saves me from writing perl scripts or bash for loops! 2:50 PM Nov 4th from Identica
- after running a command and realizing you need to run it with sudo, just do a 'sudo !!' - courtesy of shell-fu.org. 2:47 PM Nov 4th from Identica
- `find -type d -print0 | xargs -0 -n1 chmod 755` - recursively chmod all directories 'd' as 755. use 'f' instead for files. 2:46 PM Nov 4th from Identica
- use `getconf LONG_BIT` to find out if you're on a 32-bit or 64-bit box via 5:27 PM Aug 8th from Identica
- speaking of , you can use `dig +short txt <keyword>.wp.dg.cx` to query from the command line. source: 7:31 PM Aug 4th from Identica
- use `dig nameserver -t A domain` to get information about a particular domain, cache expiration time, etc. 7:28 PM Aug 4th from Identica
- in , :.,+2s/foo/bar/g would replace foo with bar in this line and the next two lines.7:26 PM Aug 4th from Identica
- `20,40 s/bool/int/g` replaces every 'bool' with 'int' between lines 20 and 40 in .7:24 PM Aug 4th from Identica
- `openssl rand 6 -base64` generates an 8 character password. replace 6 with x to generate a password of length (x*8)/6. 7:23 PM Aug 4th from Identica
- to copy a table in mysql, run mysql and do, `create table copy like original`, and then do `insert into copy select * from original` 11:26 PM Jun 24th from Laconica
- `hdiutil makehybrid -udf -udf-volume-name "dvd name" -o out.iso dir/` (where dir contains a VIDEO_TS folder) to make a dvd iso in osx.11:46 PM May 30th from web
- when running a bg process remotely via via script, use `cmd < /dev/null > /dev/null 2>&1 &` to avoid hanging. (see 3.10 in openssh faq)1:52 AM May 15th from Identica
- `cmap w!! %!sudo tee > /dev/null %` in your vimrc let's you write a file as sudo if you forgot to run as sudo [thx stackoverflow].7:28 PM Apr 28th from web
- use `awk '{temp = $1; $1 = $2; $2 = temp; print;}'` to swap two columns of data.7:28 PM Apr 28th from web
|
|