Games

A Quick Review of Borderlands for PC

I bought Borderlands on Steam; played as a soldier; spent ~30-40 hours on it; and finished at level 36. My favorite weapon was the Desert Stomper combat rifle.

Here are my quick thoughts on the game…

Pros…

The artwork – The watercolor look of the game is unique and a really nice break from the usual textures. It was always interesting but never distracting.

The loot – Ridiculous amounts of it really. It didn’t take long to rack tons of cash, weapons, shields, and grenades.

The weapons – The shear number and types of weapons turned into a sort of mini game for me. I found myself constantly swapping them looking for the best load out.

The save system – It’s a checkpoint system, but there are plenty of them; also, the game saves automatically when you exit. It was nice not having to manage the saves

Cons…

The map system – Essentially useless. There is no overall world map to show which part of Pandora your quest is located or how the various areas connect to one another. This makes using game’s teleportation system a lot like trying to find a needle in a haystack.

The vehicle weapons – You get a rocket launcher and a machine gun. Unfortunately, both are seriously nerfed. Luckily the best weapon on the vehicle is the vehicle itself – just running over baddies gets the job done.

The bad guys – In a word… repetitive. You can only fight so many bandits, burning psychos, and skags before you want to throw down your guns and head back to Fyrestone to have a beer with Dr. Zed.

The ending – No spoilers, but let’s just say that it left me wondering if maybe the fire alarm went off and Gearbox developers decided to finished the game quickly and run out of their building.

Tips…

Aim for the head – good advice in any game, but headshots are especially effective in this one.

Armor and health – With the plethora of weapon make and models it would be easy to focus on your offensive firepower. Spend time initially though building up your HP and getting the best shield you can.

Avoid weapons with ridiculously high damage – rocket launchers, some shotguns and sniper rifles in this game feature damage that seems too good to be true. “Damage 850!? Woo hoo!!” Turns out that most are significantly nerfed. Focus on having a balanced weapon. Accuracy and recoil reduction are important stats.

BSD

Install and Configure Hamachi on FreeBSD

Update: Due to protocol changes instituted by LogMeIn on or around July 30 2012, the linux-hamachi client version referenced in the post can no longer be used to login to Hamachi servers. This post will be retained for archival purposes.

In this post I’ll discuss how to install and configure Hamachi and SSH on a machine running FreeBSD. If you’re not familiar with LogMeIn Hamachi (formerly known as just “Hamachi”), it is a hosted VPN service that is capable of establishing secure LAN-like links between computers, even if they’re behind Network Address Translation (NAT) devices. You can use it to create secure virtual networks on demand, across public or private networks.

In order for Hamachi to work, a “mediation server,” operated by the LogMeIn, is required. The mediation server stores machine nicknames, statically allocated 5.0.0.0/8 IP addresses and the associated authentication token of the user. Hamachi is free for non-commercial use. However, the Hamachi security implementation is closed source and as such is not available for review by the general public.

The versions for the software used in this post were as follows:

  • FreeBSD 9.0-RELEASE
  • linux-hamachi-0.9.9.9.20

Install Hamachi

Hamachi requires Linux binary compatibility which is not turned on by default in FreeBSD 8.2-RELEASE. The easiest way to enable this functionality is to load the linux KLD object (“Kernel Loadable Object”) by typing the following as root:

Then add the following line to /etc/rc.conf:

Now we’re ready to install Hamachi. If you’ve installed the FreeBSD ports collection then run the following as root to install the Hamachi port:

Otherwise you can grab the binary package and install it:

Now, let’s configure Hamachi and create our VPN. Hamachi requires the tap kernel driver to create and manage its virtual Ethernet network interface. No worries though, Hamachi adds the script /usr/local/etc/rc.d/hamachi that will automatically load the tap driver if_tap.ko. This driver must be loaded and running before starting Hamachi itself. You can have it load automatically when FreeBSD starts by adding the following line as root to /etc/rc.conf:

If you want only to run Hamachi periodically and not start the tap driver automatically at boot time, you can use forcestart/forcestop as root, which will ignore the setting in /etc/rc.conf:

Our next step generates the cryptographic key pair and creates a directory at ~/.hamachi where Hamachi will store these keys, as well as its configuration and state. This step only needs to be performed once per Hamachi install; however, it must be done for each user account that you plan to use Hamachi from, including root. Consequently, we’ll run the following commands from our user account:

Okay, now let’s start Hamachi. First, make sure the tap driver is loaded by rebooting the machine (assuming the hamachi_enable=”YES” line is in /etc/rc.conf as described above) or by using the forcestart command, then:

