Just realised that Mint 13 has been released!
Downloading the torrent now . . . .
Thursday, 24 May 2012
Tuesday, 22 May 2012
CentOS 6 Bridged Networking
If you are intending to run KVM under Centos, you will most likely want to use bridged networking.
I am starting with a standard CentOS 6 "minimal" install but the same process applies to RHEL and CentOS all versions.
First, install the bridge utils package;
Create/edit these two files, substituting the ipaddress and other details as applicable;
Restart your server and you should now have a bridge adapter called "br0";
Confirm the bridge;
I am starting with a standard CentOS 6 "minimal" install but the same process applies to RHEL and CentOS all versions.
First, install the bridge utils package;
yum install bridge-utilsCreate/edit these two files, substituting the ipaddress and other details as applicable;
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="no"
ONBOOT=yes
HWADDR=FF:FF:FF:FF:FF:FF # Use the actual hardware address for your NIC
TYPE=Ethernet
BRIDGE=br0
# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.0.1
PREFIX=24
GATEWAY=10.0.0.254 # You can put this in /etc/sysconfig/network if you prefer
DNS1=10.0.0.2
DOMAIN=example.net
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"Restart your server and you should now have a bridge adapter called "br0";
# ifconfig br0
br0 Link encap:Ethernet HWaddr FF:FF:FF:FF:FF:FF
inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::21a:64ff:fe78:3f44/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9092 errors:0 dropped:0 overruns:0 frame:0
TX packets:4424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9175506 (8.7 MiB) TX bytes:369549 (360.8 KiB) Confirm the bridge;
#brctl showbridge name bridge id STP enabled interfaces
br0 8000.001a64783f44 no eth0
virbr0 8000.525400badaa9 yes virbr0-nic
Sunday, 13 May 2012
The Games Industry
I'm old enough to have been there at the birth of what we now know as the multi-billion dollar "games industry" and I've been along for the ride ever since.
Over the last few years I have noticed a disturbing trend, and that is tying games to the Internet, even when the game has no online aspect at all (or virtually none).
I don't count idiotic "achievements" as online play.
This weekend on Steam, an entry for "Tropico 4" appeared in my library and the news section indicated that it is one of those "free weekend play" offers where you get to play the game for the weekend and then decide whether to buy it once the deal ends.
I've seen Tropico in the past and thought I might take a look. It took some time to download it on my slow adsl but eventually it was all done and installed.
So, this morning the weather is crappy so I decide to spend a few hours trying it out.
I fire up the game and lo, what are I met with but an "enter your email address and password" screen.
What? Yes, like so many modern games it requires that I must register the game before I can start it.
This wouldn't be so bad if the game at least used my existing Steam credentials but no, it is not that clever. I must provide details to "Kalypso Media" before I can play.
Apparently the benefits to me of this mandatory registration is the usual bunk that has been the unappetising bait for registration seekers since the dawn of time, namely "Game news, Updates, "premium support" and "community features".
Right. Nothing I want then. The only benefit that of any value, which is not mentioned in that list, is the ability to play the game in the first place.
Thanks but no thanks, I think I'll pass.
This is not the worst offender in the dubious registration stakes though, that accolade goes to Grand Theft Auto 4, which requires a grand total of three separate accounts (Steam, Rockstar Social Club and Windows Live) before you can play it.
Unbelievable.
It's this sort of nonsense which drives people to pirating games.
Obviously if you aren't playing it in Steam it only requires two registrations but that is still two too many.
I didn't register for Tropico 4 and have already deleted the game. That's one potential sale lost due to game industry stupidity.
Nice one marketing cretins.
Over the last few years I have noticed a disturbing trend, and that is tying games to the Internet, even when the game has no online aspect at all (or virtually none).
I don't count idiotic "achievements" as online play.
This weekend on Steam, an entry for "Tropico 4" appeared in my library and the news section indicated that it is one of those "free weekend play" offers where you get to play the game for the weekend and then decide whether to buy it once the deal ends.
I've seen Tropico in the past and thought I might take a look. It took some time to download it on my slow adsl but eventually it was all done and installed.
So, this morning the weather is crappy so I decide to spend a few hours trying it out.
I fire up the game and lo, what are I met with but an "enter your email address and password" screen.
What? Yes, like so many modern games it requires that I must register the game before I can start it.
This wouldn't be so bad if the game at least used my existing Steam credentials but no, it is not that clever. I must provide details to "Kalypso Media" before I can play.
Apparently the benefits to me of this mandatory registration is the usual bunk that has been the unappetising bait for registration seekers since the dawn of time, namely "Game news, Updates, "premium support" and "community features".
Right. Nothing I want then. The only benefit that of any value, which is not mentioned in that list, is the ability to play the game in the first place.
Thanks but no thanks, I think I'll pass.
This is not the worst offender in the dubious registration stakes though, that accolade goes to Grand Theft Auto 4, which requires a grand total of three separate accounts (Steam, Rockstar Social Club and Windows Live) before you can play it.
Unbelievable.
It's this sort of nonsense which drives people to pirating games.
Obviously if you aren't playing it in Steam it only requires two registrations but that is still two too many.
I didn't register for Tropico 4 and have already deleted the game. That's one potential sale lost due to game industry stupidity.
Nice one marketing cretins.
Monday, 7 May 2012
Friday, 4 May 2012
HOWTO: Upgrade from Lucid to Precise
UPDATED 12/06/2012. I have had reason to attempt this on two more systems and both times it was successful.
The Ubuntu distribution continues its rapid decline with the Precise release.
The Internet is teeming with examples of people who have discovered that upgrading to Precise is difficult at best, and near impossible at worst.
It doesn't appear that upgrading from the last LTS, 10.04 Lucid is possible at all.
Well, not easily anyway.
Attempting to upgrade a server from Lucid to Precise will most likely result in an error;
Searching the Internet might lead you to a suggested fix such as this one;
Apparently, sometimes that doesn't work either, forum post suggests adding apt to that command;
Having got that far, I received another error;
Joy.
No help was forthcoming from the Internet on that one.
So, I tried a desperate move.
I decided to remove the offending file (libnih-dbus1) and re-install it.
Now, before I continue, I should make it absolutely clear that what follows is capital N Nasty.
The server I was working on was a scratch virtual machine that I would not care about if I accidentally toasted it.
It is entirely possible that doing this on your server may completely trash it!
You have been warned.
OK, with that out of the way, what I did was this;
Apt went away and calculated a whole lot of dependencies that would be removed which resulted in it giving me a nasty warning;
Undaunted, I copy-pasted the list of files being removed into a text editor (just in case) and typed the "
After a while apt was finished.
Note: If you are following this "procedure", do not reboot your system now!
OK, I was afraid my SSH session or network (or something) may have been broken causing me to lose my connection (yes, I was doing this remotely) but the server still seemed to be working, which was good.
So I installed everything back.
This returned no errors.
Now, when we did the nasty remove of libnih-dbus1 and its dependents earlier, one of the things that was removed was the Linux kernel.
Without being to dramatic, it is fair to say that this is an extremely important package. Another important thing that was removed was openssh-server
Install them now;
The final thing to do is to reboot and to make sure everything is truly OK
The server rebooted without problems and finally I have managed to upgrade from Lucid to Precise.
Yay, I suppose, but it really shouldn't be that hard.
Canonical should spend less time working on horrible user interfaces and more time getting the basics right.
A final note: Check your list of files that were removed to check whether anything else that may have been installed was removed. You should manually re-install anything you need.
The Ubuntu distribution continues its rapid decline with the Precise release.
The Internet is teeming with examples of people who have discovered that upgrading to Precise is difficult at best, and near impossible at worst.
It doesn't appear that upgrading from the last LTS, 10.04 Lucid is possible at all.
Well, not easily anyway.
Attempting to upgrade a server from Lucid to Precise will most likely result in an error;
E: Could not perform immediate configuration on
'python-minimal'.Please see man 5 apt.conf under
APT::Immediate-Configure for details. (2)Searching the Internet might lead you to a suggested fix such as this one;
sudo apt-get install -o APT::Immediate-Configure=false -f python-minimalApparently, sometimes that doesn't work either, forum post suggests adding apt to that command;
sudo apt-get install -o APT::Immediate-Configure=false -f python-minimal aptHaving got that far, I received another error;
E: Couldn't configure pre-depend multiarch-support for libnih-dbus1, probably a dependency cycleJoy.
No help was forthcoming from the Internet on that one.
So, I tried a desperate move.
I decided to remove the offending file (libnih-dbus1) and re-install it.
Now, before I continue, I should make it absolutely clear that what follows is capital N Nasty.
The server I was working on was a scratch virtual machine that I would not care about if I accidentally toasted it.
It is entirely possible that doing this on your server may completely trash it!
You have been warned.
OK, with that out of the way, what I did was this;
apt-get remove libnih-dbus1Apt went away and calculated a whole lot of dependencies that would be removed which resulted in it giving me a nasty warning;
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'Undaunted, I copy-pasted the list of files being removed into a text editor (just in case) and typed the "
Yes, do as I say!" phrase as requested;After a while apt was finished.
Note: If you are following this "procedure", do not reboot your system now!
OK, I was afraid my SSH session or network (or something) may have been broken causing me to lose my connection (yes, I was doing this remotely) but the server still seemed to be working, which was good.
So I installed everything back.
apt-get install ubuntu-minimalThis returned no errors.
Now, when we did the nasty remove of libnih-dbus1 and its dependents earlier, one of the things that was removed was the Linux kernel.
Without being to dramatic, it is fair to say that this is an extremely important package. Another important thing that was removed was openssh-server
Install them now;
apt-get install linux-image-server openssh-serverThe final thing to do is to reboot and to make sure everything is truly OK
The server rebooted without problems and finally I have managed to upgrade from Lucid to Precise.
Yay, I suppose, but it really shouldn't be that hard.
Canonical should spend less time working on horrible user interfaces and more time getting the basics right.
A final note: Check your list of files that were removed to check whether anything else that may have been installed was removed. You should manually re-install anything you need.
Tuesday, 1 May 2012
Socks5 Proxy using SSH
ssh -f -N -D 0.0.0.0:1080 localhostNotes;
-f run as a daemon-N stay idle and don't execute commands on localhost-D dynamic port forwarding on port 1080You test it using curl;
curl --socks5 localhost:1080 www.google.com
Friday, 27 April 2012
Simple Monitoring of VPN links
I use this script to check the status of non-critical vpn links, but you could use it for anything where a simple ping test is sufficient and you couldn't be bothered setting up SNMP.
Of course SNMP + Nagios is a better choice for mission critical monitoring than simply pinging something like I do here.
Here is the script;
This will ping test to 192.168.1.2 as user "brett" every minute and send email alerts to brett@example.com
By default the script will send an email after the test has failed 5 consecutive times. This can be changed by editing the script and changing the TIMEOUT variable.
Of course SNMP + Nagios is a better choice for mission critical monitoring than simply pinging something like I do here.
Here is the script;
#!/bin/bash TIMEOUT=5 # Number of failed attempts before sending email STATUSDIR=/tmp/vpn # Status files are written here ADDRESS=$1 # The target address to be monitored EMAIL=$2 # Optional email address to send alerts to if [ ! -d $STATUSDIR ] ; then mkdir -p $STATUSDIR fi if [ ! -f $STATUSDIR/$ADDRESS ] ; then `echo "0" > $STATUSDIR/$ADDRESS` fi EXPECTEDCOUNT=`cat $STATUSDIR/$ADDRESS` if ping -c 1 -w 5 "$ADDRESS" &>/dev/null ; then DOWNCOUNT=0 else DOWNCOUNT=$(($EXPECTEDCOUNT+1)) fi echo "Expected count is :"$EXPECTEDCOUNT echo "Down count is :"$DOWNCOUNT # Something has changed if [ ! $EXPECTEDCOUNT = $DOWNCOUNT ] ; then if [ $DOWNCOUNT = 0 ] ; then STATUS="UP" else STATUS="DOWN" fi MSG="vpn-link: "$ADDRESS" is "$STATUS" (count="$DOWNCOUNT")" logger $MSG # if the change was to 0 or TIMEOUT then trigger an email if [ $DOWNCOUNT = 0 -o $DOWNCOUNT = $TIMEOUT ] ; then # If the expected count has not reached the timeout setting then # we dont want to send email EXPECTEDCOUNT=$(($EXPECTEDCOUNT+1)) if [ $EXPECTEDCOUNT -ge $TIMEOUT -a -n "$EMAIL" ] ; then echo $ADDRESS" is "$STATUS": Sending email" mail -s "$MSG" $EMAIL < /dev/null > /dev/null fi fi echo $DOWNCOUNT > $STATUSDIR/$ADDRESS fiTo use it simply place the script in a convenient location such as /usr/sbin and create an entry in your system crontab like this;
* * * * * brett /usr/sbin/vpn-mon 192.168.1.2 brett@example.com >> /dev/null 2>&1This will ping test to 192.168.1.2 as user "brett" every minute and send email alerts to brett@example.com
By default the script will send an email after the test has failed 5 consecutive times. This can be changed by editing the script and changing the TIMEOUT variable.
Subscribe to:
Posts (Atom)