linux

Setting up IPv6 connectivity for my home LAN and my laptop

Our ISP has been saying that they will be rolling out a trial of IPv6 for more than 3 years now. Since this does not appear to be forthcoming I decided instead to make use of an IPv6 tunnel.

This tunnel behaves in much the same way as a VPN tunnel. You use IPv4 to connect to an endpoint, then use IPv6 addresses on the tunnel virtual interfaces. I used the Hurricane Electric tunnelbroker.net for my home IPv6 access, and a sixxs.net AYIYA tunnel for my laptop when away from home. I chose the AYIYA for my laptop since it is NAT friendly and is a better choice if your IPv4 address changes regularly. Both services are free.

Since I have a simple Linux machine as my main router this was actually a straightforward process. If you have a router that supports IPv6 tunnels, this can be even easier. In my case I had to setup the tunnel interface in /etc/network/interfaces (this is a Debian install, this should be the same for Ubuntu). The actual IPs have been obfuscated):

iface eth1 inet6 static
address 2001:a:b:c::3
netmask 64

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
address 2001:aaaa:b:cccc::2
netmask 64
endpoint 216.218.226.238
local 1.2.3.4
ttl 255
gateway 2001:aaaa:b:c::1

Connecting to ProXPN with Linux

I recently heard about the VPN service from ProXPN. Since they were using OpenVPN under the hood I thought that it would be pretty straightforward to get running on my Ubuntu laptop (running 12.10 at the time of writing this). I have Vyper VPN (also using OpenVPN) working on this exact same configuration.

It turns out that officially there is no support for Linux, and the only downloads were .dmg (OsX), and .exe (windows)files. This was not looking good.

What I did first was to use 7zip to extract the contents of the downloaded .exe file. In the extracted folder was a folder called "config". In this folder was the .ovpn config file, was well as a folder called "ssl" which contained all of the required certs:

  1.  ls config/ssl
  2. ca.crt  client.crt  client.key

With this information I was able to build a command line to connect to the ProXPN service. The only two missing pieces was an auth.txt file containing my ProXPN username (an email address) and password. This is the same username and password you used to register with them.

Mounting Virtualbox Shared Folders in Linux

Shared folders are pretty easy to access. It turns out that is also pretty easy to do under Linux as well.

  1. sudo mount -t vboxsf -o umask=000 sharename /path/to/mount/point

The only catch is that you need to create the mount point first, just like most other file systems.

Connection issues with recent Samba versions and the DNS-323

I was trying to connect to my DNS-323 from my laptop running a recent version of Ubuntu. When I attempted to map a share I received the following error.

Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
tree connect failed: NT_STATUS_ACCESS_DENIED

The solution is to put

  1. client lanman auth = Yes

in the local (client) smb.conf file.

Setting the CPU Frequency Govenor from the Command Line

Most modern processors support some level of frequency scaling, that is they change the speed or frequency that they are running at in order to reduce energy consumption. You can usually change the frequency with a GUI app but what happens if there is no GUI running (on say a server). The command is called cpufreq-set. You can get details (like processor statistics and current governor in use. Both of these are provided by the cpufrequtils package which you can just apt-get or aptitude install

The problem is that cpufreq-set only sets one core or CPU at a time. On a dual or quad socket this could get quite tedious. Fortunately there is an easy solution.

  1. for each in `cat /proc/cpuinfo |grep processor |cut -f 2 -d \:` ;do sudo cpufreq-set -c $each -g performance ; done

What I do is run a small little bash script that iterates over all the CPUs and sets the governor to one set as a parameter to the script.

  1. #!/bin/bash
  2. # Wrapper to easily set the CPU Frequency Governor
  3.  
  4. # Check that a valid governor is set
  5.  
  6. GOVERNOR=$1
  7.  
  8. USAGE="This script requires a CPU governor as an argument, which should be one of: conservative, ondemand, userspace, powersave, performance
  9. For example: cpuscale.sh ondemand"
  10.  
  11. if [ "$#" = "0" ]; then
  12.         echo "$USAGE"
  13.         exit 1
  14. fi
  15.  
  16. # Creating an array with each of the CPUs numeric ID

Fixing :perl: warning: Setting locale failed." errors on a Debian or Ubuntu system.

The short short version is that I run the following four commands in sequence:

  1. export LANGUAGE=en_CA:en
  2. export LANG=en_CA.UTF-8
  3. locale-gen en_CA.UTF-8
  4. dpkg-reconfigure locales

Of course this example is specific to a Canadian English UTF-8 system. In the US, the language might be defined as something like en_US.UTF-8.

Syndicate content