How to display HTTP Headers via Tcpdump

Syntax To display the HTTP Headers using just tcpdump the following syntax can be used : root@webserver1 ~]#  tcpdump -vvvs 1024 -l -A host  www.fir3net.com Example [root@webserver1 ~]# tcpdump -vvvs 1024 -l -A host www.fir3net.com tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 1024 bytes 19:51:57.742793 IP (tos 0x0, ttl 64, id 39410, offset … Read more

How do I install mplayer on Centos / RHEL ?

To install mplayer onto your Centos / RHEL distro you will need to : 1. Download and install the rpmforge repository. rpm -ivh  2. Add the following text to a new file : /etc/yum.repos.d/fc6.repo. cat > /etc/yum.repos.d/fc6.repo[PASTE THE FOLLOWING] [fc6-base] name=Fedora Core 6 mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=core-6&arch=$basearch enabled=1 gpgcheck=0 [CTRL-C]  3. Install mplayer using yum. yum install mplayer

Useful Curl Examples

Curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, TFTP, DICT,  TELNET, LDAP or FILE) and is designed to work without user interaction. Below shows some useful examples: Total Retrieval Time [root@webserver1 ~]# curl -s -w “%{time_total}\n” -o /dev/null www.bbc.com 0.196 Host … Read more

How can I test the bandwith using a Linux shell ?

The other day I was faced with the problem of determining the networking bandwidth of a Linux system via just the shell. After some googling and some head scratching I eventually came up with the following command. echo “scale=2; `curl  –progress-bar -w “%{speed_download}” http://speedtest.wdc01.softlayer.com/downloads/test10.zip -o test.zip` / 131072″ | bc | xargs -I {} echo … Read more

Installing Apache 2.2 from Source

Below details the basic steps required to compile Apache 2.2 upon a CentOS based distro. Update System yum install gcc Download Source cd /var/tmp/wget Unzip / Untar gunzip httpd-2.2.19.tar.gzmkdir httpdcd httpdtar -xvf ../httpd-2.2.19.tarcd httpd-2.2.19/ Compile ./configuremake Install make install Confirm Install [root@localhost httpd-2.2.19]# /usr/local/apache2/bin/apachectl -vServer version: Apache/2.2.19 (Unix)Server built: Jul 10 2011 17:59:10

CentOS timezone not updating

ISSUE When configuring the timezone within Centos the correct timezone is not propagated and the output of the command date does not represent the timezone previously configured. SOLUTION This can be caused by corrupted timezone files. To resolve the issue remove the soft-link, reinstall tzdata and then recreate the soft-link to the necessary timezone. [root@server … Read more

How to Open / Extract RAR Files within Linux

To extract or open RAR files within Linux the unrar binary is used. Below provides the installation and basic operational syntax for the unrar program. 1. Installation 1.1 REDHAT yum install unrar 1.2 UBUNTU apt-get install unrar 2. Basic Syntax To extract a RAR file the following syntax is used: unrar e contents.rar 3. Example … Read more

Ubuntu Ubiquity Error: The username you entered is invalid

When Installing Ubuntu from a Live CD via the graphical installer ubiquity you may receive the following error :               The username you entered is invalid. Note that usernames               must start with a lower-case letter, which can be followed               by any combination of numbers and more lower-case letters. Solution This error can occur … Read more

How do I install a Package Manager within Cygwin ?

Though Cygwin provides the ability to update and install packages via the use of the Cygwin`s setup.exe command, the command line installer apt-cyg provides apt-get like syntax whilst still using Cygwin’s native package repository.   Below details the steps required to install the apt-cyg command line installer.   1. UPDATE CYGWIN First of all you … Read more

/bin/bash^M: bad interpreter: no such file or directory

This is caused by additional carriage returns within your script. In Windows the end of a line is denoted by CRLF (Carriage-Return, Line-Feed). In Unix-like systems, the end of a line is donated by a single LF. This means when you try to run your script, every line has an extra carriage return which in turn causes … Read more

Conditional Execution within Crontab

Conditional execution is a term used to describe the execution of processes or commands based on specfic conditions. This can also be thought of as conditional logic.  Like with most scripting or programming languages conditional logic is built upon the use of return codes. A return code (exit status)  is returned upon process completion to … Read more

Running Java Daemons within Linux

Below is a small method for running Java daemons within Linux. The syntax is as follows: nohup is used so that it doesn’t get killed when user logs off </dev/null is used so that it doesn’t require a command-promt of it’s own & is used so that the Java daemon runs as a background process. … Read more

BASH – ARP Scan command

The following syntax will scan a range of IP addresses. At the point of a ARP response being received it will show a reply message (shown in below example). Note : In this example it will scan IPs between 10.1.1.1-255. if [ -x  /sbin/arping ] ; then for i in {1..255} ; do echo arping … Read more

BASH – Display Clock within Shell

The following command will place a clock within the top right corner of your shell. while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-25));date;tput rc;done &

Configuring Wireless Connectivity within Backtrack 4 r2

INTRODUCTION This article aims to explain the various steps required in configuring Wireless connectivity within Backtrack 4 r2. It is also worth mentioning that as Backtrack is based upon Ubuntu/Debian you may find steps and solutions within this article useful when faced with other Ubuntu/Debian based wireless issues. MY SETUP Backtrack installation consists of a … Read more

IPTables -L output displays slowly

When running the command iptables -vL you may find that : the output displays slowly. the output (appears) to have hung. You can further see what IPtables is doing via running iptables -vL. From this you will most likely see iptables trying to run a reverse DNS lookup (and failing). Solution Due to IPtables trying to … Read more

Wget – 403 Forbidden Error

Issue When trying to download a file using wget you recieve a 403 forbidden error. root@Fileserver html# wget [website] –2010-12-20 20:40:40– [website] Resolving www.maani.us… 75.125.128.242Connecting to www.maani.us|75.125.128.242|:80… connected.HTTP request sent, awaiting response… 403 Forbidden2010-12-20 20:40:41 ERROR 403: Forbidden. Solution wget -U firefox [website]

VSFTPD : 550 Failed to change directory

By default VSFTPD does not allow the browsing of symbolic links. When you try to browse sym links you will get a message saying,        550 Failed to change directory In order to overcome this you can use the mount command. Here are the steps : [root@server ftpuser]# pwd/home/ftpuser[root@server ftpuser]# mkdir NEW_DIR[root@server ftpuser]# mount –bind … Read more

How to determine the Syslog Facility using Tcpdump

Each Syslog message contains a priority value. The priority value is enclosed within the characters < >. The priority value can be between 0 and 191 and consists of a Facility value and a Level value. Facility being the type of message, such as a kernel or mail message. And level being a severity level … Read more

Want to become a Linux expert?

Here is our hand-picked selection of the best courses you can find online:
Linux Mastery course
Linux Administration Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial