Al Hoang

March 22, 2008

SVN Worst Practices

Filed under: programming, tech — hoanga @ 12:36 pm

I’m dying of laughter looking at the slides for this presentation on how to screw up the development lifecycle with subversion.

Useful things to throw in:

–object code

–per-user preference files

–generated docs

–ISO images

–release tarballs

Either way a good read on trying to follow a good path when trying to apply version control to any project.

Read it yourself (PDF)

Daring Furball, i can haz flamin cheezburger

Filed under: geek, humor, mercurial — hoanga @ 9:44 am

while lukingz 4 moar informashun on distributd scms (again) i findz post by dave dribin bout y he chose mercurial 4 hims needz. but even moar awsum iz hims darin furball.

far 2 awsum. let teh semantic web has cheezburgers, man.

March 21, 2008

Desktop environments and habits

Filed under: tech — hoanga @ 8:12 pm

Slashdot’s Roblimo has an article on switching back and forth between GNOME and KDE and that will probably spawn a long (,mostly pointless) debate on the merits of GNOME versus KDE versus foo that I’m sure many Linux users will have. The biggest gem in the article is in his discussion on why he hasn’t been converting people to use Desktop Linux

I don’t have time for much intense hand-holding, and that’s what it takes to teach people who are not naturally computer-inclined how to use any new operating system or software.

Habits are hard to break.

Kudos to the people who have the time and patience to help people embark on the long journey that requires ’switching’. However, I’m with Roblimo on this. I have a hard enough time managing my own time let alone adding more stuff to take away what I have of my time.

Read it yourself

Being stupid on numrows() versus getting the actual result in LuaSQL

Filed under: programming, stupid — hoanga @ 9:53 am

I’m dumb. I had a bug in a checker script that I wrote and only noticed it recently when I bothered to RTFM. Can you spot the error? Probably most programmers will.

Non-working version

require "luasql.mysql"

