Juniper/Aventail VPN Fix for Ubuntu 10.04

June 8th, 2010 Ron No comments

With the release of Ubuntu 10.04, the tun driver, commonly used for VPN connectivity, has been moved into the kernel, instead of being loaded as a module as it was previously.  Unfortunately, the Juniper and Aventail VPN clients check for VPN support in the kernel by running a “modprobe tun”, instead of checking for the presence of the device nodes.  This causes the VPN connections to immediately fail, even though they would otherwise succeed.  Searching the Ubuntu forums, I happened upon this thread:

http://ubuntuforums.org/showthread.php?t=1459559

After trying a couple of the other fixes, I finally found a script, posted by cdenley (http://www.chrisdenley.com/) which successfully works around the issue by creating a null driver named tun, which the VPN clients can then modprobe with no harmful results to satisfy their requirements.


#! /usr/bin/env bash
sudo apt-get install build-essential linux-headers-`uname -r`
mkdir faketun
cd faketun
echo -e "#include <linux /module.h>\nstatic int start__module(void) {return 0;}\nstatic void end__module(void){return;}\nmodule_init(start__module);\nmodule_exit(end__module);">tun.c
echo -e "obj-m += tun.o\nall:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) modules\nclean:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) clean\nclean-files := Module.symvers">Makefile
make
sudo install tun.ko /lib/modules/`uname -r`/kernel/net/tun.ko
sudo depmod -a
sudo modprobe tun
Categories: Linux Tags:

Al Franken Embarrasses Comtastrophe (Comcast)

February 15th, 2010 Ron No comments

I have to say, I’m a huge fan of Al Franken.  He’s the kind of no-BS senator we’ve needed for a while.  Personally I’m hoping there are more like him that will step up to take on the corruption in D.C.  While catching up on my RSS feeds today, I stumbled upon this gem, where Al Franken grills Brian Roberts (CEO, Comcast).

Really, Mr. Roberts?  You actually believe that Comcast is #1 in their industry?  Perhaps in size, but certainly not in customer satisfaction, where Comcast’s reputation for poor customer service (Wikipedia) speaks for itself.  Even the comments on the above YouTube video reflect the utter disgust people have with Comcast, with an employee chiming in:

As a Comcast employee, I totally agree with Senator Franken on this issue. He is one hundred percent right about the double dealings of Brian (anti union) Roberts and his cronies.

Sorry Mr. Roberts, but you’ll need to do more than just re-branding your services to convince us that you’ll act in consumers’ best interests if the NBC acquisition/merger is approved.  In fact, let’s pose these two survey questions to your customers:

  1. If a competing provider were to offer equivalent service to your Comcast services, would you be interested in switching?
  2. Would you still be interested in switching your services if the competing service provider had higher prices for the services you use?

Personally, I would say yes to both, and I think Comcast’s executives might be surprised at just how many people feel the same way.  Comcast feels like they don’t have to fear the FCC because the FCC has no real teeth.  They are forgetting one very important factor though:  It was the FCC that granted the market-monopolies that Comcast has exploited to build its network to gigantic proportions, and the FCC can take those away just as easily.  If you prod the old bear, you’ll see just what he can do to you.  And the FCC knows this too.  They’re already considering forcing the telecoms to share their lines outright (Ars Technica), so it’s just a matter of time before they aim this sort of thing directly at Comcast.  Count your days, Mr. Roberts.  They are numbered.

Proof That Fox News Sucks

December 4th, 2009 Ron No comments

Doing my usual morning ritual of catching up on Google Reader I noticed something amusing…absolute proof that Fox News is inept and does not check their facts before finding some way to attack Obama. Oh no! If Fox News is wrong…where are closed minded people to get their information?!?!
fox_news_ineptitude
Fox: Where are the jobs?
AP: Unemployment rate fell in November.
Fox News FAIL!

Categories: Uncategorized Tags:

Back up a cPanel server via SSHFS

November 13th, 2009 Ron No comments

So you have a cPanel server and want to set up automated, off-site backups, just in case anything should happen? This can be done easily with a FUSE (filesystem in userspace) module called SSHFS, and requires a minimum of setup. SSHFS allows one to mount any remote directory accessible via SFTP to a local filesystem. Cool, huh?

All you really need to accomplish this is access to a server via SSH with sufficient disk space to hold your backups, and the FUSE module available on your server. (Many VPS providers are willing to enable this for you if it is not already enabled)

Notice: The following howto assumes that you are a competent linux/unix administrator. I take no responsibility for any damage or data loss which may be caused by following these instructions.

Step one: Set up a passwordless SSH key on the cPanel server.

First, we need to generate an SSH key:
ssh-keygen
Be sure you leave the passphrase option blank, or the automatic part won’t work so well :) . The default options will work fine for this.

Now, you will need to get the public key from the cPanel server that you will be importing:
cat ~/.ssh/id_rsa.pub
The above assumes you did not choose a DSA key, or opt to store it in a location other than default. Copy the text that the above command outputs.

