GRUB - Init Shell

Sometime in case of root password lost or file system corruption, you need to boot system with simple shell, skipping the init sequence. At Grub prompt press ’e’ to edit command before booting. Select ‘kernel’ line Press ’e’ again to edit selected command Type follow at end of the line: init=/bin/bash (or sh) Press ‘b’ to boot system Now you are at shell prompt. Enjoy

30 March 2010 @ 00:44 · Updated: 30 June 2026 @ 03:28 · leo

Linux - dmidecode

dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. If you like to see which memory banks is in use and what the ram module sizes, you simply call dmidecode with memory parameter. # dmidecode -t memory ...

29 March 2010 @ 08:56 · Updated: 30 June 2026 @ 03:28 · leo

Securing "tmp" without repartition

First you should secure /tmp: Make a 1GB file for /tmp parition and an ext3 filesystem for tmp: # dd if=/dev/zero of=/dev/tmpFS bs=1024 count=1000000 # /sbin/mkfs.ext3 /dev/tmpFS Create a backup copy of your current /tmp drive: # cp -Rpf /tmp /tmpbackup Mount our new tmp parition and change permissions: # mount -o loop,noexec,nosuid,rw /dev/tmpFS /tmp # chmod 1777 /tmp Copy the old data: cp -Rpf /tmpbackup/\* /tmp/ If you run the mount command and you should get something like this: /dev/tmpMnt on /tmp type ext3 (rw,noexec,nosuid,loop=/dev/loop0) ...

16 January 2010 @ 22:57 · Updated: 30 June 2026 @ 03:28 · leo

Debian NetInstall - Sparc

Per prima cosa è necessario avere un host linux nel mio caso Debian, e poi ovviamente una Sparc :) Sull’host linux è necessario avere un server rarp e tftp quindi installiamo in questo modo: vm01:~# apt-get install rarpd tftpd-hpa Configuriamo rarpd, editando il seguente file /etc/ethers inserendo una riga con mac address della sparc (si può vedere appena accesa da OpenBoot): XX:XX:XX:XX:XX:XX 192.168.xx.xx Riavviamo per applicare le modifiche: vm01:~# /etc/init.d/rarpd restart ...

16 January 2010 @ 22:54 · Updated: 30 June 2026 @ 03:28 · leo

Securing /dev/shm

Edit your /etc/fstab: ` vi /etc/fstab ` change: none /dev/shm tmpfs defaults,rw 0 0 to none /dev/shm tmpfs defaults,nosuid,noexec,rw 0 0 Remount /dev/shm: ` mount -o remount /dev/shm ` You can test it runnig a script on /dev/shm, if you get “permission denied” it is fine!

2 December 2009 @ 07:28 · Updated: 30 June 2026 @ 03:28 · leo

Iptables Flush

Full flush iptables script: #!/bin/sh iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT

2 December 2009 @ 07:15 · Updated: 30 June 2026 @ 03:28 · leo

Extract files from DEB package

Some day ago, I wrote about RPM extraction, today I need content of DEB packcage, on the contrary of rpm systems debian package manager allow to extract natively by this command: #dpkg-deb -x somepackage.i386.deb But my problem is different, I not using Debian sytem, fortunately DEB files are “ar” archives, which contain three files: debian-binary control.tar.gz data.tar.gz first, extract “ar” archive with this simple command: # ar vx somepackage.i386.deb then extract the contents of data.tar.gz using tar: ...

10 November 2009 @ 06:00 · Updated: 30 June 2026 @ 03:28 · leo

Extract files from RPM package

There is no direct RPM option available via rpm command to extract an RPM file. But there is a small utility available called rpm2cpio. It Extract cpio archive from RPM Package Manager (RPM) package. Example extract RPM file using rpm2cpio and cpio command: # rpm2cpio somepackage.x86_64.rpm | cpio -idmv Output of rpm2cpio piped to cpio command with following options: i: Restore archive d: Create leading directories where needed m: Retain previous file modification times when creating files v: Verbose

2 November 2009 @ 04:58 · Updated: 30 June 2026 @ 03:28 · leo

Exim - Command

Some userfull Exim command: exim -bpmailq --- The mailq is relevant as it gives your the email IDs. exim -M emailIDforce delivery of one message exim -qf Force another queue run exim -qff Force another queue run and attempt to flush frozen messages exim -Mvl message IDView Log for message exim -Mvb message IDView Body for message exim -Mvh message IDView Header for message exim -Mrm message IDReMove message (no errors sent) exim -Mg message IDGive up and fail message, message bounces to sender

16 September 2009 @ 02:30 · Updated: 30 June 2026 @ 03:28 · leo

Watch - Exim Queue

Just in one line memo: # watch -n 5 'exim -bp | exiqsumm |grep TOTAL'

16 September 2009 @ 02:13 · Updated: 30 June 2026 @ 03:28 · leo