env = luasql.mysql()
mysqlconn = env:connect("somedb", "someuser")
curs = mysqlconn:execute("
SELECT COUNT(*) FROM some_table WHERE col1 = ''foo")
print("Number of rows in $dlq queue is: ", curs:numrows())

Working version

require "luasql.mysql"

env = luasql.mysql()
mysqlconn = env:connect("somedb", "someuser")
curs = mysqlconn:execute("
SELECT COUNT(*) FROM some_table WHERE col1 = ''foo")
print("Number of rows in $dlq queue is: ", curs:fetch())

Wall Street Journal on the necessity for IT Literacy in the enterprise

Filed under: tech — hoanga @ 9:52 am

WSJ talks about the need for IT literary in the enterprise. Especially from the people who sit at the top.

The article makes a strong case suggesting the tops of the company should have a much stronger grasp of IT in their organization to understand the benefits it can bring the organization instead of a just a recurring expense and trying to isolate the tech crew.

It’s rather convincing however it forgets one thing. “He who owns the gold, makes the rules”. In general, IT doesn’t own the gold. Anyways, here’s hoping…

Read it yourself

Getting erlang to build on MacPorts with an installed iPhone Open SDK

Filed under: fixes, osx — hoanga @ 9:48 am

I had some serious unexpected fun trying to install erlang on my OS X box using MacPorts. In general it’s usually a no brainer you usually type sudo port install <foo> and you have a new package installed without that much fuss. However here is the partial log of trying to install erlang and it blowing up…

$ sudo port install icu erlang
... ICU installs without a problem ...
--->  Fetching tcl
--->  Attempting to fetch tcl8.5.1-src.tar.gz from http://downloads.sourceforge.net/tcl
—>  Verifying checksum(s) for tcl
—>  Extracting tcl
—>  Configuring tcl
—>  Building tcl with target all
Error: Target org.macports.build returned: shell command ” cd “/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix” && make all ” returned error 2
Command output: /usr/bin/gcc-4.0 -c -Os -O2 -pipe    -Wall -Wno-implicit-int -fno-common -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../generic -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../libtommath -DPACKAGE_NAME=\”tcl\” -
…
…
…
_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:62:
/usr/local/include/mach-o/arch.h:35: error: nested redefinition of ‘enum NXByteOrder’
/usr/local/include/mach-o/arch.h:35: error: redeclaration of ‘enum NXByteOrder’
/usr/local/include/mach-o/arch.h:36: error: redeclaration of enumerator ‘NX_UnknownByteOrder’
/usr/include/architecture/byte_order.h:137: error: previous definition of ‘NX_UnknownByteOrder’ was here
/usr/local/include/mach-o/arch.h:37: error: redeclaration of enumerator ‘NX_LittleEndian’
/usr/include/architecture/byte_order.h:138: error: previous definition of ‘NX_LittleEndian’ was here
/usr/local/include/mach-o/arch.h:39: error: redeclaration of enumerator ‘NX_BigEndian’
/usr/include/architecture/byte_order.h:140: error: previous definition of ‘NX_BigEndian’ was here
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c: In function ‘TclpFindSymbol’:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:382: warning: ‘NSLookupSymbolInImage’ is deprecated (declared at /usr/include/mach-o/dyld.h:182)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:415: warning: ‘NSLinkEditError’ is deprecated (declared at /usr/include/mach-o/dyld.h:217)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:419: warning: ‘NSLookupSymbolInModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:181)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:428: warning: ‘NSAddressOfSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:188)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c: In function ‘TclpUnloadFile’:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:493: warning: ‘NSUnLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:169)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c: In function ‘TclpLoadMemory’:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:697: warning: ‘NSCreateObjectFileImageFromMemory’ is deprecated (declared at /usr/include/mach-o/dyld.h:146)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:730: warning: ‘NSLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:161)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:732: warning: ‘NSDestroyObjectFileImage’ is deprecated (declared at /usr/include/mach-o/dyld.h:147)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:740: warning: ‘NSLinkEditError’ is deprecated (declared at /usr/include/mach-o/dyld.h:217)
make: *** [tclLoadDyld.o] Error 1

Error: The following dependencies failed to build: tk tcl
Error: Status 1 encountered during processing.

Pretty sucky, huh? My first lazy thought was, “I thought the point of a package manager was to avoid all these problems.”

After a little bit of thinking and staring at the error message, I did the workaround and moved the /usr/local/include directory away and tried rebuilding which made things much happier. Check the log below…

$ cd /usr/local
l$ ls
arm-apple-darwin	include			man
bin			info			share
docs			lib
etc			libexec
$ sudo mv include include.ignore
l$ sudo port install icu erlang
Skipping org.macports.activate (icu ) since this port is already active
--->  Cleaning icu
--->  Building tcl with target all
--->  Staging tcl into destroot
--->  Installing tcl 8.5.1_0
--->  Activating tcl 8.5.1_0

Voila. A working erlang install. Don’t forget to move back the include directory back to its old place.

Too Dumb to Haskell

Filed under: humor, programming — hoanga @ 9:01 am

March 16, 2008

Seeing Lock already exists: /var/run/munin/munin-update.lock? Don’t worry it just means your munin updater is slow

Filed under: gripe — hoanga @ 11:50 pm

Luckily this forum post explains the issue.

I’ve had this problem if the munin-update process takes longer than 5
minutes. The reason this happens is because the cronjob is set to run
every 5 minutes to gather data, so if it is still running from the last
job, you will get this error.

Read it yourself

March 15, 2008

Matt Mullenweg the creator of Wordpress speaks

Filed under: gripe — hoanga @ 9:24 am

Nice summary of his talk at FOWA 2008.

Confirmation of Matt speaking at FOWA 2008 and link to a mp3 speech. I like how he talks about scaling on multiple levels for a website.

lighttpd + fastcgi that much better than apache + mod_php? The court is still out on this

