Archive for December, 2007

Fedora more successful, developer-wise, than Ubuntu

Tuesday, December 18th, 2007

Statistics are interesting. Every Fedora Project Contributor gets an @fedoraproject.org alias. So I’m presuming, this number is greater than just package maintainers…

Fedora, via Max Spevack:

  • non-RH maintainers: 276
  • RH maintainers: 202

total @fedoraproject.org aliases for package maintainers: 478

Ubuntu, via Daniel Robitaille:

  • 348

total @ubuntu.com aliases: 348

By the above, does it mean Fedora is way more successful than Ubuntu? Some detractors will say, RH has a lot more package maintainers than Canonical can afford. Sure. But an @fedoraproject.org “Fedora Membership” also extends to ambassadors, translators, etc. and not just package maintainers (so the number, 478 up there, is woefully under-reported). Sadly, I couldn’t find a nice easy way to show all the @fedoraproject.org aliases via the online pkgdb application.

Long gone are the days where these aliases were maintained in /etc/aliases by Seth and I ;-)

Technorati Tags: , , ,

WordCamp Melbourne: making money with Wordpress, bbPress, caching, Wordpress Sandbox

Tuesday, December 18th, 2007

On November 17 2007, I went to the inaugural WordCamp Melbourne. It was a truly interesting event - crowded, filled to the brim, and held at the pretty amazing Watermark Bar, in Docklands. It was a really warm day, and the only complaint would be that Watermark put is in a glass dome, with only 2 fans and no air-conditioning - nice, greenhouse we were in! Food and drink were good, as were the talks in general. I took some notes, and am placing them online now (late, but better than never). Note that the event was sold out - so kudos to James Farmer for organising it.

Making money with Wordpress - Darren Rowse

- exclusive content, for a paid area (like forums?)
- textlinkads/paid links/paid reviews - nasties from Google, so this can be an issue
- RSS advertising?
- direct ad sales, and getting rid of the google adwords…
- donations? jason kotke survived for a year on donations
- book deals? other writing gigs? consulting? many other ‘unofficial’ ways
- give away a lot for free (principles, what you want to talk about in your niche), then consult, with individuals
- align yourself with a niche - the more people think about your branding, the more people think about you when its time to look for an expert
  - establish trust, expertise, authority
  - showcase what you do; do case studies, showcase what you can do, for free, and others will pay
  - give away the principles
  - sell someone not yourself (be careful of adsense, because someone else might be making money out of you)
  - make yourself accessible (write comments, participate)
- best places to place an ad: top left hand corner, or at the bottom of a post
- I find it interesting, that my quick analysis of Darren’s site, without AdBlock Plus, shows that he only feeds B5Media ads, and doesn’t actually use adsense. He however, does recommend you to earn money via adsense… so he writes about adsense, and so on, and encourages people to sign up via his link. Crafty.

bbPress - Sam Bauers at Automattic, who hacks on it

- install wordpress
- install bbpress in a subdirectory (/forum)
- cookie is shaed of wordpress/bbpress, so login in wordpress, and you’re logged into bbpress
- disable registration on the blog, and allow registration of users on the forum only
- plugin that attempts to make a post in wordpress, and starts a new bbpress forum post (bbsync). can be improved…
- beware htaccess rewrite rules… Wordpress takes “Everything”, so might redirect to the blog even when you want to go to the forums… Consider placing bbpress .htaccess before the wordpress stuff
- in config.php for wordpress, watch the trailing slashes. http://bytebot.net/blog is BETTER than http://bytebot.net/blog/ (no trailing slashes == good)
- bbPress Integration installed on bbPress, and let bbPress handle the registration (and it will assign a default role in Wordpress)
- uses mysqli now, but they want to switch to ext/mysql, because wordpress uses it too
- Check out the AppleSwitcher forums and website… Forums run bbPress, and is skinned really well

WordPress caching - Forum hosted by Alex Shiels (Automattic)

- Fix wordpress object cache, to work for large multiuser sites
- wordpress.com - dozen+ memcached servers
- custom version of wordpress object cache to talk to memcached
- Caching is counterproductive?
  - can’t just cache everything, because some blogs only get hit irregularly
  - have multiple levels of stuff, because there’s overhead in the caches
