Category Archives: Bash

(Bash) Download Directory with scp

download directory to localhost home folder new-dir-name

Posted in Bash | Tagged , , , | Leave a comment

Assembling with nasm and disassembling with ndisasm

The following commands demonstrate assembling with nasm and disassembling with ndisasm. $ cat example.s mov eax,0 test eax,eax $ nasm example.s $ ndisasm example 00000000 66B800000000 mov eax,0×0 00000006 6685C0 test eax,eax The first column of the disassembly contains the file offset, the second column contains the opcodes and the third contains the assembly instructions. [...]

Also posted in Assembler | Tagged , , , , , , | Leave a comment

(Bash) Extensible match filter example with ldapsearch

Use an extensible match filter to discover entries beneath and including a portion of the DN. Uses the older OpenLDAP ldapsearch syntax and the modern ldapsearch syntax.

Posted in Bash | Tagged , , , , , , , | Leave a comment

(Bash) Search for string in files

 

Posted in Bash | Tagged , , , , | Leave a comment

(Bash) Audio conversion 3gpp to mp3 with ffmpeg

$FFMPEG_HOME/bin/ffmpeg -i rec_1452.3gpp -acodec libmp3lame -ar 22050 audio_only_test.mp3 –stdout   ffmpeg version N-30956-g81ef892, Copyright (c) 2000-2011 the FFmpeg developers built on Jun 22 2011 17:37:00 with gcc 4.5.3 … libpostproc 51. 2. 0 / 51. 2. 0 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘rec_1452.3gpp’: Metadata: major_brand : 3gp4 minor_version : 0 compatible_brands: isom3gp4 Duration: 00:01:27.44, start: 0.000000, [...]

Posted in Bash | Tagged , , , , , , , , , , , , | Leave a comment

(Bash) relay files via tar+ssh+cat

rsync doesn’t like to copy files from host to host. This is sort of the “old school” unix way – tar everything to a pipe, then pipe everything out. It’s how we used to copy directories remotely before we had tools like rsync. I’m definitely open to suggestions on how to improve this (even a [...]

Posted in Bash | Tagged , , , , , , , , | Leave a comment

(Bash) Download Compressed Linode Server Image

After the system is in Finnix recovery mode set a password and start-up SSH. After that use this to compress the image on the sever side and download it locally saving bandwidth compared to a normal dd dump.

Posted in Bash | Tagged , , , , , | Leave a comment

(Bash) Iptables List

Posted in Bash | Tagged , , | Leave a comment

(Bash) Enable Compositing In Metacity

check gconf-editor -> Apps -> metacity -> general -> compositing_manager Enable:  gconftool-2 -s ‘/apps/metacity/general/compositing_manager’ –type bool true Disable: gconftool-2 -s ‘/apps/metacity/general/compositing_manager’ –type bool false Enable Compositing In Metacity Posted by smoover on July 23rd, 2011

Posted in Bash | Tagged , , , , , , | Leave a comment

For loops in Bash

For loops in Bash can come in handy when for example, you want to perform bulk operations. Think of renaming all files in a directory or executing a collection of scripts. The following snippet simply iterates through a set of prime numbers and prints them to the console.

Posted in Bash | Tagged , , , , , , | Leave a comment