Filed under: gripe, tech — hoanga @ 9:23 am

While going through my blog feeds I came across a post on Ubuntu Geek on lighttpd with php5 and mysql support. One choice quote from the article sort of irked me as I was scanning through it:

With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the perfect solution for every server that is suffering load problems.

While I can agree with the author’s assessments on lighttpd serving static files, I’m still not 100% convinced it is the end-all be all solution once you throw in FastCGI + PHP5 in the backend. In general, it’s a no-brainer that you should not be using Apache if you need performance AND are serving static files. You are far better served by using nginx or lighttpd or probably any of the new generation of lighter-weight web servers out there.

However, the game changes when you toss in backend FastCGI processes and MOST of the handling of the website is dynamic content generation by the PHP backend without that many static files. Why do I say this? I’ve converted over an Apache 2 setup with mod_php5 to lighttpd with FastCGI and have been monitoring it stats for awhile and a few things that sort of surprised me was:

  • CPU usage hasn’t changed that much
  • The memory consumption systemwise also doesn’t seem to be that much different
  • Load averages overall seem a little bit higher

However, there are probably many flaws with my observations since this is a live running system that I’m very loathe to apply scientific measurement since this could easily produce downtime on a system I’d rather not take down. Overall, I have been a little disappointed that switching to lighttpd + fastcgi hasn’t really done much to drop the system resources as much as I hoped.

My guess right now is that since a lot of the work has to be handled by the FastCGI backends which is PHP, switching to lighttpd hasn’t really been that much of a gain since in the end most of the handling on that server is being done by PHP with lighttpd merely fronting it so lighttpd might be light indeed but the FastCGI PHP processes aren’t. I guess this goes to show you that one should not always dogmatically believe the hype.

March 14, 2008

Macbook Air tossed out with the newspapers?

Filed under: humor, tech — hoanga @ 9:20 pm

A Newsweek journalist finds his Macbook Air is mainly just air now…

A word of warning that as technology fits more into our lifestyle it might get lost

Read it yourself

March 10, 2008

Graphing mysql slave delay for munin

Filed under: Open Source, tech, unix — hoanga @ 9:42 am

I’ve been wanting something to visualize mysql slave delay. Looks like LordElph has gone ahead and wrote something already to do it. Cool beans.

Rereading a disk partition table in Linux without rebooting

Filed under: fixes, linux — hoanga @ 9:25 am

Ran into a problem with trying to partition up a disk on a running system. The idea is I wanted to create a new partition on a disk with partitions already mounted and use it without rebooting.

Here’s what you’ll mostly likely run into…

# sudo fdisk /dev/sda
... Steps for adding disk  elided ...

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

ahoang@jp-db-3:~$ sudo mke2fs -m 0 -j /dev/sda3
mke2fs 1.40.2 (12-Jul-2007)
Could not stat /dev/sda3 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

# ls -la /dev/sda*
/dev/sda   /dev/sda1  /dev/sda2

The simplest thing to do is just reboot and Linux will redetect everything on restart. However, sometimes you just can’t reboot. After Googling around it seems that partprobe does the job handily. Luckily this tool is already on an Ubuntu system so no need to apt-get install but it’s only a few keystrokes away.

Here’s the rest of the log once I ran partprobe and was humming along…

# sudo partprobe
# ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3
# sudo mke2fs -m 0 -j /dev/sda3
mke2fs 1.40.2 (12-Jul-2007)
... Creating a file system output elided ...

March 7, 2008

The Industry Standard commentators need to do the math on 99.999%

Filed under: gripe, stupid — hoanga @ 1:32 am

The Industry Standard comments on Why don’t we accept less than 99.999% to which I say… are you willing to really pay for it?

For many things, I’m not. Demanding without paying is basically asking for a freebie. This smells of rant without a basis in my book.

Powered by WordPress

Protected by AkismetBlog with WordPress