When Hamachi is run for the first time, the Hamachi daemon stays offline. Let’s bring it online:

Next, create a nickname for the FreeBSD machine so that we can identify it easily from another machine on your Hamachi VPN:

Now, let’s create our Hamachi VPN. In this step you’ll need to enter a unique name for your network as well as a password for it. If your network name is already in use somewhere you’ll need to keep trying until you land upon one that’s unique. If you’ve setup a Hamachi VPN previously and simply want to add your FreeBSD machine to it, then substitute join for create in the following command:

Now let’s put the FreeBSD machine online on the VPN:

That’s it. Your Hamachi VPN should now be up and running with your FreeBSD machine added as one of the hosts. What if we reboot, do all these commands need to be entered again? The answer is no. Once the Hamachi VPN is created/joined, the nickname established, and the machine added with the go-online command, should you need to reboot your box, you can simply restart the tap driver (assuming you elected not have it start automatically) and then start Hamachi, you’ll then be back online. However, you can also have Hamachi start automatically at boot time by adding a shell script in your system startup sequence. You will of course want to have the tap driver start automatically as well for this to be of any benefit. Here’s a generic version of the script I use:

To use this script simply add your account user name, save it as hamachi_start.sh in /usr/local/etc/rc.d/ and make it executable. You’re free to choose a different name, however, note that scripts within /usr/local/etc/rc.d/ are executed in lexicographical order. Since it is desirable that the existing script hamachi start first in order to load the tap driver, you should name the hamachi start script something that will ensure it starts after hamachi. Numbers may be used as a prefix to the filename.

You can display the status of the Hamachi daemon at any time by running the command hamachi without any arguments:

The following commands will retrieve the nicknames and print a list of the hosts that are currently members of your Hamachi VPN, as well as their Hamachi IP addresses (you will not see the machine you issued the command from listed):

And if needed, you can stop Hamachi with the command hamachi stop:

Now then, to initiate a terminal session with another host on your Hamachi VPN:

If this is the first time connecting, you’ll likely receive a warning concerning the authenticity of the host you’re trying to reach along with a fingerprint of its public RSA key, and asked if you’re sure you want to continue connecting. Accept by typing yes and you’ll be presented with the login and password prompt (this warning prompt will only occur once per machine). The public key from the remote host will be stored in ~/.ssh/known_hosts. If you don’t want to have to remember the Hamachi IP address each time you want to run a session with another host, simply add this IP address along with a name (e.g. home-server-ssh) to your hosts file (/etc/hosts). Next time you use Hamachi/SSH to connect to this host, use the name instead of the IP address and the host file will resolve the IP address for you.

SSH Server

Now that we’ve installed Hamachi, created or joined a VPN, and perhaps tested it by connecting to another host on the VPN. Let’s make sure there’s a running SSH server on our FreeBSD machine so that incoming SSH requests can be answered:

Should you need to install sshd, type sysinstall. Select Configure ->Networking and select sshd from among the options. Make sure sshd enabled by checking the /etc/rc.conf file for the line sshd_enable=”YES”. This will load sshd the next time your system starts. You can also start sshd manually as root through the /etc/rc.d/sshd script:

Conclusion

This post described how to install and configure Hamachi on a machine running FreeBSD. The reason I like using LogMeIn Hamachi is that it allows me to connect via SSH, SCP or SFTP to my FreeBSD machine at home from essentially anywhere I have an internet connection without the need to make any changes to my router/gateway. To learn how to install and configure Hamachi on Linux or Windows machines, as well as how to improve the security of the connections over the Hamachi VPN using public key authentication, please see my previous post.

References

http://www.openssh.com/
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/

Linux

How to Install Apache, MySQL and PHP on CrunchBox Linux

So, you’re a CrunchBang Linux user but you want to get a little web development work done? This post will describe how to install and configure Apache, MySQL, and PHP on your box. Once set up, you’ll be able to use your LAMP server to do basic web development and code testing, maintain local copies of your web sites, etc.

The software discussed in this post are free and open source. Apache is licensed under the terms of the Apache License, a free-software license authored by the Apache Software Foundation. MySQL is available under the terms of the GNU GPL. PHP is distributed under the PHP license v3.01, an open source, BSD-style license certified by the Open Source Initiative. The remaining software, phpMyAdmin and WordPress, are not required, however, they are available under the terms of the GNU GPL. The versions for the software discussed in this post are as follows:

  • Apache v2.2.11-2ubuntu2
  • MySQL v5.1.30really5.0.75-0ubuntu10
  • PHP v5.2.6.dfsg.1-3ubuntu4
  • phpMyAdmin v4:3.1.2-1
  • WordPress v2.8.5

