NegativeArraySizeException on Cassandra 0.7.4 startup

reading saved cache /cassandra/saved_caches/system-IndexInfo-KeyCache
Exception encountered during startup.
java.lang.NegativeArraySizeException at 

I was getting this error after upgrading from 0.7.0 to 0.7.4 and couldn’t restart cassandra. I ended up removing the files in my saved_caches directory and this fixed my problem.


Leave a Comment

Permalink change on fresh WordPress install causes 404s

When you change your perma-link setting in WordPress, it will update the .htaccess in it’s directory.
By default, apache does not allow this file to be read. This is why you start getting 404s.

You can enable this by changing the following setting in your httpd.conf file:

AllowOverride None
AllowOverride All


Leave a Comment

Why do you type ps faux so much!?

I use it a lot. As soon as I log on to a box. After I restart something with god. After I pull. etc etc…

People ask why I use it so much. Knowing the state of a box is important to being able to prevent and diagnose problems and I find a lot of issues with ps.

A lot of times, I’ll find new issues just because I randomly did a ps and noticed something weird.

It’s one of my first tools in debugging system level issues.

For example, I recently had a problem where Nagios was not saving acknowledgments, and configuration changes were getting reset.

Logged on to our monitoring box, ps faux:

Dec02 183:02 nagios
15:58 0:22 nagios

.. oh 2 instances running, that’s weird. Problem identified.


Leave a Comment

compile cuda program in device emulation mode

Prior to 3.0 you can just compile with the -deviceemu flag:

nvcc -deviceemu

In 3.0, this was changed such that you should link against cudartemu instead of cudart
In 3.1, emulation was removed.

So if want device emulation, you need to use version 3.0 or earlier.


Leave a Comment

ERROR 2013 (HY000): Lost connection to MySQL server during query

Running an alter table to add an index was causing MySQL to crash with the following error:

ERROR 2013 (HY000): Lost connection to MySQL server during query

Was happening on 5.1.31. Pretty small table ~2m rows, so ended up just dumping the data and reimporting it and it fixed the problem. This was only happening on the production box, not in dev.


Comments (1)

Incorrect key file for table ‘frogs’

I was trying to add an index to a table with ~117M rows and was receiving the following error:

ERROR 1034 (HY000): Incorrect key file for table ‘frogs’

Moving my tmpdir to another drive with more space and rerunning the alter table solved the issue.


Leave a Comment

undefined method `true_class_url’

Had a named route:


And an action:

def thankyou

Forgot the sub-domain and a little _url on the end of a link inside my controller:

redirect_to thankyou

debugging ensued….

Leave a Comment

Redirect http to https with sub-domain support

Here’s what I use, seems to work pretty good.
server_name_in_redirect is on by default.

   server {
     listen 80;
     server_name monkey;
     server_name_in_redirect off;
     rewrite ^/(.*) https://$host/$1 permanent;

Additional reading materials:
Nginx Core
Nginx Rewrite

Leave a Comment

Attach File Using Ruby Mail Gem

Very simple, just use the add_file method. The trick is to make sure your body is in a block that you pass to text_part:

Mail.deliver do
  from ''
  to ''
  subject "secret file"

  text_part do
    body "Please see attached file."

  add_file ({:filename => "myfile.txt"})

When I didn’t have my body inside of a text_part, it placed an encoded version of the binary file into the body of the email, which isn’t quite what I wanted.


Leave a Comment

No such file or directory – getcwd

If you try to execute gem list or similar from a directory that doesn’t exist you may have seen the following error:

No such file or directory - getcwd

This happens if you delete your current directory, maybe you were in a gem directory and uninstalled that gem for example..


Leave a Comment