Introduction Within this article, we will configure a BIND server within Ubuntu. The advantages of having a local DNS server include: Reduced latency to DNS requests/responses Ability to add private addresses and full flexibility of zone names. Especially useful for VMware installations. It is important to note that the steps provided, are based on a quick setup. Due … Read more
Introduction Most likey there will be a time (for one reason or another) where you need to insert a number of spaces to a set of lines within a text file.Within this short article we will show you how via the use of VIM. Steps 1. Within VIM select blockwise visual mode, by pressing CTRL-V.2. … Read more
Introduction Within the Linux kernel, knowing how memory is separated is extremely important. As knowing what programs reside where, and the requirement on the system to move memory from one place to another, can provide a huge insight into the performance, or lack of, within a system. And when it comes to the world of … Read more
Definition MacVTap is a Linux device driver, based upon the combination of – Macvlan and TAP (descriptions below), that allows for the creation of virtual (tap-like) interfaces. Each virtual network interface is assigned its own MAC and IP address, then attached to the physical interface (also know as the lower interface), Macvlan – Linux kernel … Read more
Abstract The scope of this article is to describe, at a high level, the journey a frame takes through a Linux based system. NOTE This article does not cover Linux kernel performance issues and caveats, for more information around this please see pushing the limits of kernel networking. Ingress Lets first look at the path … Read more
The other day I asked myself, What is the difference between apt-get update and apt-get upgrade? As I’m sure many other people, at some point may ask the same, I thought I would share the answer. Quite simply, apt-get update – updates the list of available packages, and their versions. However it does NOT upgrade … Read more
Issue When executing Yum you receive the following error, [[email protected] blog]# yum install npm rpmdb: Thread/process 3934/139752225695488 failed: Thread died in Berkeley DB library error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 – (-30974) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open … Read more
What is Git? Git is a version control system that is used for software development and other version control tasks. As a distributed revision control system it is aimed at speed, data integrity, and support for distributed, non-linear workflows[1]. Create Repository To create a new repository, the command git init is used, within your directory. … Read more
Git provides 3 types of merging, Fast-Forward, Automatic and Manual. A manual merge is required when git is unable to resolve any conflicts , this results in a merge conflict. Within this example we will generate a merge conflict and then manually resolve from within the command line. File First, lets look at the contents … Read more
Git provides various global configuration options for colorizing the output.[1] In order to enable these options, run the following commands. This will, in turn update your ~/.gitconfig file. git config –global color.ui alwaysgit config –global color.branch alwaysgit config –global color.diff alwaysgit config –global color.interactive alwaysgit config –global color.status alwaysgit config –global color.grep alwaysgit config –global … Read more
In order to make your life easier when working with git, this article provides the steps to display the current local git branch within your bash prompt. This not only saves you time, but also prevents the potential for human error by ensuring you are not making changes to the wrong branch. Download Script First … Read more
In this article we will show you how to set the time, date and timezone within Ubuntu. Steps Set the time zone Set the time and date Sync the hwclock with the current time and date Commands Below are the commands that are required. For the date command this will set the time and date … Read more
Introduction The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall. ufw aims to provide an easy to use interface for people unfamiliar with firewall concepts, while at the same time simplifies … Read more
The Linux Network Namespace (netns) is a feature within the 2.6.27+ Linux kernel. Normally a Linux process will run within a network namespace. By default this is inherited from its parent process. Network namespaces allow for the process to run within a different network namespace. This allows for virtual instances of the Linux network stack … Read more
Issue How do you install g++ via Yum ? You may also be asking this due to receiving the following error when trying to compile from source, make[1]: g++: Command not found Solution To install g++ via yum run the command, yum install gcc-c++
Within this article we will show you how to compile node.js, version 0.10.25. Note : This article is meant as a quick, and short guide rather then full blown tutorial. Install Dependencies yum install bzip2 gcc gcc-c++ sqlite sqlite-devel Download wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz Extract tar xvfz node-v0.10.25.tar.gz cd node-v0.10.25 Compile ./configure make make install
For years, I had ran my Prolific USB to Serial cable from my Windows 32bit laptop without any issues. Unfortunately, life when running Windows is never easy. After upgrading Windows 7 to 64bit I tried to install the drivers from CNET downloads. This was a HUGE mistake. Even though the CNET downloader told me it … Read more
You may find that when listing directories within the shell and when using a black background that the directory names aren’t clearly readable. To resolve this issue the following command and then log back in. This command will issue a find and replace against the color setting (for directory listings) within the necessary configuration file. … Read more
Within this article we will show you how to configure Apache to serve your content over a SSL based connection using a self signed certificate. Generate Certificate/Key First of all we generate a self signed certificate using openssl. This will create 2 files, a public certificate and a private key. mkdir -p /opt/ssl/crt/cd /opt/ssl/crt/openssl req … Read more
The Umask (User Mask) is a UNIX function that is used to control the permission bitmask applied to newly created files and folders.The Umask value is subtracted from the default permission value. The resulting value is then assigned as the permission bitmask to the newly created file or folder. Note : The default permission values … Read more
Syntax To display the HTTP Headers using just tcpdump the following syntax can be used : [email protected] ~]# tcpdump -vvvs 1024 -l -A host www.fir3net.com Example [[email protected] ~]# 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
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
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 [[email protected] ~]# curl -s -w “%{time_total}\n” -o /dev/null www.bbc.com 0.196 Host … Read more
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
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. [[email protected] … Read more
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
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
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
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 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
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
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
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 &
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
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
The main cause for this error (see below) is due to su not being set to a setuid of root. su: cannot set groups: Operation not permitted Solution chmod u+s /bin/su
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 : [[email protected] ftpuser]# pwd/home/ftpuser[[email protected] ftpuser]# mkdir NEW_DIR[[email protected] ftpuser]# mount –bind … Read more
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
When installing Oracle 11g on Fedora 13 you may get the following error : Error in invoking target ‘agent nmb nmo nmhs tclexec’ of makefile ‘/u01/app/oracle/product/11.1.0/db_1/sysman/lib/ins_emagent.mk Solution Within the file detailed in the error edit it and find the line that reads ‘$(MK_EMAGENT_NMECTL)’ change this to ‘$(MK_EMAGENT_NMECTL) -lnnz11’ Note : edit this file while … Read more
Below shows you the basic steps in order to configure your Linux Redhat / CentOS server as a Samba server. Install and Configure yum install samba -ychkconfig –level 123 smb on cd /etc/sambamv smb.conf smb.conf.backupvi smb.confcat > /etc/samba/smb.conf [paste the text below][global]workgroup = Workgroupnetbios name = SambaServerserver string = Samba Server %vlog file = /var/log/samba/log.%mencrypt … Read more
In this article we will show you how to set the time, date and timezone within CentOS. Though I’m sure this method will remain the same through the various Linux distributions. Steps Set the time zone Set the time and date Sync the hwclock with the current time and date Commands Below are the commands … Read more
In order to set the hostname on CentOS you will need to change the HOSTNAME section within /etc/sysconfig/network Your hostname will now be updated once you logout and then back in. Its also worth noting that this will survive reboots.
In order configure your Ubuntu/Debian box to access HTTP, HTTPS and FTP via a Proxy you will need to assign some environment variables. Assign Environmental Variables Below shows you the different variables you need to declare : export HTTP_PROXY=[PROXY IP]:[PORT]export HTTPS_PROXY=[PROXY IP]:[PORT]export FTP_PROXY=[PROXY IP]:[PORT] Survive reboot To survive a reboot you need to add these … Read more
Below is a basic template for setting up IPTables on a Linux box : Create LOGDROP CHAIN. Add LOG and DROP to chain. iptables -N LOGDROP iptables -A LOGDROP -j LOG –log-level 6 iptables -A LOGDROP -j DROP Create input and output policies iptables –policy INPUT DROP iptables –policy OUTPUT DROP Add inbound rules iptables … Read more
What is encoding / decoding ? Encoding refers to the process of translating a file into an ASCII based string. Decoding refers to the process of decoding the ASCII based string. In order to perform this decoding/encoding process Base64 is typically used. Base64 is a program that converts each 6 bits and then converts this … Read more
Please note : This article is based on RHEL5 and grub. Below shows the 2 methods you can use to ensure serial connectivity when booting into single user mode. You may find without changing this setting your connection is lost just after Redhat starts booting.This configuration change can be via the grub.conf or via the … Read more
Issue When you try and run a yum update you receive the following error : [email protected]:/$ yum update Traceback (most recent call last): File “/usr/bin/yum”, line 4, in ? import yum File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 42, in ? import config File “/usr/lib/python2.4/site-packages/yum/config.py”, line 27, in ? from parser import ConfigPreProcessor File “/usr/lib/python2.4/site-packages/yum/parser.py”, line 3, in ? … Read more
In this article we will encrypt (using AES 256 cbc) and password protect (Salt the AES) a file using the openssl binary. The file we will encrypt will be the file secretfile.txt.As you can see it is just a plain text file. [[email protected] tmp]# cat secretfile.txt This is a secret file that we do not … Read more