Month: March 2013

Time to Clean Up: Out of Space for New Kernels

This past update, I started getting a new error.  My /boot mount was full.  The problem was that I had 6 or 7 previous kernels still in the mount taking up space.

Boot Mount Full Message

I was able to fix it with a command written by Linerd.  He did a very nice job explaining it, so I would recommend that you follow through and read his post.

To make a long story short, I first ran the trial command:

[sourcecode]

dpkg -l linux-* | awk ‘/^ii/{ print $2}’ | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get –dry-run remove

[/sourcecode]

Then, I ran the full command (without the –dry-run):

[sourcecode]

dpkg -l linux-* | awk ‘/^ii/{ print $2}’ | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge

[/sourcecode]

Now, I am good to go!  Thanks Linerd.

Resources

Too Many Inodes

I recently switched to Host Gator, and they have policy about the number of inodes.  I just noticed that my account moved to “Not Backed Up” just recently.  So, I thought I would blog a few of the things I learned while exploring…

Determining the Number of Inodes in a Directory

I found this command would do the trick:

[sourcecode language=”bash”]find . -printf "%i\n" | sort -u | wc -l[/sourcecode]

One of the advantages of Host Gator is that they provide SSH access.  I was able to login quickly and run the command in the different directories.  If you have a host that doesn’t offer SSH access, may I suggest PHP Shell?

Git Repositories

I had a rough guess that my git repositories might be part of the culprit.  If it’s based on the number of files, I guessed that git uses a bunch to track changes.  So, I did a little tinkering.

Sure enough, most of the inodes in my project are in the .git directory:

[sourcecode language=”bash”]

$ find . -printf "%i\n" | sort -u | wc -l
2050
$ find .git -printf "%i\n" | sort -u | wc -l
1195

[/sourcecode]

I found a few options to try.  First, I tried the fsck command, but that didn’t seem to make a difference in the inodes:

[sourcecode language=”bash”]

$ git fsck –full
Checking object directories: 100% (256/256), done.
dangling commit 9e18c6e42e3f62127776bdd2f52608f904991e08
$ find .git -printf "%i\n" | sort -u | wc -l
1195[/sourcecode]

Next, I tried the gc command, and that seemed to make all the difference in the world:

[sourcecode language=”bash”]# git gc –prune=today –aggressive
Counting objects: 912, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (900/900), done.
Writing objects: 100% (912/912), done.
Total 912 (delta 525), reused 0 (delta 0)
$ find .git -printf "%i\n" | sort -u | wc -l
37[/sourcecode]

The repack didn’t do much:

[sourcecode language=”bash”]# git repack
Nothing new to pack.
$ find .git -printf "%i\n" | sort -u | wc -l
37[/sourcecode]

WordPress Cache

My next culprit is the WordPress Cache.  For example, on one of my blogs, the cache accounts for 76% of the inode count.

[sourcecode language=”bash”]

$ find . -printf "%i\n" | sort -u | wc -l
23323
$ find wp-content/cache/ -printf "%i\n" | sort -u | wc -l
17766[/sourcecode]

Well, that is another task for another day.  This is where I will start though.  If you have any ideas, please comment.

Resources

Great Link: CDN for Angular, Bootstrap, etc.

I was looking for a CDN to use with Bootstrap and Angular, and I found a great resource.  CDNjs.com ended up doing the trick.  I also learned that you can discover many great Javascript libraries and projects by going through the offerings of different CDNs.  So, with that being said, here is a list of the CDNs that  I discovered:

Just to give you an idea of what I ended up with, here’s part of the <head> of my project.  I used the head javascript library for most of the javascript:

[sourcecode language=”javascript”]
<head>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css" rel="stylesheet">

<script src="//cdnjs.cloudflare.com/ajax/libs/headjs/0.99/head.min.js"></script>
<link type="text/css" href="css/devtools.css" rel="stylesheet" />

<script>
head.js(
//  https://groups.google.com/forum/?fromgroups=#!topic/ace-discuss/rNckG17-7ac
//  http://stackoverflow.com/questions/5733275/chrome-uncaught-syntax-error-unexpected-token-illegal
"//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js",
"//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js", 
"//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js", 
"//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.min.js",
"js/app.js",
function() {
/* My initialization … */
}
);
</script>
[/sourcecode]

If you know of a CDN that I missed, please comment below!

Resources

Google Voice Voicemail Rings

I have really enjoyed using the Google Voice option for voicemail on my cell phone.  The cool part is that it sends me an email with the voicemail message.  The message is attached in sound form and it also makes an attempt to do voice recognition.  The one disadvantage is that it rings way too many times.  Some people give up on leaving a message because it rings so many times.  Well, thanks to Evan Wondrasek, I found a fix!

Here’s the original article:

Techorator: How to Prevent Extra Rings using Google Voice as Voicemail

Read More