Linode — filesystem is read-only after cloning

Quick tip here for those who just cloned a linode and their newly cloned filesystem says it’s read-only.

As a relative newblet to Sys Admin stuff, I submitted a ticket and got an answer in 30 mins w/ the solution.

Indeed, I did a clone while the source system was online.

The fix

http://library.linode.com/troubleshooting/finnix-recovery

  • Make a new boot configuration in the linode manager.
  • Load the finnix recovery kernel, mount the 3 disks as shown in the image. The finnix partition, your partition, and your swap.
  • Don’t forget the initrd image at the bottom.
  • Boot the system
  • Launch ajax console
  • Type in..
fsck /dev/xvdb
#note: xvdb is the second slot in the mounted disks in your setup. xvdc if you used the third, dvdd if fourth, etc.

and if you don’t want to type yes over and over for a few days, append a -y to it.

fsck /dev/xvdb -y

Reboot your initial configuration, and you’re good to go.

Slicehost to Linode VPS

This is hardly a technical comparison other than citing a benchmark. This is my experience in researching whether I should move from Slicehost to Linode.

The answer I got from my research is that Slicehost appears to be lagging behind due to being acquired by Rackspace. The bottom line though, is real hard data on performance, server hardware, cost per Storage GB, Ram, Bandwidth.

Slicehost acquired by Rackspace: management shift slows down progress.

Slicehost has been very behind these past 2 years — they have made no changes due to their being acquired by Rackspace.

They even admit it in their forums: they are disappointed with where they’ve gone. Lots of talk, no action, etc.

Slicehost admits fault on their forums.

You Guys Really Should…: Start trying to compete again?

When hit with the big question of: “your slices are expensive” their response is that they can scale if you suddenly get a ton of traffic on Christmas eve, which I have no doubt linode can do too.

I’ve read in slicehosts very own forums that many have been switching to linode over the years, including their guru base. I believe it!

In Slicehosts defence:  they claim you pay a premium for their support

But for me, my support has been great on both sides. Starting to claim you pay a premium for the quality, service, etc., is the last pitch you say when you can’t think of any other answers.

I’ve switched my DNS to linode, have used their clone service, resize op,  already submitted a ticket about / got an answer within 30 minutes.

Slicehost has better cloning/resizing, but how often do I use that..?

But to be honest, I don’t care about that too much. I’m not in a position to know how much work they did or didn’t do / what that means for the end consumer.

The bottom line is…

Linode wins performance benchmark of 5 VPS providers.

Check this VPS benchmark for the final answer: http://journal.uggedal.com/vps-performance-comparison

Linode beats the other VPSes on the market. The margin is VERY significant. I’ve already read that Linode simply uses better processors as you can check on your slices vs linodes.

Linode performance /should/ be up considering better processors.

My linode has 4 x Intel Xeon L5520 @ 2.27ghz, 8192kb cache.

Linode: more stuff for your money.

So far, I’m loving that the same $20 buys me 360mb of ram on FASTER servers vs 256mb of ram on slower servers.

  • Linode: $20 – 360mb ram – 16gb storage – 200gb bandwidth
  • Slicehost: $20 – 256mb ram – 10gb storage – 150gb bandwidth

Some straight out of the box features I’ve stumbled upon in linode

  • Web console
  • Major downside of linode was not having clone backups. They added it last month.
  • Private IP for free in-datacenter communication (my backups)
  • Admin with CPU/Traffic/Disk IO graphs for past 24 hrs, 30 days, and archive.
  • Auto reboot
  • One click server deployment scripts (I used one that sets up fail2ban, basic iptables, apache, django_wsgi, postgres / db…)
  • Ability to use different kernels. I used a recovery partition already.
  • Cool SSH access by whitelisted IP only. non whitelisted IP login attempt generates email to you to ask if you want to whitelist it. Simple. Effective.
  • Notifications on cpu/disk/traffic over certain threshold
  • and find the rest yourself! they have money back guarantee and it’s not like it’s expensive.

Here’s a referral link to linode

Assembla / Git — Delete a Repository within Space

Deleting a git / svn repository without deleting the whole space.

I gave up since I couldn’t google the answer.

Deleting repo:

Go to the space specific page, where you see all the repo tabs.

Click Admin tab.

Scroll to “tools”.

Click the “more” link on the right of  “tools”

Delete specific repositories on the right sidebar under “installed tools”

By the way, assembla is a host for Subversion and Git version control. They offer 2gb, FREE and PRIVATE hosting for git.

I highly recommend them.

PostgreSQL — pg_dump permission denied – LOCK TABLE

Check if the user running pg_dump has access to the tables.

For me, I had 2 tables owned by postgres instead of my usual user for some reason.

Check by going into psql, connecting to your DB, and typing \d

To change your table owner, type

ALTER TABLE tablename USER TO user;

Linode apache mod_wsgi django setup for future reference

My django server setup for future reference, because it’s too easy to forget exactly who’s talking to what file in 2 months.
Will put nginx front end proxy soon.
  • Apache listens on port 80
  • Port 80 is a VHOST in sites-available / apache2.conf
  • Apache Vhost points to WSGI Script in /srv/anuva/_project/apache/django.wsgi
  • WSGI Script adds anuva project to PYTHONPATH
  • WSGI Script defines which  anuva.settings as project, and django’s WSGIHandler processes the request.
  • Apache displays request.

Things I’ve done this time for better management:

The project itself is now in a folder called anuva_project, alongside a logs folder, and apache folder.

I can now add all project specific things in one folder instead of everywhere. Logs are easily accessible instead of at /var/log/apache2/site .

I can add a directory for site specific python packages by adding the directory to the pythonpath in the WSGI script.

Gmail — Open attachments right away, skip virus scan or other bugs

Gmail always gives me trouble when trying to download an attachment. Just now, I couldn’t download my attachment for no reason. There was no error message, it just wouldn’t make a download button.

If you want to skip it, pretend you’re forwarding the message and the attachment will appear as an attachment that you can just click to reliably download it.

JavaScript — Accessing functions defined in jQuery scope / ReferenceError setInterval

To trigger a function defined in your document.ready function, you need to define a variable before the $(document).ready() that references the new function.

For example, function test() defined inside $(document).ready() is not accessible with setInterval('test()', 500), or something like onclick="javascript:test()"

$(document).ready( function() {
function test() { alert('test'); }
setInterval("test()", 500);
});

Will fail with ReferenceError

The following will work though:

var test;
$(document).ready( function() {
test = function() { alert('test'); };
setInterval("test()", 500);
});

Will work.