Posts Tagged Linux

Fedora 11 vs. Ubuntu 9.04

Put Fedora 11 on my laptop just out of boredom, some notes:

  • Fedora 11 SELinux by default: Cool but confusing
  • Fedora 11 repositories: Better selection than previous releases, still not as many choices as Ubuntu
  • Ubuntu still wins on the default menu organization for new users (just a bit easier to navigate)
  • Fedora bootup vs. Ubuntu bootup is about a wash, they both look good and are fast
  • Default themes: Neither will win a competition on looks, Linux Mint is much better looking than both
  • Yum vs. Apt: Yum was fast, but a lot of 404′s on the repositories (which is more of an issue of Fedora’s mirror infrastructure)
  • PPAs vs. ???: This is where Fedora appears (correct me if I am wrong) to have absolutely no answer to OpenSUSE and Ubuntu. In Ubuntu we can get up to date packages that were not yet officially released using PPAs. OpenSUSE users can download packages from the build service. Fedora really has nothing this fun (I am aware OpenSUSE can build Fedora packages, but the selection is not even close).
  • Support: Fedora is a distro that is on the cutting edge. It will never compete in support, but this is intentional.
  • Community: Ubuntu community is simply the biggest Linux community on the internet. Nobody is even in the same ball park. This also means that Ubuntu has much more “noise” than Fedora (ie people who contribute nothing and are generally factually inaccurate). Experts may like Fedora more because of the lack of this noise.

So if you are looking to try out Fedora, I don’t think you will gain or miss much. Personally I am going to put Ubuntu back on as I really love software from PPAs, and I love using apt just out of habit. But hope that helps someone who wonders what the differences are or what they are missing.

I have added a screenshot which is the default screen with Gnome-Do with docky theme, but this obviously works in Ubuntu also:

Fedora11

Tags: , ,

Python threads

Frequently I need to launch sub processes from Python. Sometimes these processes don’t work as expected, and end up blocking the program. If you want to launch a command from python, and cut it off after a certain amount of time, I recommend the threading module.

Here is how to limit the command to running for roughly 5 seconds:

#!/usr/bin/env python
import commands
import datetime
import time
import threading

class runCommand(threading.Thread):
    def run(self):
        status, output = commands.getstatusoutput('sleep 8')

if __name__ == "__main__":
    startTime = datetime.datetime.now()
    maximumRunTime = datetime.timedelta(seconds = 5)
    mythread = runCommand()
    mythread.start()

    while 1:
        if mythread.isAlive():
            print "Thread has not returned yet..."
        else:
            print "Thread is all done."
            break

        if (datetime.datetime.now() - startTime) > maximumRunTime:
            print "Thread has ran too long, giving up."
            break

        time.sleep(1)

    print "Program done"

So when we enter main, I assign the current time to startTime. Then I define maximumRunTime as a difference of 5 seconds. The thread is started, and every second we check to see if it is still running. If it is, we go ahead and check how much real time has elapsed.

Tags: , ,

NCPFS

NCPFS each release generally is sent out completely not working until I fix it. If you have C experience, you can help me fix up this source. I have started a github.com project called ‘ncpfs-ng’. Here I will be committing my bug fixes. There are about 2 trillion compiler warnings that need to be addressed, so any help is welcome. If you are interested or have a patch, you can reach me at sharms at ubuntu dot com.

Immediate goal is fixing the package on 32-bit systems Jaunty and up, as GCC changed a lot since the Intrepid release, causing issues:
https://bugs.launchpad.net/ubuntu/+source/ncpfs/+bug/328020

My debdiff there does make it work for amd64, but i386 users still have no luck. Github page is at: http://github.com/sharms/ncpfs-ng/tree/master

Tags: , ,

Interesting Blogs

With respect to my last blog post, apparently everyone cares about boot speed :)

Blogs
My Google Reader has a ton of feeds, figure I would highlight some of the more interesting ones I have found:

Tags: , ,

Installing Groupwise 8 Client in Ubuntu Jaunty AMD64

  1. Download the Groupwise 8 Linux Client Tarball from Novell: http://download.novell.com/index.jsp
  2. Download Java 6 SE JRE: http://java.sun.com/javase/downloads/index.jsp
  3. Install prerequisite libraries: sudo apt-get install alien libstdc++5
  4. Extract archive downloaded from Novell: tar xvfz gw800_client_linux_en.tar.gz
  5. cd groupwise_8.0.0-84910_lnx_client_en
  6. sudo alien -i novell-groupwise-gwclient-8.0.0-84910.i586.rpm
  7. Extract Java 6 SE JRE: ./jre-6u14-linux-i586.bin
  8. sudo mv jre1.6.0_14 /opt/novell/groupwise/client/jre

Tags: , ,

Etc

Bought 20 Ubuntu CD’s from the US Store. I have to wonder, for those of you using shipit, if you have the means why not actually buy them?

cds