Now, move over to your remote/backup server, and run the following:
echo "text you copied from the cPanel server" >> ~/.ssh/authorized_keys
chmod 640 ~/.ssh/authorized_keys

Next, go back to the cPanel server and test to ensure that the public key login works:
ssh user@remote_server
If the public key is installed correctly, you will be logged into the remote server without any password prompts.

Step two: install SSHFS

For purposes of this howto, I’m assuming you are using CentOS, in which case you can install sshfs with the following command:
yum install sshfs
Say yes to any dependencies it may prompt you to install.

Step three: Configure the fstab on your cPanel server to mount a backup directory

Assuming you want your backups to go to /backup on the local cPanel server (replacing /path/to/storage with the appropriate path on the remote server):
mkdir /backup
echo "sshfs#user@remote_server:/path/to/storage /backup fuse noauto,compression=yes,nonempty" >> /etc/fstab

Test this mount with the command “mount /backup” If you receive no errors, the mount should be working correctly.

Step four: Configure the cPanel backup

Visit the address https://_your_cpanel_server_:2087/scripts/backupset
in your web browser, and configure the settings to your liking, making sure to select the following:
Backup Status: Enabled
Remount/Unmount backup drive: Enabled
Bail out if backup drive mount fails: Enabled
Backup destination: /backup

Step five: Profit

Now, every night at 1AM (server time) your server will automatically back up to the remote server via SSH.

Categories: Uncategorized Tags: , ,

Create Debian Lenny Xen VE

October 28th, 2009 Ron No comments

I got sick of doing the same bunch of things every time I created a new VE so I wrote myself a script. It takes only one argument: The path to the lvm volume you want to use as the root device.


#!/bin/bash

mkfs.ext3 "$1"
mkdir -p /media/buildvetmp
mount "$1" /media/buildvetmp
debootstrap lenny /media/buildvetmp http://aptcache:3142/ftp.us.debian.org/debian/
sed -n '/########/,$p' /root/buildve.sh | sed -n '/bin\/bash/,$p' | sed -n '/########/,$p' | sed -n '/bin\/bash/,$p' > /media/buildvetmp/buildve.sh
chmod 700 /media/buildvetmp/buildve.sh
chroot /media/buildvetmp /bin/bash /buildve.sh
rm /media/buildvetmp/buildve.sh
umount /media/buildvetmp
rm -r /media/buildvetmp

exit

###################chroot starts here
#!/bin/bash

echo "/dev/sda2 / ext3 relatime,nodiratime 0 0
/dev/sda1 none swap sw" >> /etc/fstab
echo "APT::Default-Release \"stable\";" >> /etc/apt/apt.conf
rm -f /etc/apt/sources.list
echo "deb http://ftp.us.debian.org/debian lenny main contrib non-free
deb http://ftp.us.debian.org/debian testing main contrib non-free
deb http://packages.dotdeb.org stable all" >> /etc/apt/sources.list
echo "Acquire::http::Proxy \"http://aptcache:3142/\";" >> /etc/apt/apt.conf.d/80proxy
echo "127.0.0.1 localhost" >> /etc/hosts
rm /etc/hostname
echo "localhost" >> /etc/hostname
echo "
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.0.49
netmask 255.255.0.0
network 10.0.0.0
broadcast 10.0.255.255
gateway 10.0.0.1" >> /etc/network/interfaces

apt-get update
apt-get -y install linux-modules-`uname -r` libc6-xen vim

echo "#!/bin/bash
apt-get -y install udev openssh-server syslog-ng ntp
sleep 5
rm -f /etc/rc2.d/S20installpkgs
sleep 1
shutdown -r now" >> /etc/rc2.d/S20installpkgs
chmod +x /etc/rc2.d/S20installpkgs

exit
Categories: Uncategorized Tags:

BlackBerry OS 5.0 for Storm Released

October 26th, 2009 Ron No comments

So Verizon has finally released the new 5.0 OS for the BlackBerry Storm and I’d just like to say WOW. This is 99% better and is really how the phone should have been all along.

They’ve added new glow effects to the UI, giving it an all-new shiny. There’s also the elastic scrolling effects I think Storm users have been hoping for since day one. Threaded SMS has been added as well, which will definitely please anyone who does a lot of texting. Speaking of text…the new predictive text entry system is a nice addition as well, and seems to be quite effective at correcting most of my typos as I write this blog entry on my BlackBerry. On top of all of this, the phone exhibits greatly improved performance, on par with what one would expect given that its hardware is really no slouch.

Kudos to RIM on getting a software update out there that makes the Storm behave like a whole new device. I was still a bit disappointed that there’s no sign of a mixer for audio, so incoming texts will still interrupt any music you have playing. Aside from that…its a shame it took them nearly a year after the Storm was launched to get this update out there!

