The following tutorial explains how to install MySQL on CentOS 6 using the YUM package manager, these instructions should also work with CentOS 4 & 5. CentOS install MySQL via YUM
CentOS Install Git
To install git on CentOS 6 simply use the following yum command.
CentOS 6 Install Git using YUM
Enter the following as root:
1
|
|
This will give you an output similar to the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
CentOS Install Development Tools
How to install the CentOS development tools yum group, a collection of RPM packages required by developers or administrators wishing to build / compile software on CentOS.
CentOS install Development Tools YUM Group
Enter the following command to install the developer tools on CentOS Linux:
1
|
|
This will then install all relavent developer RPM’S (which could take some time depending on your connection speed).
Dig IPv6 Lookup / Reverse Lookup
If you are in the process of setting up IPv6 there are a couple of dig commands you should know, how to do a IPv6 lookup on a AAAA record and how to do a IPv6 reverse lookup.
How To do a IPv6 AAAA (Dig IPv6 Forward Lookup)
The following command shows you how to do a Dig IPv6 lookup on Linux:
dig AAAA ipv6.google.com
This should give you an output similar to:
; <<>> DiG 9.8.3-P1 <<>> AAAA ipv6.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55360
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ipv6.google.com. IN AAAA
;; ANSWER SECTION:
ipv6.google.com. 43199 IN CNAME ipv6.l.google.com.
ipv6.l.google.com. 299 IN AAAA 2a00:1450:400c:c06::93
;; Query time: 48 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Nov 3 12:20:09 2012
;; MSG SIZE rcvd: 82
How To do a IPv6 Reverse Lookup on Linux, using Dig IPv6 Reverse Lookup
To do a Dig reverse lookup on Linux simply use the -x option followed by the IPv6 IP address, here is an example using Googles IPv6 address above.
dig -x 2a00:1450:400c:c06::93
This will give you an output similar to:
; <<>> DiG 9.8.3-P1 <<>> -x 2a00:1450:400c:c06::93
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20188
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;3.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.0.c.0.c.0.0.4.0.5.4.1.0.0.a.2.ip6.arpa. IN PTR
;; ANSWER SECTION:
3.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.0.c.0.c.0.0.4.0.5.4.1.0.0.a.2.ip6.arpa. 43198 IN PTR wb-in-x93.1e100.net.
;; Query time: 43 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Nov 3 12:25:00 2012
;; MSG SIZE rcvd: 123
Linux Show Hidden Files
Linux hidden files are prefixed with a . for example .htaccess would make this a hidden file, by default when you list a directories contents in Linux they are not displayed.
Linux Show Hidden Files Command
Change to the directory you wish to list the hidden files and enter the ls command with the following options:
1
|
|
ls -la (the Linux show hidden files command) should give you an output similar to the following:
1 2 3 4 5 6 7 8 9 |
|
Linux Find Large Files
This is by far the easiest way to display the 50 largest files on your Linux system, obviously you can modify the command to show more or less files if you wish.
Linux show largest files
Display the 50 largest files on a linux / unix based system.
1
|
|
Enjoy.
Bash Alias Example
A Bash alias is often used for commands with a long option list that you use regularly and want to save yourself some time typing or reading the man file each time you wish to run the command.
A good example of this (for me) would be nmap, I often run nmap scans against boxes, and I have memorised the options I use, to save myself some time I might create the following bash alias:
Bash Alias Example
I would normally run a scan using:
1
|
|
So I could create the following Bash alias:
1
|
|
Now I can use the command:
1
|
|
The above will run a scan on a host and it will execute nmap -sS -sV -P0.
Aliases are limited to a simple textual shortcut, if you need more power use a bash function instead.
How to Change Crontab Editor
By default on Linux based systems Vi is used to edit the crontab, some of you might prefer Emacs (shame on you) and some others might even prefer to use Nano or Pico (no comment). Regardless of your reason not to use Vi for editing your crontab (I can’t think of any?), here are the instructions on how to change the crontab default editor in Linux (any version, Ubuntu, CentOS, Debian etc).
Set Nano as the default crontab Editor
Note, this will also change the default editor for a number of other commands.
Set Nano as the default editor in Linux:
1
|
|
Set vi as the crontab editor
Note, this will also change the default editor for a number of other commands.
Set Vi as the default editor in Linux:
1
|
|
Set Emacs as the crontab editor
Note, this will also change the default editor for a number of other commands.
Set Emacs as the default editor in Linux:
1
|
|
Now when you type “crontab -e” it should load up with your editor of choice, if it does not you might need to specify the full path to the editor (depending on what shell you are using).
Linux Check Free Disk Space
The following will show you how to check disk space in Linux, using df command line tool, note this will show you the amount of disk space used and show free space in Linux.
Linux Disk Space Command (df)
Enter the following to show the amount of disk space used and free space on all mounted linux partitions, note the command with no other options will display the disk usage in K:
1
|
|
This will display an output similar to:
However looking at Linux disk usage in Kilobytes can be a daunting task these days, I much prefer to view my disk usage in MB / GB in Linux using the following df command option:
1
|
|
Which should give you an output simliar to:
Asterisk: You Do Not Appear to Have the Sources for Kernel Installed
If you get the following errors (or similar) when trying to build Asterisk you do not have then see the fix below to install the kernel devel / kernel headers. I have created this tutorial due to the amount of support requests received from my original tutorials, Asterisk Ubuntu Install, Asterisk Debian Install & Asterisk CentOS install.
Asterisk Build Errors Related to Kernel Headers / Devel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
The CentOS, RHEL & Fedora fix
To fix the above Asterisk kernel compile / build error on CentOS, RHEL & Fedora enter the following:
First update with YUM:
1
|
|
Install the kernel headers & kernel devel on CentOS / RHEL:
1
|
|
Reboot and attempt to rebuild Asterisk / DHADI tools, if it still fails check your kernel version with:
1
|
|
And then check the linked kernel source:
1
|
|
Check the symbolic link with:
1
|
|
If the link is broken fix it with:
1
|
|
Ubuntu / Debian Install Kernel Source for Asterisk
The following command will fix the asterisk kernel build error on Debian / Ubuntu based distributions.
Ubuntu install kernel source:
1
|
|
If you are running Debian or Ubuntu as root you can drop the sudo command, use:
1
|
|