• 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 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,  Ubuntu

    Quick & Dirty sed Find/Replace

    I find a very common task that I need to do is find a string in a file and replace it with another string. Or better, find all instances of a given string and replace them with a new string. I figure others will need to do this as well. This is also an interesting example of how Mac OS X is not “the same” as Linux. The sed command can be used to quickly perform a find and replace inside of a file. The following example will use the -i option to do so in-place, defining no extensions to -i using the double quotes (“”), then using the /s…

  • personal,  sites,  Ubuntu

    10 Tips for Writing Gaming Bots

    Apparently it’s out. I’ve been botting games for years. Botting is my way of coping with an addiction to games. I simply cannot help myself. I start playing a game and I just cannot stop. And that’s where bots come in. Over the years I’ve found a number of ways to write bots. It started with easy little web scripts and has now morphed into a full blown SWT library framework that spans multiple games, multiple platforms and runs around 20 instances from my home network at all times. But when you start writing bots, you enter into a new kind of game that is a game in and of…

  • 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,…

  • Mac OS X Server,  Mass Deployment,  Ubuntu

    NFS + Ubuntu + Mac OS X Clients = A Quickie

    NFS is an old standby in the *nix world. It seems that it’s about as old as the hills and while it can be cranky at times, it’s pretty easy to setup, manage and use. Once it’s configured, you use it in a similar fashion as you do in Mac OS X Server. The client configuration is identical. To get started, let’s install the nfs-kernel-server, nfs-common and portmap packages on our Ubuntu 10.04 box: apt-get install nfs-kernel-server nfs-common portmap Then let’s create a directory to share (aka export): mkdir /Homes Then we need to define the permissions for /Homes (ends up similar in functionality to the export to option in…