Categories: Gadgets Tags:

Loan Payoff Calculator

September 5th, 2009 Ron No comments

This has probably been done before, but this script fixes two problems I’ve noticed with loan calculators:

  1. They assume monthly interest compounding (most loans are compounded daily)
  2. They don’t allow you to calculate the payments if you’re splitting your payment (eg: paying $200 twice a month instead of $400 once a month)
  3. 
    #/usr/bin/env python
    import math
    
    # Remaining amount on the loan
    toPayOff = 12345.67
    # Interest rate
    intRate = 12.34
    # Amount of your payment
    payAmt = 200
    # Making the payment every x days
    payEvery = 15
    # Maximum amount you're willing to pay extra to just "pay it off"
    balloonMax = 200
    # Days til the next payment
    runUpDays = 15
    
    # Do not edit below this line
    days = 0
    pmtNum = 0
    dailyInt = (intRate / 100) /365
    origToPayOff = toPayOff
    totalPaid = 0
    while (runUpDays > 0):
        toPayOff = (math.ceil((toPayOff * (1 + dailyInt))*100))/100
        runUpDays -= 1
    while (toPayOff > 0):
        days += 1
        toPayOff = (math.ceil((toPayOff * (1 + dailyInt))*100))/100
        if (days % payEvery == 0):
            toPayOff = (math.ceil(toPayOff * 100))/100
            if (toPayOff < (payAmt + balloonMax)):
                payAmt = toPayOff
            toPayOff -= payAmt
            pmtNum += 1
            totalPaid += payAmt
            print "Payment #%s\tPayment Amt: $%s\tBalance:%s" % (pmtNum,payAmt,toPayOff)
    print "Over %s payments, you will pay a total of $%s ($%s in interest)" % (pmtNum,totalPaid,(totalPaid-origToPayOff))
    
Categories: Uncategorized Tags:

SCO isn’t dead yet?

August 26th, 2009 Ron No comments

Why the F*** hasn’t SCO died yet? They’ve gotten slapped around in court by IBM’s attorneys, declared bankruptcy, shed most of their staff… If not for the utter ignorance of the courts, they’d be gone. Now today, I read that a judge overturned the ruling that Novell owns the Unix copyright? C’mon…this is ridiculous. SCO is only suing because UNIXware is dead. If they DARE to take IBM back to court, I pity them for what they’ve got coming.

ref: http://www.networkworld.com/news/2009/082409-sco-unix-copyright-decision-overturned.html

Categories: Uncategorized Tags:

LGBT Rights Arguments

June 21st, 2009 Ron No comments

Reading an article at http://www.dowhatsrightohio.com/ my eyes landed on what’s probably the best simple breakdown of all of the arguments people are using to try to strip rights from the LGBT community. I felt compelled to take the time to challenge their logic flaws:

a.) homosexuality is a choice so it shouldn’t be protected;

  • To this, I’d simply like to ask…what person would choose a more difficult life. If it was simply a matter of choice, I don’t think you’d have so many people making the same choice for a more difficult life.

b.) homosexuality is a behavior so it shouldn’t be protected;

  • Protesting is a behavior, yet that right is protected. Saying something shouldn’t be protected because it’s a behavior just makes no sense…look how many “behaviors” are already protected.

c.) homosexuals don’t meet the 3 three Supreme Court criteria for civil rights protection so they shouldn’t be protected (economically disadvantaged, immutable characteristic, politically powerless);

  • By limiting the rights of the LGBT community, including restricting their ability to legally marry, you create a situation of economic disadvantage as the LGBT couples are no longer able to receive the same work and tax benefits as their straight counterparts. This becomes increasingly exacerbated as you look at all of the places today where one can have their employment terminated for no other reason.
  • There has been no solid proof that one’s sexual orientation can be changed either willingly or forcibly. In fact there’s been a fair bit more research that suggests that this is indeed an immutable characteristic.
  • The article itself states that the LGBT community is approximately 3% of the population. How does this not equate to being politically powerless?

d.) protections for homosexuals violate my religious freedoms so they shouldn’t be protected

  • Someone needs to go back to high school and study the bill of rights again. People do not have unlimited rights, and their rights end where others’ begin. Your right to religious freedom CAN NOT override the rights to legal protections for LGBT persons.

I would like to see the conservatives fighting against the rights of their fellow man have a solid argument for what they’re doing. This isn’t because I believe that there IS a solid argument, just because I’d like to think that they have a reason aside from hatred and bigotry for what they’re doing.

Categories: Uncategorized Tags:

A Lol A Day…

April 29th, 2009 Ron No comments

Me: I’m getting faster at whipping out the python
Mike: nice
Mike: lol
Me: oh that sounded bad
Me: srsly didnt mean it THAT way
Me: lol
Mike: well you know when its that big you have to come up with procedures for whipping it out speedily without getting injured
Me: LOL

Categories: Randomness Tags: ,