- SuperCache is used on wordpress.com, and this is released. Used only on specific content
  - builds flat HTML files
- wp-cache is down within the data structures. GZIP compression, and caches whole pages
- Barry found php5 is about 15% slower than php4
  - IO is not a bottleneck, its more CPU

Wordpress Sandbox - Alister Cameron

- XHTML and CSS
- http://www.plaintxt.org/themes/sandbox/
- Customise it with CSS alone, you don’t mess with anything else in the sandbox. Its all fully valid XHTML
- sandbox has hAtom and hCard microformats, woven into the page
- He uses YUI’s toolkit + sandbox (makes use YUI grids)
- Pay a visit to the CSS Zen Garden
- Asides: look at photomatt.net - anything in red with a | bar, is an aside. Also check out http://www.alistercameron.com/ his asides are in green
- http://codex.wordpress.org/Adding_Asides

Wordpress.com - Alex Shiels
I took these notes on my mobile phone… before whipping out my laptop. They’re even more terse!

  • Wordpress.com
  • 600gb mysql tables
  • 1.5tb worth of file uploads
  • currently, over 1000 cpu cores…
  • Mysql master-slave replication
  • special version of wpdb, known as hyperdb
  • use pound
  • heavily cache - edge caching with akamai (limited), full page caching for some pages, memcached for the wordpress object cache. Memcached handles 50000 pages/second
  • take a look at barry’s wordcamp 2007 video, about hyperdb
  • the memcache stuff isn’t released yet

All in all, I also need to take a closer look at nginx. It is apparently much nicer than lighttpd, in terms of it not using as much memory. However when I asked for some solid proof/evidence, I wasn’t given it, so I guess I’ll have to do my own research. Will be on my todo list for the holiday season (which has already started for me!).

Technorati Tags: , , ,

The Art of Innovation - Guy Kawasaki

Tuesday, December 18th, 2007

The 2008 MySQL Conference & Expo is nearing, and I’ve still got unpublished notes from the 2007 conference! In a way, its a good thing - too much was published during conference time, its hard to keep track. Here comes my notes from a superb keynote by Guy Kawasaki, titled The Art of Innovation, presented at the MySQL Conference & Expo 2007.

… on Apple
- “Back then, sexual harassment was a good thing”
- Apple allowed first class travel as long as you worked for Steve back in the day :-)

… on being a/pitching to a VC
A good test for entrepreneurs is: “Are you using MySQL”. Guy’s a VC, he likes you to use cheap, highly available tools.

Make meaning - don’t go to a VC and say you want to make money. It means you’ve attracted the wrong kind of person. Besides, making money, is obvious.

Make mantra - Mission statements are too long, they’re not memorable, they’re useless.

“If you ever hear MySQL is having an offsite at the Ritz Half Moon Bay, that is when you need to abandon the platform.” First day is team building exercises, to build cross-functional teams. Learn communication and trust. Second day is in a smaller room, each will then contribute to the creation of the mission statement.

Jump to the next curve - do things 10x better. Make your parameters correct.

Niche thyself - provide a unique product or service and value to the customer

Follow the 10/20/30 rule - his slide talk.

“Life is a pitch”

“Don’t let the bozos grind you down.”
(Especially the successful ones. Because they are less likely to appreciate or know what the next curve is going to be like)

Technorati Tags: , , , ,

Adventures with Apache’s Rewrite Engine (and MediaWiki)

Wednesday, December 12th, 2007

We’ve migrated some services from a machine, to another. The architecture of these machines, and directory structures are completely different. So I’ve played Joe Random Sysadmin.

MediaWiki is completely configured from LocalSettings.php. It does not have any configuration data stored in the database, so editing the LocalSettings.php file is really all you need to do. One document you want to read, in case the LocalSettings.php configuration is not hard-wired in your brain is the documentation on LocalSettings.php. Items you would likely need to change:

  • $IP - where on disk, MediaWiki is installed
  • $wgScriptPath - a lot of things depend on this, and if you’re making a change in Apache, I seriously suggest paying attention to this one. I have installed MediaWiki into a directory such that its called w/. There’s a RewriteRule for this, so $wgScriptPath is now set to /w.
  • $wgUploadDirectory - wherever this is, make sure its writeable by the web-server (let the directory be owned by www-data on a Debian system, for instance).

