Upgrading from Ubuntu 12.10 to 14.04

Seems that a few of my instances in AWS were originally setup using Ubuntu 12.10.  Don’t know how that happened, but anyways.  Now that 12.10 is no longer support you can’t just upgrade. So the solution is to use the old.releases.ubuntu.com site and update/upgrade from there. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak sudo sed -i -re ‘s/us-west-2.ec2.archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g’ […]

Nginx Deny IP

This is a quick way to deny an ip address accessing your nginx server. Create a new file in /etc/nginx/conf.d called blockips.conf Add the following to the file: deny <bad ip>; Then restart nginx.  The log file will now show 403’s for the IP address. For more info see: http://www.cyberciti.biz/faq/linux-unix-nginx-access-control-howto/

Fixing SELinux Content in a HTML directory

Unable to access web files in a directory under the /var/www/html becuase of a 403 forbidden might be a context problem. Problem Getting a 403 forbidden error message when accessing a new file or directory in /var/www/html. Check /var/log/messages to see if there are any: Sep 13 13:11:28 fserver02 kernel: audit(1221336688.892:14): avc:  denied  { getattr […]

Setting up VNCServer

How to setup vncserver on a linux machine to run gnome or kde. Initialize Startup vncserver for the first time on port 5910 (:10) and set the password. [root@localhost ~]# vncserver :10 You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /root/.Xauthority New ‘localhost.localdomain:10 (root)’ desktop is localhost.localdomain:10 […]

Setting up ntpd

A quick way to setup ntpd to set the system and hardware clock On a Redhat system (Redhat, CentOS, Fedora or Oracle Linux) edit the /etc/sysconfig/ntpd file: Change: SYNC_HWCLOCK=no to SYNC_HWCLOCK=yes Add: -x to OPTIONS so that the clock will be set every time ntpd is started OPTIONS=”-u ntp:ntp -p /var/run/ntpd.pid -x” Now make sure […]

Setup LDAP with Openfiler

How to configure LDAP so that Windows shares will work with Openfiler. Configure LDAP for Samba The assumption is that LDAP is already up and running with user accounts with the posixAccount object classes. Add samba.schema to LDAP Copy samba.schema from /usr/share/doc/samba-3.0.10/LDAP to /etc/openldap Add the samba.schema to slapd.conf include         /etc/openldap/schema/samba.schema Install smbldap-tools Copy all […]

Disk Performance

Using hdparm to measure a hard disks performance. To measure the current performance of your disk run: hdparm -tT /dev/sda You will get something like: /dev/sda: Timing cached reads:   896 MB in  2.01 seconds = 446.06 MB/sec Timing buffered disk reads:  168 MB in  3.01 seconds =  55.77 MB/sec