Let’s get started.

Install Apache

Let’s grab the latest version of the Apache HTTP server:

Once successfully installed, the Apache server will start automatically. You may notice Apache complaining with “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName.” No worries, it simply means that Apache could not find a qualified domain name like foo.com in its configuration file. Let’s prevent this message from popping up though by binding the server name to the localhost IP address. Open /etc/apache2/apache2.conf as root and append the following line to the end of the file:

Now restart the Apache server with the following command:

Let’s also make sure now that the server is working. Open a web browser and enter http://localhost. You should see Apache’s time tested “It Works!” message.

Install MySQL.

Now that the Apache HTTP server is up and running, let’s download and install the MySQL server:

During the installation you’ll be asked several times to enter a password. You can leave it blank, but for obvious security reasons and to avoid configuration problems later, I would strongly suggest entering a password. Like Apache, once the MySQL server is installed, it will will start automatically. Now, let’s make sure the server is bound to the local host IP address like we did with Apache. Open /etc/mysql/my.cnf as root and make sure the following line exists. If not, simply append it to the end of the file:

Now restart the MySQL server with the following command:

Install PHP

Almost there. Let’s download and install PHP:

Brilliant. Now let’s test to make sure PHP was installed correctly. Navigate to /var/www/ (Apache’s web root folder) and create the following file:

Open that file as root and enter the following PHP function:

[php light=”true”]

[/php]

Open your web browser and enter http://localhost/phpinfo.php. You should see a page providing some information regarding your PHP installation (See Figure 1).

Screenshot of the of the phpinfo function output

Figure 1

A completely optional but handy package to have for administering your MySQL server is phpMyAdmin. This package gives you the ability to create, copy, rename, alter and drop databases and tables using a web interface instead of the terminal. To install phpMyAdmin:

During the installation you’ll be asked to chose the web server that should be automatically configured to run phpMyAdmin. You’ll want to chose Apache2. PhpMyAdmin will also indicate that it needs to have a database installed and configured before it can be used, and offer to set up a temporary configuration for you using db-config. Since we already have our MySQL server up and running we should choose No here. Once the install finishes, open your web browser and enter http://localhost/phpmyadmin. You should see the logon page for phpMyAdmin (See Figure 2).

Screenshot of the phpMyAdmin logon page

Figure 2

That’s it for the installation. Now let’s move on make sure everything works together.

Testing our LAMP installation using WordPress

WordPress is a full-featured blogging tool (This web site was built using WordPress. The author is not full-featured) that makes heavy use of Apache, MySQL and PHP. We’ll install it on our LAMP server to ensure we have these packages installed correctly. Let’s start by downloading WordPress directly from the developers site. You can also download and install using Aptitude but I don’t recommend it as the repository’s release is a version or two behind the most current release. Navigate to your home directory (or wherever you’d prefer to download the package to) and download and untar the package:

Let’s move the extracted wordpress/ directory to Apache’s web root folder:

Now let’s create an MySQL database for our WordPress installation. Open phpMyAdmin in your browser. Enter root for the Username and the password you set during the MySQL installation (or simply leave this field blank if you skipped entering a password). To create a database, enter a name for it in the Create a new database field. For purposes of our example, let’s use wordpress as the name. Now select Create (See Figure 3).

Screenshot of a database being created through phpMyAdmin

Figure 3

Now we need to do a little pre-configuration on one of the wordpress files in preparation for installation. First, navigate to /var/www/wordpress/. As root, copy the file wp-config-sample.php to wp-config.php. Open the latter file and enter the database name as well as your MySQL login and password. If you chose not to create a password when you installed the MySQL server, make sure to leave two single quotes with nothing in between in DB_PASSWORD. When complete, it should look like the following:

Now let’s install WordPress. Open your web browser and navigate to http://localhost/wordpress/wp-config.php. If everything is configured as it should be you will be greeted with WordPress’s installation wizard (See Figure 4).

Screenshot of the wordpress install wizard

Figure 4

Final thoughts

One issue you may encounter is phpMyAdmin complaining that it can’t load the MySQL extension. More than likely the problem in this case is that phpMyAdmin wants the MySQL PHP module loaded automatically when Apache starts (it isn’t by default). To fix this, open /etc/php5/apache2/php.ini and uncomment following line extension=mysl.so. Save the file and restart Apache.

