We’ve all probably done it at some point (or maybe this is your first time and you are frantically searching the web to find a fix). Ok, so i made a typo in the fstab when mounting a new drive. The server doesn’t reload properly and you’ve had to run to the server room in Read More…
Category: Linux
Determining your gateway when using DHCP
Scenario: I have a Centos 6.x VM which gets an IP address via DHCP. I could not get any external access so I wanted to start troubleshooting. The first step was making sure I had the correct gateway and could ping it. route -n This should display The IP address highlighted in red is the Read More…
Check an SPF record from your own server (CLI)
OS: FreeBSD/Centos From the CLI type nslookup Then press Enter -> and type the following set type=txt Press Enter -> Finally enter the domain name you want to check (eg gmail.com in this case) gmail.com Output: Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: gmail.com text = “v=spf1 redirect=_spf.google.com” Authoritative answers can be found from: gmail.com nameserver Read More…
“Warning: Parameter 1 to” “expected to be a reference, value given in”
We just upgraded an old Joomla website from PHP 5.2 from PHP 5.3 and got Warnings in a few pages The line of code that was spitting out the error was: if (method_exists($this, $event)) { return call_user_func_array ( array($this, $event), $args ); } else { Adding a @ sign fixed the issue: Read More…
How do I get my public IP address on the UNIX CLI ?
I’ve deployed a Centos server and wanted to make sure I was going out through the correct IP address. With a windows machine I would just use something like www.whatismyip.com. However, with only the CLI this isnt possible. Having a POP3 server external to this device I just popped the mail server to get the Read More…
Useful Perl commands
a) Delete tabs from file perl -i -pe ‘s/[ \t]+//’ myfile
The SSL password dilemma when starting Apache
OS: Linux Software: Apache 2.x Dilemma: You have set a passphrase on your SSL certificate. Upon starting Apache the default behaviour is interactively type the password in. This obviously has an impact on boot and when you need to automatically restart Apache. If this doesn’t fit your model then there are 2 options: 1) Remove the Read More…
How to disable SELinux.
OS: Centos 6 Whenever something isnt working properly – its normally due to SELinux ! One example I recently had was when I tried to simply FTP to a newly created internal server. After having a quick look over the vsftpd config I swiftly moved onto my next suspect: SELinux. Before I show you how Read More…
Connecting to a share on Linux via Windows 2003 (SP1) NFS Client
Scenario: We have an NFS share on a Centos 6.x server – which other Linux machines use for a data repository. A requirement arose in the network to use a Windows 2003 to server to connect to this share. I believe Windows 2003 SP2 and 2008+ all ship with the NFS Client (although you may Read More…
Setting up a daily cron job to mysqldump
Here is a a little life saver to dump a MySQL DB via cron and zip it up in date format 0 2 * * * root mysqldump -u root -pPASSWORD databasename | gzip > /tmp/DBBACKUPS/database_`date ‘+%Y-%m-%d’`.sql.gz This runs at 2am every morning. You can then set up another cron to delete old files or use logrotate to save Read More…
You must be logged in to post a comment.