Featured Posts

PHP's Magic Quotes: Taking Control of Your Data Magic quotes can be the bane of any PHP programmer's existence. The feature is intended to be helpful and ward off possible SQL injections, but when you're developing open-source applications, you never...

Read more

Constraints in Rails Migrations I decided to try a rails project again... something I do quite frequently after I've completely forgotten everything I've learned. One thing I quickly remembered is that there is no easy way in a migration...

Read more

PostgreSQL 8.3 Permissions in Gentoo PostgreSQL 8.3 in Gentoo now creates the socket in /var/run/postgresql with stricter permissions, meaning that regular users cannot connect to the PostgreSQL server via command line. Emerging this package...

Read more

Upgrading to PostgreSQL 8.3 on Gentoo Gentoo has taken a long time to unmask PostgreSQL 8.3 in Portage. Currently, the best version you can get is. 8.0.5, which, if you can tell, is pretty far away from 8.3. This masking is largely due...

Read more

  • Prev
  • Next

Twitter, mobile devices and sessions

Posted on: 06/15/2009 | By: Kristopher | Tags:

0

I’m sure I’m probably the only one that has ever run into this, but whenever I’m curious if someone or some organization is on Twitter, instead of searching for them on Twitter, I do a quick Google of +”their name” +twitter.

In my over-excitement of actually finding someone, I quickly click the link, only to find out that it was a link for m.twitter.com, the mobile version of the site. So I get the condensed site. No big deal, just modify the address bar and remove the m, right?

Wrong.

It seems that Twitter stores the fact that you’re on a mobile device in the session or in a cookie. Because I still get the mobile site… for every Twitter site I go to.

The only way I’ve found to reverse this is to delete the cookies for twitter.com.

Ugh, Twitter. UGH.

Failed Kernel Upgrade

Posted on: 03/21/2009 | By: Kristopher | Tags: ,

0

The other day I upgraded my Gentoo kernel (after realizing I was about 7 kernel updates old). After compiling and setting up Grub, I rebooted and received this error:

RAMDISK: Compressed image found at block 0
RAMDISK: ran out of compressed data
invalid compressed format (err=1)
UDF-fs: No VRS found
List of all partitions:

No file system could mount root, tried: …
Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(1,0)

After painful research, I finally discovered the problem: I ran out of space on my boot partition.

Apparently genkernel does not complain when it runs out of space to compile the kernel. It just stops and outputs the same message it would it if succeeded.

A “quick” use of parted to allocate more space to the boot partition, and re-compiling the kernel solved the problem. It’s just sad that genkernel doesn’t bother reporting the fact that it ran out of space.

PostgreSQL 8.3 Permissions in Gentoo

Posted on: 03/07/2009 | By: Kristopher | Tags: ,

0

PostgreSQL 8.3 in Gentoo now creates the socket in /var/run/postgresql with stricter permissions, meaning that regular users cannot connect to the PostgreSQL server via command line. Emerging this package outputs a message about this that I initially missed when installing:

Please note that the standard location of the socket has changed from /tmp to /var/run/postgresql and you have to be in the ‘postgres’ group to access the socket.

This means that regular users who need access to the PostgreSQL server need to be added to the postgres group:

gpasswd -a user postgres

Upgrading to PostgreSQL 8.3 on Gentoo

Posted on: 03/04/2009 | By: Kristopher | Tags: ,

0

Gentoo has taken a long time to unmask PostgreSQL 8.3 in Portage. Currently, the best version you can get is. 8.0.5, which, if you can tell, is pretty far away from 8.3.

This masking is largely due to the painful process of upgrading PostgreSQL (which usually involves dumping all your databases and restoring them afterwards). Here’s what I did to get 8.3 up and running.

Constraints in Rails Migrations

Posted on: 01/22/2009 | By: Kristopher | Tags:

0

I decided to try a rails project again… something I do quite frequently after I’ve completely forgotten everything I’ve learned.

One thing I quickly remembered is that there is no easy way in a migration to create constraints, like a foreign key. You have to do some exec silliness with an actual query.

After some quick searching, I found this plugin: http://rubyforge.org/projects/mig-constraints

Using Flowplayer and ffmpeg to Stream Video

Posted on: 01/18/2009 | By: Kristopher | Tags: , ,

0

We recently had a client that had a need for hosting and streaming videos from their website. These videos were public domain videos, some found on YouTube, NASA’s website, and other resources, and the client was concerned that the videos might be taken down or moved, so they were insistent on hosting the videos on their site. There was also a desire to not require users to have to install Windows Media Player, Quick Time, Flash to be able to view all videos.

PHP’s Magic Quotes: Taking Control of Your Data

Posted on: 04/15/2007 | By: Kristopher | Tags:

0

Magic quotes can be the bane of any PHP programmer’s existence. The feature is intended to be helpful and ward off possible SQL injections, but when you’re developing open-source applications, you never know who’s going to have it on. So do you code for magic quotes or not? All politics aside, I’m going to say not. But it is possible to cater to servers with it both on and off.

Windows -> Linux Path Problems

Posted on: 10/22/2006 | By: Kristopher | Tags: ,

0

I had one hell of a time when I copied my Ruby on Rails application from my development machine (Windows XP, Apache 2.2) to my production machine (Linux, Apache 1.3). I floundered through a series of errors and problems, but one error really stumped me, and unfortunately I couldn’t find much help on the net for it:

   Application error (Rails)

It took me forever to get past this problem, but I finally figured it out. The first line of a few files in the public/ folder contained a path to the Ruby binaries.

   #!C:/ruby/bin

For obvious reasons, this wasn’t going to fly well on a *nix server. So I had to change it in the following files: dispatch.cgi, dispatch.fcgi, dispatch.rb.

In my instance, it was changed to:

   #!/usr/local/bin/ruby

But obviously your server might be different. Try exploring /usr/local and /usr/bin or using locate ruby to try to find the correct path to Ruby.

After I made this modification the application worked fine.