Archive for the ‘Open Source’ Category

Another KDE Convert Here

Sunday, January 18th, 2009

Although I use Fedora on my laptop, Ubuntu has always been my recommendation for those who want to try Linux. A friend told me that he switched from KDE and shared tales of how it greatly improved. This led me to randomly blurt out to another friend to try out Kubuntu.

To cut the story short, I made the switch from XFCE to KDE too. It’s quite responsive on my aging laptop and their compositing is surprisingly easy on resources.

Free Image Hosting at www.ImageShack.us

Installation is easy (for Red Hat, Fedora and other derivatives):

# yum -y groupinstall KDE

Twittipy 0.2

Friday, September 19th, 2008

I’m on a very brief break and hacked on my Twitter notifier for a couple of minutes. To tell you the truth, a couple of bugs have been ironed out a week after I posted the first version. It has been working so well, I didn’t bother playing around with the code.

Twittipy now prompts for your username and password. If you want it to save to the config file, just uncomment some of the lines. I’m not comfortable with the password saved in a file and I haven’t thought of a way to encrypt them. By the way, Pidgin saves passwords in plain text too. The login prompt is old code from a wxPython experiment some time ago (and it ain’t pretty).

After you get authenticated, an icon will appear in your system tray. To exit Twittipy, right-click on the icon.

Download it here.

Install Wine 1.1.4 on Fedora 9 + Google Chrome Comments

Sunday, September 14th, 2008

I love Wine! No offense to the GIMP folks but I still use Photoshop 7 and when I found out that it now works out of the box with Wine, it gained my trust. Here’s how to install Wine 1.1.4 on Fedora 9.

  1. Check if you have wine installed.
    $ rpm -qa | grep wine
  2. Uninstall the old version.
    $ sudo yum -y remove wine
  3. Download the latest build from Koji. The following is the i386 build.
    $ wget http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-twain-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-capi-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/src/wine-1.1.4-1.fc9.src.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-jack-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-nas-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-core-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-ldap-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-cms-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-cms-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-tools-1.1.4-1.fc9.i386.rpm \
    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-desktop-1.1.4-1.fc9.i386.rpm \

    http://koji.fedoraproject.org/packages/wine/1.1.4/1.fc9/i386/wine-esd-1.1.4-1.fc9.i386.rpm

  4. Install the RPMs.
    $ sudo rpm -Uvh wine-*
  5. Confirm installation.
    $ rpm -qa | grep wine

I upgraded to the lastest version of Wine just to get Google Chrome running on Linux even if I already read that it’s slow and SSL support is absent. I followed this guide.

I almost got it running but it was really slow (see screenshot below). I also have V8 compiled but when I tried to play around with it, I didn’t know what to do even with the interactive console.

Screenshot

My invaluable thoughts on Chrome:

  • I think it’s great that it uses Webkit. Not really sure if it’s faster than Gecko but at least testing with Webkit is more fun now.
  • You can drag a tab in and out of the window. That’s cool but I couldn’t pin the window to stay on top.
  • The developer tools are almost as great as those provided by Firefox extensions (i.e. Firebug).

Pidgin: Invisible Buddies + Some Thinking

Friday, July 11th, 2008

Pidgin: Invisible Buddies

This is me amused with little things.

On a side-note, I think it’s about time to get a new laptop. It’s not that my current laptop needs more juice. It works just fine for my needs and brought me great fortune in the past 4 years from college requirements to enterprise software.

Fedora 7 just reached its end of life and I get this OCD that I have outdated software. With the urge to upgrade but no place to backup my files (strange, all of my drives are full), I think a new laptop is the answer.

An extra hard disk would be a lot cheaper but I’m weighing the extra convenience that I’ll get with a more modern laptop. For instance, if I had a newer wireless card with 802.11g (yes, my laptop is 802.11b!), I’ll be using drivers with WPA support and higher transfer rates. With a DVD combo drive (vs a CD-ROM drive), better RAM, graphics card, and processor, makes me convinced that it’s, err, about time.

I’ll be getting an HP/Compaq because all of our laptops at home that carry the same brand are still alive. Also, it won’t be anything fancy. Just a boring normal laptop and it won’t be a tablet like I wished before. The TX2000 and TX2500 are available locally though.

There will be one busy weekend soon.

Twittipy: A pynotify and pycurl experiment

Friday, June 27th, 2008

It’s been a drag since Twitter IM went down. I had a very brief “play” time the other night that gave birth to Twittipy. It’s a Twitter notifier written in python with pynotify and pycurl.

Running Twittipy

  1. Create a configuration file in your home directory (~/.twittipy)
  2. Set your Twitter username/email and password in the configuration file.
    Example:
    [general]
    username = johnsmith
    password = unhackable
  3. Make Twittipy executable
    $ chmod u+x twittipy.py
  4. Fire it up!
    $ ./twittipy.py &

Twittipy requires Python 2.5, pycurl and pynotify. If it complains of missing modules, you probably didn’t meet the requirements.

