configure dhclient to reject ip from a specific dhcp server

add the line in dhclient.conf file to reject ip offer from server

vi /etc/dhcp/dhclient.conf


clone debian linux

1 – Install debian – example with minimum packages for a end user desktop

apt-get install xfce4 net-tools gpm vim ssh telnet xterm gvfs-backends chromium xserver-xorg-video-intel xserver-xorg-video-vesa gdebi wpasupplicant xpdf resolvconf cifs-utils libreoffice-calc cups 

2 – Download last version of linux-live to /tmp directory

wget -P /tmp

3 – Uncompress linux-live file in /tmp directory

unzip /tmp/ -d /tmp

4 – Run build in descompress dir


*Install missing packages for the compilation

**(Optional Step) Replace bootlogo.png file with size 640×480

cp /path/to/your/bootlogo.png /tmp/linux-data-*/linux/boot/bootlogo.png

5 – Generate /tmp/ file after build finish


6 – Format USB/HDD

yes | mkfs -t ext4 /dev/pathToUSBOrHDDDeviceBlock

7 – Decompress /tmp/ into USB/HDD Disk

mount /dev/pathToUSBOrHDDDeviceBlock /mnt
unzip /tmp/ -d /mnt

8 – Make USB/HDD bootable

cd /mnt/linux/boot; ./

9 – sync and umount mount point

cd; sync; umount /mnt

Linux Live Page:

convert txt to pdf

1 – install packages that contain e2ps and ps2pdf binary

apt-get install e2ps ghostscript

2 – convert txt to ps

e2ps -a4 -p file.txt >

3 – convert ps to pdf


– one liner converter

e2ps -a4 -p file.txt > && ps2pdf

install geoip iptables module debian 9

1 – Install the packages below

apt-get install xtables-addons-common xtables-addons-dkms libtext-csv-xs-perl

2 – Create directory used by geoip module

mkdir /usr/share/xt_geoip

3 – Download the Country Code IPs database

cd /tmp; /usr/lib/xtables-addons/xt_geoip_dl

4 – Convert the CSV database of Country Codes to binary

/usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip /tmp/GeoIPCountryWhois.csv
/usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip /tmp/GeoIPv6.csv

In alternative you can run the script below

set -euo pipefail

set +e
if ! dpkg -l xtables-addons-common >/dev/null ; then
        apt install xtables-addons-common
if ! dpkg -l libtext-csv-xs-perl >/dev/null ; then
        apt install libtext-csv-xs-perl
set -e

if [ ! -d /usr/share/xt_geoip ]; then
        mkdir /usr/share/xt_geoip

geotmpdir=$(mktemp -d)
csv_files="${geotmpdir}/GeoIPCountryWhois.csv ${geotmpdir}/GeoIPv6.csv"
cd "${geotmpdir}"
/usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip ${csv_files}
cd "${OLDPWD}"
rm -r "${geotmpdir}"
exit 0

to test

iptables -A FORWARD -m geoip --src-cc BR -j DROP

configure xterm

install the package that contains xrdb binary

apt-get install x11-xserver-utils

show current configuration

xrdb -query -all

set a new configuration, put the lines in ~/.Xresources

vi ~/.Xresources

! set window size
xterm*geometry: 120x34

! set xterm colors
xterm*background:   yellow
xterm*foreground:   black

! set xterm keybindings
xterm.*.translations: #override \n \
        <Key>F1:     string("X") \n \
        <Key>F2:     string("Y") \n \
        <Key>F3:     string(0x1b)    string("[11~") \n \
        <Key>F4:     string(0x1b)    string("[12~")

reload configuration

xrdb ~/.Xresources

remove all configuration

xrdb -remove -all

more about xterm:


set linux server time using ntp server

1 – Install ntpdate package

apt-get install ntpdate

2 – Configure time using ntpdate command


3 – Configure ntpdate on cron

crontab -e

@reboot /usr/sbin/ntpdate
@daily /usr/sbin/ntpdate

4 – Allow ntp port on firewall

iptables -A FORWARD -s -p udp --dport 123 -m comment --comment "NTP service port" -j ACCEPT

encrypt shell scripts

1 – Install shc package

apt-get install shc

2 – Create the shell script file


for i in {1..3}; do echo $i: $RANDOM; done

3 – Encrypt shell script file using shc

shc -f

Output generated files:

4 – Execute the encrypted shell script


5 – Specifying expiration date for your shell script ( dd/mm/yyyy format )

shc -e 30/07/2017 -f

6 – Add custom expiration message for your shell script

shc -e 30/07/2017 -m contact '' -f