JAY DEE DROP THE BEAT

Posted by Jason Sun, 12 Feb 2006 06:13:00 GMT

James Yancey aka Jay Dee aka J Dilla died last Friday. It was a very bad way to end a bad week for me. I’m not usually deeply affected by deaths of people I’ve never met, but the death of Jay Dee got to me. Ever since Like Water For Chocolate was released, I’ve considered him the best producer in the game. In the past couple years, it seemed like he was finally finding his place in the industry. And finally getting the recognition he deserved.

It was obvious he’s been sick since Champion Sound was released. The weight swings, the hospitalizations, those European shows he did in a wheelchair… It’s just hard to hear that he was hiding lupus for so long.

I wanted to put together a Jay Dee compilation, but it’s already been done much better by other people (such as Mental Combat). But I will still offer a couple downloads:

Two Can Win from the new Donuts LP. I actually haven’t bought or listened to Donuts yet – this is the only track from the album I’ve listened to. If this track is any indication, Donuts will be great. Gonna buy the album on Monday.

Common – Heat from Common’s Like Water For Chocolate. LWFC is one of my favourite albums. I know I’ve spent a fair bit of time defending it. “Heat” is my favourite beat from the album.

It’s Like That from Welcome 2 Detroit. This is the most underrated Dilla beat ever. It follows the formula that Dilla used to win my ears – really simple drum patterns with the volume of the drums turned WAY UP. This beat isn’t much more than than one drum loop and a chopped bass sample. Who else can keep it this simple and make it this hot? Listen to this song in the car and turn up the volume.

http://jaydee.ytmnd.com/ – I made this about a year and a half ago. Click. It features the song “Welcome 2 Detroit”.

For the past few weeks, this has been my main CD stack…

The flash washed it out, but there are two other CDs in the stack with Jay Dee production.

Detroit Free Press article on Dilla’s death

Dilla’s section on the Stones Throw page

no comments | no trackbacks

Programmers MUST Read This

Posted by Jason Fri, 10 Feb 2006 06:13:00 GMT

Programmers Need To Learn Statistics Or I Will Kill Them All by Zed Shaw

I’ve done a little bit of load testing before, and I couldn’t say I believed my results told the complete story. Zed’s article definitely clears up a lot for me.

I will admit that I did pretty much the bare minimum in the area of Statistic in my University career. I slept through the first year course because it was pretty much a course for Arts students. After that, I picked up enough in compsci courses to calculate the number of runs required for a Monte Carlo/Las Vegas algorithm to be correct with a given certainty.

If I were to go back to school, Statistics is something I’d like to revisit. As one of my favourite professors says, Statistics is the field that’s most applicable to real life. (Okay, Al’s wording is much more elegant than mine.)

no comments | no trackbacks

Postgres Roles And Permissions

Posted by Jason Wed, 25 Jan 2006 03:17:00 GMT

If you’re application’s database follows the Application Database design (which most web apps do employ these days), it’s not difficult to figure out how to set up your roles and permissions for the DBMS. The challenge is that you have multiple databases on your DBMS, and you want to be sure that each user can’t access any other user’s data. So here’s how you would add a new database in Postgres:

-- First we want to create a new role for the database
CREATE USER myuser PASSWORD 'mypassword';

-- Now create the database - note the owner
CREATE DATABASE mydb OWNER myuser;
-- Remove public access to the database
REVOKE ALL ON DATABASE mydb FROM PUBLIC;

Now connect to mydb as myuser…

-- Even though no other users should be able to access the database,
-- we'll be extra paranoid and make sure we're not working in a
-- public schema
DROP SCHEMA PUBLIC CASCADE;
-- By default, Postgres will automatically find the schema with the
-- same name as your user name if you create it.
-- Plus, it's not accessible to any other users by default!
CREATE SCHEMA myuser;

There! Now you can access and use that database normally. As long as no one is using the super user account, you can be confident that other database roles can’t access this the data in mydb data. Rinse and repeat for each application/database that you need.

This is pretty easy to figure out if you RTFM, but I figure it’s a good thing to write out anyway. I’ve seen this done in very wrong ways. And it’s tempting to ignore database security when your team members are the only people who will ever access the database. But it’s easy, SO DO IT.

7 comments | no trackbacks

Welcome Back

Posted by Jason Mon, 12 Dec 2005 05:39:00 GMT

Yes, this blog is back from the dead. I nuked my Linode and set it back up again. I’m very happy with the new setup.

Sometime this week I will restore most of the old articles (but not the comments, unfortunately). I will also blog a little bit about the new setup. I’ve learned a couple new things this weekend – proper (or at least improved) setup of PostgreSQL for multiple users and Apache/FastCGI setup with external servers.