Roadmap

I did some googling and found other stuff to try that could improve Twittipy.

  • Port for other platforms (Windows with pywin32 and KDE via wxPython)
  • Icon at the notification area or system tray (via wxPython)
  • Encrypt or obfuscate password in config file and/or if password is not found in the config file, prompt and store in memory.
  • Make use of the other methods of the Twitter API.

Download it here. There are two more options in the config file, update_interval and last_update. The former defaults to 4 minutes and the latter to the current time.

I’m quite satisfied with it. The notifications of pynotify are less obtrusive than an IM message. There’s one noticeable quirk where a tweet repeats. We’ll fix that for the next release.

Comments are welcome and please check out tweetyPy as well (not mine but also an academic project).

Finch

Wednesday, June 11th, 2008

Pidgin kept crashing when I tried tunneling through a remote machine. After minutes of googling around, I found Finch, a command-line version of Pidgin! It used to be called Gaim-text. Really cool!

Finch

Insert to Asterisk’s Queue Log When a Member Is Called

Friday, April 4th, 2008

Asterisk‘s queue_log can come in handy in many cases (queues in Asterisk can be called ACD). There are systems that go as far as depending solely on the queue_log to operate (including mine).

Every now and then requests requirements for a feature to tell if a call in the queue is being transferred to a queue member (an agent) comes up. I had a workaround that used an AGI script but it didn’t work all the time. I’ve been digging around the source code so that it’s inserted into queue_log instead. After three attempts of hacking one friggin’ line of C code, I finally did it. My sincerest apologies to my COMPRO1 and COMPRO2 professors.

You may get the patch for asterisk-1.4.19 over here.

P.S. I know that watching the queue_log isn’t much of a good idea. I only stole the concept and I wasn’t aware of AMI at that time. Migration plans are on the way.

myssh 0.2

Wednesday, January 2nd, 2008

Finally got the motivation to port this to Python. I don’t want to go through everything again so just read the original post. I also added myssh_print and myssh_flush. The former, if not provided with a label, prints all the profiles. The latter removes a profile.

Download (myssh_0_2.tar.gz 8.1K)

Plug: Asterisk Philippine Users’ Group (APUG)

Thursday, September 27th, 2007

APUG

For those interested in VoIP, Asterisk, IP-PBXs, and all that hyped technology, feel free to join the discussion at APUG. Shiny Asterisk logo by yours truly.

Asterisk is the world’s leading open source telephony engine and tool kit. Offering flexibility unheard of in the world of proprietary communications, Asterisk empowers developers and integrators to create advanced communication solutions…for free.

Newbies, developers, hardware vendors and trolls (gulp!) are very much welcome.

MySQL Woes

Tuesday, July 31st, 2007

I was having problems with slow queries last night and I noticed that MySQL, even with two other CPUs available, just stuck to one processor. I did a little googling and found out that MySQL is not that multi-threaded.

I’m currently working with about 70 instances, all versions, different configs and settings, different loads. (Sometimes more than 7000qps)

Basically, here are the facts:

MySQL relies on NTPL or PTHREADS to handle it’s concurrent processing, and this in itself is a design flaw. Real transactional databases use multiple processes and multiple threads within those processes. Using linux threads can push a small percentage of the load to other processors/cores but it’s not anywhere near what a real multi-process application can do

If you’re lucky, your top will have the “H” option which shows threads as fake separate processes. If you’ve got enough connections per second, you’ll see mysql throw off a few threads to a different processor, but your MPSTAT will show that only one of the cores is doing most of the work (based on interupts per second, which is more accurate than load average or any other variable in top) In fact, the majority of the load on the other cores comes from the operating system services (kjournald, syslogd, …)

MySQL was designed as a simple single-process database app that sits on the same server as php and apache, so if you’re running a typical LAMP blog site or zencart on one server, this is more than enough

If you install PostgreSQL, Oracle, Sybase, basically any real database application, you’ll see dramatic difference in how the workload is distributed. The CPU cores do about the same number of interupts per second

I’ve tested mysql on every platform, and the outcome is always the same. A Sun T2000 box with 32 cores, regardless of mysql config, thread library, or version, will show activity on only one core from MySQL (even with hundreds of open connections)

Anything more than a single core CPU is completely useless for a database server running mysql. If you want to spend money on what really matters, get a decent fiber storage array with a fast controller

The conclusion: If you want to leverage multiple CPUs on a server running nothing but a database application, don’t use MySQL. Otherwise get a single core pizzabox and a fast disk controller and you’re all set

If this is true, can I setup another instance of MySQL on the same machine and have it replicate?

I listened to the July 21st episode of FLOSS Weekly the other night and the topic was Postgresql. This is exactly what Josh Berkus was talking about. I should try playing with Postgresql again. Table partitioning sounds like a huge lifesaver and I could sure use the extra data types.

Google, on the other hand, uses MySQL in a couple of apps. They use a huge cluster of mid-range machines with large memory. I’m after utilizing the other available CPUs.

Links