CentOS - IPv6 interface

You need to update and configure following files for IPv6 configuration: Edit: /etc/sysconfig/network And append following line, to enable in systemwide the ipv6 protocol: NETWORKING_IPV6=yes Edit: /etc/sysconfig/network-scripts/ifcfg-eth1 (or your interface number) And append following line, to enable ipv6 on interface and the address/gateway if you use static routing: IPV6INIT=yes IPV6ADDR=2001:1418:0193:000B::210 IPV6_DEFAULTGW=2001:1418:0193:000B::251 Save, close and restart network service: # service network restart

14 April 2010 @ 09:53 · Updated: 30 June 2026 @ 03:28 · leo

Debian - Kernel Headers

Memo: Install linux-header package # apt-get install linux-headers-$(uname -r)

14 April 2010 @ 07:27 · Updated: 30 June 2026 @ 03:28 · leo

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

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

Auto Check - OpenVPN

Su connessioni fastweb usando openvpn è in caso di restart dei router di destinazione spesso le sessioni restano appese e non viene ristabilito il tunnel, in teoria questo bug è stato risolto nelle ultime release, per non rischiare 4 righe di script: #!/bin/bash if ! ping -c 1 -w 5 "xxx.xxx.xxx.xxx" &>/dev/null ; then /etc/init.d/openvpn restart fi Eseguite ogni 5 minuti come da cron: */5 * * * * /root/yeahup

14 September 2009 @ 01:45 · Updated: 30 June 2026 @ 03:28 · leo