Everything else is pretty kosher, you don’t actually need to change much more than that. I found that using $wgCacheEpoch was really very handy, when actually testing MediaWiki. $wgCacheEpoch=”date +%Y%m%d%H%M%S”; (well, get that value from your shell, trivial to do in vim).

Now, on to Apache. Make sure the RewriteEngine is on (read more about mod_rewrite). The rewrite rule that I have in the configuration is:
    RewriteRule ^/wiki(/(.*))? /w/index.php$1

That basically ensures we get rid of the ugly index.php in MediaWiki URLs and we get sensible domain.name.com/wiki/PageTitle. When faced with problems, ensure you’re getting the RewriteLog. This is done via:
    RewriteLog /var/log/apache2/rewrite.log
    RewriteLogLevel 3

Now, to debug, get intimate with rewrite.log.

(2) init rewrite engine with requested uri /wiki/Contributing
(3) applying pattern ‘^/wiki(/(.*))?’ to uri ‘/wiki/Contributing’
(2) rewrite ‘/wiki/Contributing’ -> ‘/w/index.php?/Contributing’
(3) split uri=/w/index.php?/Contributing -> uri=/w/index.php, args=/Contributing
(2) local path result: /w/index.php
(2) prefixed with document_root to /data0/forge/work/w/index.php
(1) go-ahead with /data0/forge/work/w/index.php [OK]
(2) init rewrite engine with requested uri /data0/forge/work/w/skins/monobook/main.css
(3) applying pattern ‘^/wiki(/(.*))?’ to uri ‘/data0/forge/work/w/skins/monobook/main.css’

My real problem was there, where document_root was getting a prefix to the actual path. Which as we all know, is easily fixable in LocalSettings.php. And voila! that’s your Apache+MediaWiki issue solved. Now, everything just loads.

Another useful debugging tool, besides the access and error logs, is also the Firefox Page Information (Ctrl+I). You can also see what’s being loaded, and how.

Incidentally, I hopped on to #apache on freenode, only to see many a question being asked about mod_rewrite. I think there’s clearly a big opportunity here, business wise, for good sys-admins. Master Apache.

Technorati Tags: , , , ,

Fedora 8 on the Dell Inspiron 640m

Sunday, December 9th, 2007

I’ve been harsh when it comes to Linux on laptops. Simply put, the week before going to foss.in (i.e. last week), I got tired with my tried daily usage of Ubuntu (besides, I went through Feisty Fawn and Gutsy Gibbon). So I went with Fedora 8. You’ve got to love rdiff-backup.

What works?

  • Wireless, out of the box. This is ipw3945d. Fedora comes with the firmware now, so all is well, it just works out of the box.
  • X mirror out, out of the box. Finally, I can present, using my Linux box, without worry that it would suck with an external display. Just hit Ctrl+Alt+Backspace, ensure the external display is connected, and voila! I get a mirrored display. I’m sure setting it up to be dual-screen is the next uphill task, but lets just keep the good memory of things “just working”.
  • Suspend, and resume, out of the box. I can place my laptop to sleep, and wake it up, and all works. Sure, I need to hit Alt+F1, then go to Alt+F7 to see the screensaver login (otherwise, it remains blank), but this tiny workaround is very worthwhile to ensure that my laptop, works like a laptop.

What doesn’t work?

  • The WiFi light on my Dell doesn’t turn on. The Bluetooth one is, but the WiFi one remains permanently off. Who cares?
  • Occasionally (and I mean, very occasionally), the laptop doesn’t wake up from sleep. I haven’t figured out why yet.
  • Pressing Fn+Up or Fn+Down, to get the brightness controls going doesn’t work. While I can control the brightness just fine, its the GNOME applet not displaying it fine. Sound seems to work, so I’m wondering what it might be.
  • Occasionally, yum barfs, but I’m on a really slow, and unreliable link. yum clean all, seems to fix things.

I haven’t tried hibernate. I haven’t played with the TV Out. However, my laptop seems to be working more like a laptop, than when I had Ubuntu installed.

Oh, a minor point of annoyance. I can get Compiz working. But playing videos with it enabled, makes the video jerky, slow, and well, sucky. So I clearly can’t use Compiz, yet. But hey, it works (bottom-line and all, right?).

Technorati Tags: , , , , ,

foss.in, day 1: kernel hacking, hadoop, qtwebkit, plan 9

Saturday, December 8th, 2007

I sat in James Morris talk about how and why you should be a kernel hacker. This was a talk you should have attended, rather than bothering to read the slides, because much of it was spoken, rather than presented in text. James shares that you must have genuine interestcommon sense, and the willingness to work hard to succeed in a FOSS project (he was referring to the kernel, but lets just generalise here). In the getting started sense, he touched on the basics: fixing bugs, scratching that itch you have (i.e. angry programming - something doesn’t work for you? fix it), and trying many ideas (if an idea doesn’t work, try again). Its true that the initial learning curve to submit to most open source projects is steep, so persistence is important. Alas, follow your interests (don’t do something that you’ll dread), and seek mentors.

The part about being wrong. Its quotable: “If you find yourself arguing with Alan Cox, you’re probably wrong”. Memorable. But the advice on admitting wrongness, and moving on - this is crucial, to any FOSS project. Take it as a pearl of wisdom, and heed this advice. Its true for any FOSS project.

James carries an Apple Macbook. He had problems with displaying X. I found it amusing, that throughout the conference, a lot of folk had problems with X, WiFi, and resuming from suspend. In fact, resuming from suspend occasionally stopped working for me, too. Is Linux ready for the laptop? I’ve asked it before, I just keep wondering. Most of the KDE hackers (high number of KDE folk), actually seem to be using Macbooks. As are most of the Sun folk. After all, with virtualization, you can run other OSes (including OpenSolaris). KDE, with Qt libraries, are also generally native (with X11) on OS X. At some stage, I have got to try out GTK/OSX.

Personally, I think my time would have been better spent at Sreekanth’s talk (he’s from Mahiti, Sunil Abraham’s company), which was titled Natively supporting RDBMS in Plone/Zope for storing Content. The slides could do with more expansion (or I get that this is one of those talks that I needed to be in, to listen and take notes), but its something I’m surely going to look into, in the near future.

After lunch, I decided that I needed to learn more about Hadoop [Meet Hadoop! (Open Source Grid Computing)]. Devaraj Das gave a great talk. I had already learned a bit about Hadoop from watching a Yahoo! video, so this was expanding my understanding further. Hadoop requires a blog post on itself, because I have notes from the talk and from the video, sitting in Tomboy.

QtWebKit by Simon Hausmann was the bomb. Demos alone, took the audience by surprise, and made me want to try QtWebKit out. I found that even though they have mailing lists, most of the WebKit work is done via IRC - they’re on freenode #webkit. I found this to be odd - where’s the logging, and is this really setup for external contributors? Not everyone can be on IRC 24/7, and alone, is not the best communication method. Clearly, from this talk, my interest in GTK-WebKit is quite clear and apparent. As a rendering engine its great - maybe we should be out with Gecko. I only managed to check the code out later in the night at the hotel, but after 1.4GB of traffic (via svn), and a compile, my WebKit directory is now sitting comfortably at 2.1GB. Its, not exactly small, even though its just a rendering engine, eh?

Expecting myself to get bored at the talk on Plan 9 from Bell Labs, by Anant Narayanan (having seen a talk on Minix at linux.conf.au by Andrew Tanenbaum), I was actually really impressed. The design behind Plan 9, and the concepts, seem to make this an OS worth trying. Sadly, I never did get to download the ISO from their official site (I did get it from Anant’s site though). Its small (weighing it at 79MB), and apparently doesn’t really run on much “real” hardware, so I’ll give it a twirl on QEMU or KVM to see how it goes. I learned that UTF-8 was created for Plan 9 (and now we get the benefits of it!). This is clearly a project that benefited from the Summer of Code - by the looks of it, Anant got interested in this, after GSoC 2007. And kudos to Google then, for allowing others to realise the potential of Plan 9.

All in all, great day 1. I was planning on visiting the lightning talks, but they were cancelled for Day 1.

Technorati Tags: , , , , , , , , , ,

Books, recently

Saturday, December 8th, 2007

I have been reading quite a bit recently. Quite a number of them are being read online, in sporadic bits, via my O’Reilly Safari subscription, so at some stage maybe I’ll list them when I complete them. However, in a non-technical sense, here are a bunch of books I’ve read recently:

  • Sperm Are from Men, Eggs Are from Women: The Real Reason Men and Women are Different by Joe Quirk - arguably, a complete waste of time, but you might just read it for humour sake. However, I’m wondering if his thoughts on sexual evolutionary biology holds weight - what he says, is actually, at many instances, quite true. Its an extremely easy read, he likes pointing out that he isn’t an expert in any field he talks about (good, I like his honesty), and if you’re a man (or woman), you’ll find out a little more about the other sex. With a surname like Quirk, this doesn’t get any quirkier.
  • The God Delusion by Richard Dawkins - if I were loaded, I would buy this for every evangelical Christian with a brain, that I know. And there are a lot of them (those that don’t just listen to what the pastor says and takes it for gold). Giuseppe bought this for me as a gift in Heidelberg, and its truly a great read. Of course, there’s also a book titled the Dawkins Delusion, and at some stage I’ll find that and read it. However, if you’re of the thinking that religion is one of the major causes of problem in this world, read this book.
  • The Elephant, the Tiger, and the Cell Phone: The Emerging 21st Century Power by Shashi Tharoor - Amazing book. This is highly recommended, do read it, if you want to learn more about India. Shashi Tharoor himself was the youngest under-secretary general at the United Nations, and his writing quality is just amazing. He might be a bit wordy, he is originally a Keralite, but living overseas, but his perspectives are just amazing. I really enjoy the way the stories are presented, as they’re all independent from another.

Seeing that I’m in India now, I picked up all the rest of Shashi Tharoor’s books from the bookstore the other day. You might want to do that too.

Secure travelling tips with iptables and SSH port forwarding

Thursday, December 6th, 2007

The general paranoia at conferences is such that there almost always is WiFi, and there almost always is someone wanting to snoop your traffic. I guess, in a similar vein, this could also happen at Starbucks. So, on day 1, at foss.in I tried to recollect what I used to do, ages ago (when I used to run Fedora on my R51, before the disk died, and I realised I lacked a backup of /root).

iptables
Firewalls break networks? They also secure networks. I have access to some legacy POP servers, that don’t support SSL/TLS like the IMAP servers I have access to. Firing up Thunderbird, to change the settings, to point to localhost, just seems like a waste of time. So the magic of iptables comes into play.

iptables -t nat -A PREROUTING -p tcp -d my.pop.server –dport 110 -j DNAT –to-destination 127.0.0.1:1235
iptables -t nat -A OUTPUT -p tcp -d my.pop.server –dport 110 -j DNAT –to-destination 127.0.0.1:1235

The above, ensures that to access my.pop.server:110, the traffic is automatically routed now to localhost:1235. Clearly, I don’t run a POP server on my laptop, so this is where SSH port forwarding comes into play.

SSH port forwarding
Provided you have access to a server via SSH, and you trust it, you can tunnel your traffic through it. Its made very easy by the:
-L localport:my.pop.server:foreignport

So using the above example, that would be -L 1235:my.pop.server:110.

Then, let’s not forget the useful -C option, to compress traffic.

And hey, web surfing isn’t secure either, so lets create a SOCKS5 proxy while we’re at it. ssh supports the -D option, which works a charm. Use it such that you have something like:
-D 8188

And now, configure your web browser, to use a SOCKS proxy, localhost:8188. You can also configure it in GNOME, under the Network Proxy, but it seems like not all applications respect it (for instance, I can get pidgin to segfault, and Liferea will not get RSS updates for some reason, etc.).

So to sum it up, your SSH command should look something like:
ssh -D 8188 -L 1235:my.pop.server:110 -C my.ssh.server

Discuss
Am I missing something? Do you have an easier iptables rule? Yes, I realise I can also use a VPN. If you have other tips, please don’t hesitate to comment. Thanks.

Technorati Tags: , , , , , ,