Skip to content

Instantly share code, notes, and snippets.

@gipi
Last active September 28, 2015 22:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gipi/1506702 to your computer and use it in GitHub Desktop.
Save gipi/1506702 to your computer and use it in GitHub Desktop.
#unix

INITRD

Inspect the contents of the initial ram disk

$ gzip -dc /boot/initrd.img-3.2.0-1-686-pae | /bin/cpio -t

and create new one

/dev/shm/initrd $ find ./ | cpio -H newc -o > new-initrd

GRUB1&2

CONSOLES

MULTIPLEXER

http://myhumblecorner.wordpress.com/2011/08/30/screen-to-tmux-a-humble-quick-start-guide/ http://unix.stackexchange.com/questions/549/tmux-vs-gnu-screen

NETWORKING

For ftp I use lftp; it's possible to launch background task using the following syntax

lftp gipi@ftp.example.com:/My files> queue stop
lftp gipi@ftp.example.com:/My files> queue put /tmp/debian.gz
lftp gipi@ftp.example.com:/My files> queue start

SCHEDULING

Exists an application called schedtool that is able to manage process scheduling

$ schedtool -B -n 1 -e ionice -n 1 make -j `cat /proc/cpuinfo | grep "^processor" | wc -l` 

PIPES

Pipes are awesome!

In order to see a progress bar use pipeviewer

$ pv live-cd.iso > /dev/sdd
 570MB 0:01:55 [4,12MB/s] [========================================>        ] 92% ETA 0:00:09

BLOCK DEVICES

$ # blockdev --report /dev/sdf
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0       262144000   /dev/sdf

DOCUMENTS

It's possible to produce a Postscript file using a linux man page with the following command

$ cat /opt/git/share/man/man1/git-rerere.1 | groff -man -Tps > /tmp/git-rerere.ps

SANDBOXING&CHROOTING

LOGGING

Exists the daemon rsyslog that use the file /etc/rsyslog.conf.

CRON

Batch scheduler (remember that as default is not logged by rsyslog). Debian seems to use a one more field (the user one) respect to what the documentation says.

MAKEFILE

UNICODE

Executable format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment