Back on Typo
Well I am back on Typo after going to Wordpress for a bit. The reason I left was because after about 12 hours of being up my website would stop responding. Lighttpd was the only thing that logged it but it was a weird log message
2005-09-20 11:59:12: (server.c.937) connection closed - write-request-timeout: 9
And it seemed to do this on a static image (typically the header image). So I went from Typo/Rails/FastCGI/Lighttpd to Wordpress/PHP/FastCGI/Lighttpd. But then I found that it happened in WP too (the header image file again).
I tried almost every config I could for the website and decided that my lighttpd or FastCGI was wrong. So I updated to the latest lighttpd source and gave WP/PHP another go.
Still broken, so I started to tear up my server trying to find the solution. Then I remembered that when I was mirroring large files, the download would just timeout. The only thing that would fix it was removing the bandwidth throttle.
server.kbytes-per-second = 50
After dumping that one line of code, I restarted my server and crossed my fingers. Well Wordpress stayed up over 26 hours, even with ab hitting it hard. So next I setup Typo on a subdomain and hit it hard and long. Typo had over 100,000 pages in it’s cache after a few hours, but it stayed up and pretty responsive even with development mode and over 25 concurrent connections.
Now it is about 24 hours latter and Typo and Wordpress were ok. So I now am running Typo again, my favorite { CMS | blog } ever.
Now to see what goodies TRUNK has for me.
Eric, back with AJAX
Choosing Names in Your Database
At work I was working on a simple Ruby on Rails project that is basically going to use CRUD to store, edit, and view information, something simple. I kept getting really weird errors with my scaffolding. After much mangling done with my database and code I found the problem was that I named a field in a table “System”.
This field was supposed to keep track of the Computer System so System was a nice shorthand for it. Well my shorthand cost over 6 hours of headaches. Turns out by using System, rails tried to create a new instance of it to reference the table but there already was a System in the namespace… namely “System” as in Kernelspace. So when my scaffold called System.send to try to read the data from the database it was actually calling the kernel of the , not the desired result you see.
After much googling and research I came across some links for my fellow rails developers (and myself for when I forget again). These are links to rails’ reserved words, the sql reserved words, and then just some words that should not be used in tables (ActiveRecord reserved words?)
Reserved Words in Ruby on Rails on the RoR wiki
Search for reserved words in various SQL database engines.
Eric
Apple's FileVault
Recently I turned on the “FileVault” option on my Mac. For those who don’t know FileVault is a preference that lets a user encrypt their /home directory. It is encrypted and the user sets a password to access it. Then when the user logs in their /home is decrypted on the fly as it is used.
Well I was looking at something eariler and noticed that the “Get Info” screen changed. Now not only is there the “where” area but also the “Disk Image” area. Mine said “/Users/.eric/eric.sparseimage”.
For the non-UNIX junkies, the dotted directory means it is hidden. So first thing I did was fire up a terminal and check out why I had a hidden directory. Come to find out there is an encrypted spareimage in there that is over 4GB. Ever more curious I then fired off a ‘df’ to see what was going on. Turns out my /home folder was mounted off a disk I didn’t know I had, but was the same size as my hard drive. Hmm these look connected.
Well to sum up, when you turn FileVault on it actually makes a hidden home directory for you, creates an encrypted sparceimage in there for you and then tranfers all your files over there. Then to finish up it mounts that image as your /home, thus making it appear nothing has changed. Kinda good idea. So for all those who have been using custom rsync’s to backup their computers (myself), can now just sync one sparceimage and it is already encrypted and setup corrctly.
Eric
Updated Typo
Just went through and updated typo to the latest trunk and got it all working. It might look the same but under it all it is totally amazing. The work the developers have done in the fast few days make this one of the best setup’s I have run. Only real issues I had were :
- The migration script wouldn’t work for my sqlite3 database. I heard this is something with rails itself and is fixed in the next version. So I just had to create a new database and migrate the data by hand, not too hard.
- I had a looping issue where whenever I went to the main blog page I got looped back into the admin section. I tried many different things but found out you have to select a theme after saving the admin options. (thanks Eridius)
Other than that it is pretty damn good, look for the next release soon, it is totally worth it.
Eric
Accounting on Rails
For my first project on Rails I will be making a fully fledged business accounting setup. It will be fully web-based and is targeted at medium and small sized businesses. I got a little bit of it done, and will work on it as I get time. Hopefully in a month I will have a completely working copy.
Eric
