• Ubuntu,  Unix

    Setting Up Multiple IPs in Ubuntu

    A standard network interface will look similar to the following in /etc/network/interfaces: auto eth0 iface eth0 inet static address 192.168.210.100 netmask 255.255.255.0 broadcast 192.168.210.255 gateway 192.168.210.1 Adding more IP addresses to those interfaces is as simple as creating an alias, done by duplicating the information for the initial interface and appending a colon followed by 0,1,2,3,etc according to how many aliases are needed, minus the gateway (the initial IPs gateway will be used): auto eth0:0 iface eth0:0 inet static address 192.168.210.101 netmask 255.255.255.0 broadcast 192.168.210.255 auto eth0:1 iface eth0:1 inet static address 192.168.210.102 netmask 255.255.255.0 broadcast 192.168.210.255 When finished, run an ifconfig to verify that the new interfaces are up…

  • Ubuntu,  Unix

    Link Aggregation in Ubuntu 10

    Ifenslave is an open source package that can be used to bond interfaces in Ubuntu 10. To install ifenslave, we can use apt-get: apt-get install ifenslave Once installed, we will need to take down our existing eth interfaces. Presumably these are eth0 and eth1, but you can use ifconfig to verify: ifconfig eth0 ifconfig eth1 Once you’ve verified the interfaces you want to bond, bring them down: ifdown eth0 ifdown eth1 Next, locate the entries in /etc/network/interfaces and comment out the corresponding lines: vi /etc/network/interfaces You will then need to add information for the link aggregated bond. Bond levels in ifenslave include: bond0: Round Robin with all interfaces active (likely…

  • Mac OS X,  Ubuntu,  Unix

    Using a Colon As A Bash Null Operator

    I was recently talking with someone that was constructing an If/Then and they wanted a simple echo to match only if a condition was not met. Given their other requirements it seemed a great use for a null operator, which in bash can be a colon (:). This has the equivalent of /dev/null, but with less typing. One example of populating something with null is if you have a case where you want to create a file where there may or may not be a file already, and you want your new file to be empty (or start empty so you can write lines into it). Here, you could have…

  • Mac OS X,  Unix,  Windows XP

    Subversion Cheat Sheet

    I’ve done a few articles in the past on different tasks in svn and git, but I have a little cheat sheet of sorts I’ve been using for awhile for Subversion on Mac OS X and thought I would share it. Before you get started, check your version. I use 2.0 but I seem to remember all of these are about the same as they were previously: svn --version To get started, Subversion uses a repository to store projects. Each client needs a repository and these should be on direct attached drives. The repository hosts a Berkeley database a folder per project you check out, or import. To create a…

  • Mac OS X,  Mass Deployment,  Unix

    Interpreting Python

    Once upon a time I had to learn to script in bash. I’m still learning, as with most people, but I’m feeling pretty comfortable. I often have people ask me what is the easiest way to learn scripting and I find myself telling people to use the history command. Much of what people need beyond simply looking at their bash history involves variable substitution, loops and regular expressions. Tackled separately this makes a palatable experience. So then what makes object-oriented or interpretive languages such as perl or python so much more difficult? Is it the lack of a bash history? Let’s try and exercise and see about that. Open a…

  • Mac OS X Server,  Ubuntu,  Unix

    Binding Redhat to Open Directory

    I’ve done a number of articles on using Linux to provide services such as OpenLDAP for Mac OS X, but never on using the LDAP implementation in Mac OS X Server to provide authentication services for Linux. Well, it isn’t that difficult to do, but it is worth pointing out how to do it. To get started, we’re going to use Red Hat. You’ll want to have a known IP address for Open Directory and if SSL is required you’ll want to install the certificate on the Red Hat box before moving forward. There are two tools that can be used to hook Red Hat into an LDAP environment. The…

  • Mac OS X Server,  Ubuntu,  Unix,  WordPress

    Get Your WordPress on with Ubuntu 10

    Setting up and installing WordPress is pretty straight forward. That’s not to say it’s not going to take a little work to go from 0 to 60 on a base Linux installation. But I’ll lay the work out for you so as not to be that tricky. Everything we’ll be doing will require elevated privileges, so sudo in front of each command or sudo bash before you get going. First up, install Apache, as you’ll need a web server. I think the base apache2 config is pretty straight forward out-of-the-box: apt-get install apache2 During installation you will be asked to type y to continue. Do that and it will finish…

  • cloud,  Mac OS X,  Mac OS X Server,  Ubuntu,  Unix

    Programmatically Interacting with Google Apps

    There are a number of ways that you can interact with Google Apps: there is the website, the new Google Cloud Connect and an API that allows you to integrate Google Apps with your own solutions. The API is available for python and java and can take some time to get used to, even though Google has done a good job with making it pretty straight forward (comparably). Therefore, there are a couple of tools that ease the learning curve a bit. GoogleCL on Ubuntu The first, and easiest is GoogleCL. GoogleCL is a command line version of Google Apps that will allow you to interact with YouTube, Picasa, Blogger…

  • Ubuntu,  Unix

    Ubuntu and Firewalling

    Using the firewall in Ubuntu can be as easy or as hard as you want to make it. BSD variants all basically use the ipfw command whereas most of the rest of the *nix world will use netfilter. Netfilter has a number of front ends; the one that comes pre-installed in Ubuntu is ufw, short for ‘uncomplicated firewall’. Ufw is good for basic port management: allow and deny type of stuff. It’s not going to have the divert or throttling options. So let’s look at some basic incantations of ufw (you need to have elevated privileges to do all of this btw). Initial Configuration First you need to enable ufw,…

  • Ubuntu,  Unix

    Setting up DNS Services on Ubuntu

    On Sunday, I mentioned making your forward and reverse DNS entries match up. But I didn’t really discuss what to do if they don’t. For those readers moving into Ubuntu from Mac OS X Server, you’ll note that at installation time, if the hostname doesn’t match the A record and PTR for your server then it will install DNS and make them match up. The reason for this is that host names are a critical aspect in how many of the network services that modern services run. If you don’t have DNS or if you want to fire up DNS in the same manner that Mac OS X Server does…