Finally, you may not want your LAMP server running continuously but rather only when needed. There’s a couple of ways to keep Apache and MySQL from running at boot time. First, you could simply remove their corresponding entries from /etc/rc2.d. A more elegant way to manage these daemons, however, is to download and install sysv-rc-conf.

sysv-rc-conf provides an easy to use interface for managing rc.d symlinks. The interface comes in two different flavors, one that simply allows turning services on or off and another that allows for more fine tuned management of the symlinks. To use it just enter sysv-rc-conf on a command line as root.

When you want to use your LAMP server again you’ll need to start Apache and MySQL from the command line:

Well, that’s it. With a couple of open source packages and a few minutes of your time you can a get a fully configured web server up and running on your CrunchBang Linux box.

References

http://httpd.apache.org/
http://dev.mysql.com/doc/refman/5.1/en/
http://php.net/index.php
http://www.phpmyadmin.net/home_page/index.php
http://wordpress.org/

Linux

How to Install VirtualBox Linux Guest Additions

(20140911 — The steps in this post were amended to address changes in recent versions of software. Minor editorial corrections were also made — iceflatline)

This post will describe how to install VirtualBox Guest Additions on your Linux guest operating system.

Oracle’s VirtualBox is a general-purpose x86 machine virtualizer that runs on Windows, Linux/Unix, and OpenSolaris hosts. It supports a large number of guest operating systems, including Linux (kernel versions 2.4 and 2.6) and the usual Windows flavors. Guest Additions consist of drivers and kernel modules that improve the usability and performance of the guest operating system, including the ability to share the mouse pointer seamlessly between the guest and host systems without the need to free the pointer from the guest OS first; the ability to share the clipboard between the guest and host OS; and, better video support through the use of guest drivers for the X Window system that provide higher (and non-standard) video modes as well as accelerated video. VirtualBox and its Guest Additions addon are free software licensed under the GNU GPL.

The versions for the software discussed in this post were as follows:

  • CrunchBang Linux v11
  • VirtualBox v4.3.14
  • Windows 7 Pro

So, let’s get started.

Download and Mount

VirtualBox Guest Additions are designed to be installed to the guest OS after it has been installed. So, if you haven’t already installed your Linux guest OS make sure you do that first.

VirtualBox Guest Additions is provided as a single image. To install, you mount this image as your guest OS’s virtual CD/DVD-ROM drive and install it directly from the drive from within the guest OS. Start your guest OS and release your mouse pointer. Navigate up to the top of the window and select Devices->Install Guest Additions CD Image. The image should automatically mount as your guest OS’s virtual CD/DVD-ROM drive. (you may see a disk icon of some sort on your guest OS desktop). Now, let’s install the Guest Additions. Open up a terminal and navigate to the directory where your virtual CD/DVD-ROM is mounted (e.g.,/media/cdrom0). List the contents of the directory and you’ll notice several scripts. You’ll want to run the Linux script from this directory with the following command:

The script will do a self-check to verify the integrity of the image, then it will proceed with uncompressing files, building new kernel modules, and installing drivers. After the script finishes, you should reboot your guest OS to ensure that Guest Additions is actually used.

Troubleshooting

One problem I’ve encountered is that the installation will fail, complaining that headers for the current kernel were not found. To fix this problem make sure to first update your packages, then install the necessary kernel headers. For example, in CrunchBang, Ubuntu, and other Debian-based distributions, run the following commands:

Conclusion

I’m starting to use VirtualBox a lot now to help test and evaluate various BSD and Linux distributions in a more flexible way. Guest Additions is easy to set up and makes working in your guest OS a much better experience.

Commentary

Why I need to use Windows 7 Professional

Here at the old iceflatline compound there are a lot of Windows desktops running. Enough to where I actually looked into volume licensing at one point. I’m able to access all of these machines from the comfort of wherever I happen to be. Sure I could, and even may, switch some of these over to *nux, but last I checked, I wasn’t going to be able to count on playing, say, Dragon Age or Mass Effect on Ubuntu, or whatever, any time soon (so sad).

Imagine then how pleased I was when a Redmond announced their “family pack” option for Windows 7, which will allow users to upgrade three PCs to the Home Premium edition of the operating system for $149. Great I thought, when I get around to upgrading these machines, I’m going to save a ton of scratch, right? Then something in the back of my mind said hold on minute, what features might you be giving up? The answer: Remote Desktop. This feature is not available in home premium, only in Windows 7 versions starting with Professional. Oh sure you can access another Windows desktop (assuming it is using XP pro or Vista/Win 7 Pro and above) using Home Premium, but you won’t be able to access a Home Premium install remotely. Would it have killed them to put that feature in Home Premium making it…um… premium?