How to Detect Linux Distribution with Bash

How to Detect Linux Distribution with Bash

This is a simple bash function to get Linux dIstro information such as distribution, architecture and Kernel version. I have managed to use this function in many of my scripts when sending monitoring emails. The Basic Function The function simply queries lsb-release for the distribution information and adds it to  a variable. lsb-release is not in all distributions, however if that is missing it will check other areas that this information might be.

x2goserver-4.0.0.0-4.1 Dependancy Issue

x2goserver-4.0.0.0-4.1 Dependancy Issue

update: This has now been resolved and x2goserver now works with RHEL and is derivatives The latest update to x2goserver (4.0.0.0-4.1) for RHEL and its derivatives currently have an issue where if you try to install x2goserver it requires a dependency that is not part of Red Hat. xorg-x11-fonts-core is a part of OpenSuse and not Red Hat yet the rpm requests it. I have asked the question on server fault but it looks like this is a software bug that…

Read More Read More

WordPress Theme Twenty Eleven: Add Sidebar to Single Posts

WordPress Theme Twenty Eleven: Add Sidebar to Single Posts

Problem The default WordPress Twenty Eleven Theme that I use on this site by default does not have a sidebar on single posts. The single posts will go from the example of the left to the right example Solution Update: There is a plugin that will do this all for you. Use Twenty Eleven Theme Extensions instead http://wordpress.org/extend/plugins/twenty-eleven-theme-extensions/installation/   You will need to edit two files for the theme. You can do this in two ways: 1. Edit the files directly in wp-content/themes/twentyeleven 2. Go to…

Read More Read More

Samba error: bind failed on port 137

Samba error: bind failed on port 137

Problem Samba will not start and is showing the following errors in the log files. Feb 6 15:27:02 server nmbd[22392]: [2013/02/06 15:27:02, 0] lib/util_sock.c:open_socket_in(822) Feb 6 15:27:02 server nmbd[22392]: bind failed on port 137 socket_addr = 172.16.203.142. Feb 6 15:27:02 server nmbd[22392]: Error = Cannot assign requested address Feb 6 15:27:02 server nmbd[22392]: [2013/02/06 15:27:02, 0] nmbd/nmbd_subnetdb.c:make_subnet(97) Feb 6 15:27:02 server nmbd[22392]: nmbd_subnetdb:make_subnet() Feb 6 15:27:02 server nmbd[22392]: Failed to open nmb socket on interface 172.16.203.142 Feb 6 15:27:02 server…

Read More Read More

Sendmail: dangerous permissions

Sendmail: dangerous permissions

If you ever get the following errors Feb  6 14:31:22 server sendmail[10862]: dangerous permissions=40777 on queue directory /var/spool/clientmqueue/ Feb 6 14:31:41 server sendmail[10875]: NOQUEUE: SYSERR(root): can not chdir(/var/spool/clientmqueue/): Permission denied This means that the permissions for the folder /var/spool/clientmqueue/ are incorrect simply correct the error by running the following commands chown -R root:smmsp /var/spool/clientmqueue chmod 770 /var/spool/clientmqueue

sysstat: No such file or directory

sysstat: No such file or directory

Problem When you run sysstat you might get the error Cannot open /var/log/sysstat/sa20: No such file or directory This is because sar logging is not enabled on the server yet. Solution Enable logging by running the following command dpkg-reconfigure sysstat Select <Yes> and press return. Manual Method If this does not work change the config file manually edit the file vi /etc/default/sysstat alter the line ENABLED from false to true ENABLED=”false” ENABLED=”true” Restart sysstat /etc/init.d/sysstat restart Wait 10 minutes and…

Read More Read More

Fedora 18: Setting a static IP address

Fedora 18: Setting a static IP address

This is a quick tutorial on how to set a static IP address using the terminal within Fedora 18. note: these instructions also work in Fedora 19. Disable Network Manager 1. First stop and disable the gnome network manager from running on boot. systemctl stop NetworkManager.service systemctl disable NetworkManager.service 2. Now start and enable the network service to run on boot. systemctl restart network.service systemctl enable network.service Set the Static Address 1. Check which interface(s) you want to set as…

Read More Read More