Thursday, May 24, 2012

Bad Code

Non-productivity loves company...

I created a subreddit (see here) where anyone can post amusingly bad (all in good fun though) code snippets. I've posted quite a few snippets of my own code on it and the community is growing pretty fast.

Wednesday, May 23, 2012

FIxing Media Fast-Forward Problem in Linux Mint

I feel as if the Linux penguin wakes up some days thinking "John Sullivan needs to be brought down a few notches today"...

I sat down to work today and was planning on using Pandora to listen to some music but I soon noticed that it was as if my songs were playing in super fast forward: nothing was coming out of the speakers and the current position in the song was advancing at a rate of about a minute per second. Not wanting to deal with it I went to YouTube to try and find some songs on there I could listen to, but I soon found out that the same problem was occurring for the videos on there. Legitimately afraid for the well-being of my Linux box I tried to listen to music one last time by opening up Banshee but that didn't work either.

After some searching online I couldn't figure out what to do, so I started re-installing everything I could think of that might be causing the problem. Little did I know that somehow my selected audio device for output had changed to some device that didn't really exist. I found this out by (this is for Gnome 3, your desktop may be different) going to Sound Settings in the top right corner of my screen, selecting the Hardware tab, and then selecting Internal Audio Analog Stereo. How it got set to that in the first place is beyond me but I'm glad I can listen to music while I work on my Linux box again.

Friday, May 18, 2012

Setting up the network for a CentOS-minimal install

Setting up a computer is always a journey...

I've been setting up a server that I plan to deploy a project I've been working on, Galah. Due to the seriously limited specs of the computer, I installed CentOS-minimal onto it (for those trying to do this with a USB, I really recommend just burning a CD, for those who don't listen to advice on the internet, send me a message somehow and I can help you through it, a very smart sysadmin showed me the way the other day). Getting a CentOS-minimal server to connect to your network however is very difficult. I will describe the tasks I went through in order to get it working.

First thing I faced was that my wired connection was being listed under /dev/p2p1 rather than eth0. This made things unduly difficult so I found a nice way to override this courtesy the author of this lovely blog post (if your wondering about the why the renaming was happening I recommend reading the post).

After that it's a matter of setting up your gateway and whatnot. You'll have to do this by writing to the network config files yourself (located at /etc/network and /etc/network-script). Your network will likely be different, but these are the steps I took to get it connected to my home router, I recommend glancing over them to get an idea of what you want to do.

  1. I set up my /etc/network file first by specifying my gateway and the DNS servers I wanted to use. Here is my configuration file:
    /etc/network
    NETWORKING=yes HOSTNAME=galah-zero GATEWAY=192.168.0.1 DNS1=68.190.192.35 DNS2=71.9.127
  2. I then deleted /etc/network/ifcfg-p2p1 and then set up ifcfg-eth0 with my desired network settings. Here is my configuration file:
    /etc/network-scripts/ifcfg-eth0
    DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.0.69
  3. Finally I restarted the network service (service network restart) and then I could successfully access the network and the internet (test this with ping. First try pinging your gateway, if you can do that your connected to your network. Then ping www.google.com or some other site, if this fails but you can ping your gateway your DNS isn't set up right, if this works you're all set).

As you can see, it's a little tedious to get the network up without all those nice tools were used to, but not too bad.