Test disk performanace

hdparm -Tt /dev/sda

Install from source

Untar.

tar zxvf file.tar.gz

Move to the newly created directory.

cd file

Execute the script.

./file.sh

Install .bin

Change permission.

chmod +x file.bin

Execute the script.

./file.bin

RPM installation

Install RPM package.

rpm -iuh packages

Upgrade RPM package.

rpm -uvh package

Find USB devices

lsusb

Mount USB storage devices

The USB drive will be mount in to the folder named “mount” located in the users home directory.

mount /dev/usb mount

Assign the mount directory proper permission.

chmod 777 /mount/point

Unmount the USB device.

umount /dev/usb

Static IP configuration for Linux

The configuration is located at /etc/network/interfaces.

# The primary network interface
# allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.1.3
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

Set DNS to resolve /etc/resolv.conf.

nameserver 192.168.1.1

Install default LAMP stack (Ubuntu) apt-get

apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

Some packages are being kept back

Run

apt-get dist-upgrade

Network interface is missing after moving VMware virtual machine

The solution is to remove the persistent-net.rules.

In Debian the file has the name of :

rm /etc/udev/rules.d/z25_persistent-net.rules

On Ubuntu the file name changes to :

rm /etc/udev/rules.d/70-persistent-net.rules

Then reboot.

Basic IPTables configuration

The following allows port 22, 80 and 443.


*filter

# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT

# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allows all outbound traffic
# You can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

# Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allows SSH connections
#
# THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
#
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

# Reject all other inbound - default deny unless explicitly allowed policy
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT

Download: iptables.txt


Books and e-Books

Recommended reading material, I have personally found useful.

  • Byte of Python
  • Byte of Python is perhaps the best book for some one who wants to learn a programming language but has no previous background in the concept of what makes a language. This is my first recommendation, the author takes an easy approach and the user will find the exercises fun. Personally I love the approach this book takes, in my opinion beginners will have a great time reading the book. The author Swaroop C H made his work free of charge in electronic form.

  • O’Reilly Learning Python 3rd Edition
  • This book takes a deeper approach to the language.

  • Dive into Python
  • What can I say, this what every serious Python lover should read and later compare with his or her current knowledge of the language

If you find any of the material on this site useful please take a moment to make a small donation.