Stay tuned!

Update, December 18: Most of the old articles are back. I didn’t bother with two that I felt were useless, and the old comments are gone too. Something new coming soon. And when I say soon, that could mean a month.

9 comments | no trackbacks

Spice Up Slackware

Posted by Jason Sun, 20 Nov 2005 10:42:00 GMT

Think the fortune cookies you get when you login are a little lame? Go into /etc/profile.d and the bsd-games-login-fortune.sh and bsd-games-login-fortune.csh files change this:

fortune fortunes fortunes2 linuxcookie

to this:

fortune -o

Much better!

no comments | no trackbacks

Typo, Slackware, User-mode Linux

Posted by Jason Mon, 19 Sep 2005 09:42:00 GMT

It’s been a while since I blogged AGAIN. Oh well, let’s get on with it…

  • As you can see, I’ve updated to the latest version of Typo. Migrating the data was not difficult, but as usual it was a slight pain getting Apache/FastCGI set up properly. I just haven’t done it enough for it to be automatic yet. This version of Typo rocks though, the administration backend is much improved, complete with Ajax. Now I just have to get around to customizing the look a bit, and changing the crappy title again.
  • Slackware 10.2 was released a couple days ago. It’s pretty much what you’d expect – same old Slack with updated kernel/packages. A solid release all around. The only significant change was that Gnome was dropped completely. I’m quite fine with that. The only two Gnome programs I used were gedit and gnome-terminal. No big loss. I’ve gone back to using xterm (faster, but I don’t like the scroll bar) and I’ll probably install nedit. Long story short: GO SLACKWARE!
  • I’ve nearly mastered User-mode Linux. I used to run my Wiki on my machine directly, but now I have it running on a UML instance that gets started/stopped when my machine boots/halts. It is quite cool, and works quite well. Sooner or later, I’m going to put together a little tutorial on how to get it all to work together.
  • My PowerBook did indeed die. It wasn’t just the memory, it was the whole logic board. On it’s last days, I started get weird exceptions in OpenFirmware, and some even weirder video-related exceptions in OS X. I’ve had it for about a year and a half, so the regular warranty had run out. But luckily, the credit card I had bought it with has a nice little perk where they double the manufacturer’s warranty. It would have cost around $1400 to fix it, but thanks to the credit card dealie, I will get reimbursed for the repair. Still, it’s a pain – you have to trade faxes and phone calls with an insurance company to get it done. So the moral of the story is: ALWAYS GET APPLECARE FOLKS. Football season has started and hockey is right around the corner. I’M SERIOUSLY PUMPED. It’s been more than a year since I’ve had a good sports overload.

That’s it for now.

no comments | no trackbacks

Still Blogging...

Posted by Jason Sat, 06 Aug 2005 09:42:00 GMT

Yes it has been a while since I blogged. So here’s what’s happened over the past while:

  • My PowerBook kinda died. The onboard RAM is dead. For a while, it wouldn’t run more than 10 minutes without locking up. But the last time I started it up, I was able to dump all of the data without any trouble – that took more than 3 hours. I’m going to see if the locking up thing was just a passing phase (it was locking up consistently like 4 months ago for a weekend, but that eventually passed). Either way, it will need service eventually, but I hope it’s usable enough to bring on vacation.
  • I fixed my Nintendo. I replaced the 72 pin connector and cleaned up some games. Now I can play Battletoads the way it’s supposed to be played. You’d be surprised how good NES games sound when you have a sound system with some bass.
  • Been trying out test driven development at work. I’ll have to sum up my findings on that once I’m done the current project. A preview: why would anyone NOT do test driven development?
  • Got User-mode Linux going… I’m quite impressed with it. Very soon I will blog about how I’ve integrated it with Slackware’s init scripts.
  • Renamed this blog. Still looking for a better name though. I also want to try and upgrade this to the bleeding edge version of Typo. I got that running at work and it’s crazy. It’s improved in almost every way, and the Ajax features are quite impressive. Once I do that, then I’ll look at customizing the look a little bit.

no comments | no trackbacks

YTMND Snippets

Posted by Jason Sun, 26 Jun 2005 09:42:00 GMT

Perhaps my favorite site on the internet is You’re The Man Now Dog. I usually spend at least 15 minutes a day just hitting random YTMNDs and generally laughing my ass off.

Of course, I am also a cyber-packrat, so if I find a YTMND funny, I’d bookmark it. There are two problems with this approach. First, the giant YTMND folder is in my bookmarks is very awkward. After I got a few hundred entries in there, Safari started to choke whenever I added a new bookmark. But more importantly, this approach is dependent on YTMND being available forever and ever. It’s gone down once… And considering how much bandwidth and storage it requires, I’m guessing it’ll go down again. So there was only one course of action: save all my favourite YTMNDs locally.

My first attempts at doing this with perl’s WWW::Mechanize and HTML::Manipulator modules was unsuccessful. So I backpedalled and figured out that the right way to do this was with wget. This command will download the index page, the background, the sound, and blank.gif into the current working directory:

wget -S -U "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125" -r -l1 --span-hosts --no-directories --convert-links --follow-tags=body,embed,img http://tcruiseko.ytmnd.com/

The important thing here is to -U argument. YTMND does some browser sniffing to determine how to embed the sound. If you don’t include that argument, it will embed it in a way that looks ugly in Safari – the Quicktime sound control will appear in the top left.

I wrote a perl script to handle the directory structure automatically. I now have a directory with a ton of YTMNDs, and browsing through it fills me with joy.

Next step was extracting all my bookmarked YTMNDs and saving them with my script. Safari’s bookmarks file is just XML. EASY!

cat ~/Library/Safari/Bookmarks.plist | grep ytmnd | perl -e 'while ( <STDIN> ) { chomp; ( my $url ) = ( m|(http://[^/]+/)| ); print $url . "\n"; }' | ~/Projects/ytmnd/ytmnd.pl

This is still executing as I write this. I’ve got over 800 of these bookmarked. Perl makes life so much better.

no comments | no trackbacks

Your Moment of Xen...

Posted by Jason Mon, 13 Jun 2005 09:42:00 GMT

I’m a Slackware guy myself, so normally I would be indifferent to a new release of Fedora. But there’s was one new feature that caught my eye: built-in Xen.

My Linux machine has a bunch of partitions: two for Slackware (one for “production” and one for trying stuff out), one for some other Linux distribution to play with, one for playing with BSD, and another giant data partition. If I could replace most of those partitions with one instance of Fedora Core, that would be a nice improvement.

This weekend, I’ll be downloading FC4 and it out. If I can get two virtualized instances of Slackware running under Fedora/Xen, then I will be very happy.

no comments | no trackbacks

FastCGI and Ruby on Rails

Posted by Jason Sat, 11 Jun 2005 09:42:00 GMT

Update, December 18: Since writing this, I’ve learned about deploying Rails with Apache. And yes, there are ways to do this that are much less painful. The Rails book mentions using FastCGI in static mode. In my opinion, running FastCGI in external mode is even better. Unfortunately, there’s very little documentation on this (not even in the Rails book), but I plan on blogging on it soon.

I think Ruby on Rails’ biggest weakness right now is deployment. Not to say it’s hard, it’s easy if you follow the directions. The problem is when you don’t follow the directions. Tracking down your mistake can be difficult.

At least I encountered a little difficulty while installing Typo. Since I already had one Rails application running, I figured that adding a second would not be a problem. I made a copy of the VirtualHost directive in my httpd.conf, made the required changes to the .htaccess and dispatch.fcgi files. I restarted Apache and it didn’t work. The hunt was on for my mistake.

Everything else running on Apache worked fine, and Typo still worked with WEBrick, so at least I knew the problem was in the FastCGI configuration, or possibly a file permissions issue. Since I’d had that problem before I first went to /tmp and looked through fastcgi.crash.log. The error message in there was pretty useless, so I just deleted all the old session files and tried again. Didn’t work. Since that was really the only problem I had encountered in the past, I was a little stuck.

Next was the root apache error_log. It only logged the birth FastCGI servers, so that wasn’t interesting. Next, I looked at the error_log for the blog’s virtual host. It logged the errors, but the message was also useless. After a little spell-checking and verification in dispatch.fcgi, I went to look at the logs that rails keeps. That’s where I noticed another fastcgi.crash.log. Inside there was the answer to my problem – the application was trying to access the (non-existant) development database. The environment was set up for development, not production. I had to go back to httpd.conf and add the FastCgiServer directive to set typo to use the production environment.

It was around an hour’s worth of frustration for a simple problem, and it was mostly due to how the number of logs I had to look at. That said, I don’t see a better solution. The two different apache logs is an definitely required even for a low-traffic site like mine. I don’t know if having two different fastcgi.crash.log files was necessary though – although I have a feeling I could have configured it to use a single log file. And of course, Rails’ log files are most important… So I don’t a clear improvement that could be made. As long as FastCGI is used, that’s the way it’s gonna have to be. And FastCGI is great as it is.

no comments | no trackbacks

Older posts: 1 2