UbuntuOne
I think this is a really cool initiative from Canonical. I don’t understand people complaining about being closed source, because the client is fully open sourced from what I can see. So all the code I installed on my system is open source, no problem. If I utilize their service, then it isn’t, as the backend isn’t open source. But the fact that I can edit the client files, or make a compatible backend myself since the client is open means I have absolutely no issue with that. I think people complain to complain, if they only used that energy to write an open backend instead. Oh well.

Tags: , ,

The Cherokee Webserver: Great choice for VPS's

Recently I upgraded my shared hosting plan to a VPS (Virtual Private Server). Part of the reason is that when your blog gets enough hits, WordPress and MySQL become increasingly demanding. My page load times were around 8 seconds previously. Since switching to a VPS plan, I have decreased that to 1-2s which is much more acceptable. What makes load time interesting is that major internet sites see people turn away if load times are high.

“For Google an increase in page load time from 0.4 second to 0.9 seconds decreased traffic and ad revenues by 20%. For Amazon every 100 ms increase in load times decreased sales with 1%.”1

This suggests to me that I had better get page load time under control, or my blog won’t reach many people on the internet. Since I already was paying for shared hosting, the jump up to a VPS was not much more money. The result is fantastic though, as I get a server with root access, and better yet it runs on Ubuntu.

The Cherokee website provides a Benchmarks page2 which covers Cherokee being tested against Apache, Lighttpd and Nginx. Cherokee always does really well in these bench marks, and was designed with a focus on security. My website, which gets over 1000 unique visitors a day, with WordPress / MySQL / Cherokee only uses 119 megabytes of ram on my VPS. Cherokee itself is only using 10 megabytes, which shows just how lean it is. In addition to that, it also services requests very efficiently:

Requests per second with 20 concurrent clients

Requests per second with 20 concurrent clients

Another factor which pushed me to Cherokee is the way Cherokee is configured. It provides a great, easy to understand / intuitive web interface for configuration. I never had to open up a .conf file and edit it, and yet the configuration it generated is still in plain text and easy to understand should I need to. That is exactly what the webserver world has needed for a long time.

In the next few weeks I will follow up with a detailed Cherokee installation / configuration tutorial and some other fun things I have done with the VPS. If you want to check out Cherokee, their official project website is at: http://www.cherokee-project.com

  1. Gabriel Svennerberg’s blog []
  2. Cherokee Benchmarks []

Tags: , , ,

Migrated to a VPS

This weekend I moved my weblog to a VPS. The site should load much much faster, and hopefully I can create some custom sites using either Django or Symfony. In this next few days I will be posting some tutorials on how to move your WordPress blog from host to host, and setting up the Cherokee webserver with WordPress / Permalinks.

Stay tuned and let me know if you see any problems with the site.

Tags: , ,

Make your bash shell cool again

I originally wrote a spec in 2006, but it never actually made it in.  You can see it at https://wiki.ubuntu.com/Spec/EnhancedBash .  The good news is, it is just as relevant today. Hopefully these tips will make your life easier, I use them on all of my systems.

Use the page up key to complete the command
What this does is, if I type ‘ssh ‘ then hit the page-up key, it will complete the line to the last time in my history file that I typed ssh. Hitting page up again will go to the 2nd to last time I typed it. Incredibly handy if you ever type the same commands more than once. This actually has been the default of SUSE based distributions for quite some time.


echo "\"\e[5~\": history-search-backward" >> ~/.inputrc
echo "\"\e[6~\": history-search-forward" >> ~/.inputrc

Increase history size
Now that you have the pageup / pagedown bindings to auto-complete your history, you are going to want to store more of it. You can store the previous 1000 commands using this.


echo "export HISTSIZE=1000" >> ~/.bashrc
echo "export HISTFILESIZE=1000" >> ~/.bashrc

Color grep
Using the following bash alias, you can make grep highlight the word it is matching in color. I grep about 10000 times a day, so this makes it a bit easier on my eyes to focus where I need to:


echo "export GREP_OPTIONS='--color=auto'" >> ~/.bashrc

Command matching
There was also someone who contributed more sane command matching (ie what happens when you hit the tab key a bunch). I use these also, which tell it not to do stupid things like try to match hidden files and to display both files if they are ambiguous:


echo "set match-hidden-files off" >> ~/.inputrc
echo "set page-completions off" >> ~/.inputrc
echo "set completion-query-items 350" >> ~/.inputrc
echo "set show-all-if-ambiguous on" >> ~/.inputrc

Tags: , , , ,

The Cherokee Webserver

Cherokee Webserver Logo

Cherokee Webserver Logo

After seeing some of the performance graphs on Alvaro’s blog, I decided to give Cherokee a shot with a project I am working on. The project I am working on has a web browser on kiosk machines, and runs Django on the backend. I was in need of a fast, secure web server. I have always used Apache in the past, and have used Nginx, so I figured I should investigate Cherokee.
Read the rest of this entry »

Tags: , , , , ,