RSS Feed
Jul 14

Last.fm Records with Absynthe theme (latest version breaks it)

Posted on Tuesday, July 14, 2009 in linux, theme fix, wordpress

Hey everyone.

So my Last.fm records plugin that is built-in or implemented with this amazing theme broke after I upgraded it, so I checked and it seems the whole plugin is now using jQuery. I have had to do some modifications to make it work, I hope this helps.

FIrst, you need to add this in your wp-content/themes/absynthe/header.php right after <![endif]-->.

<script type='text/javascript' src='/wp-includes/js/jquery/jquery.js'></script>

After that, you need to edit wp-content/themes/absynthe/footer.php and replace this:

if (function_exists('lastfmrecords_display')) {
lastfmrecords_display();
}
?>

By this:

<div id="lastfmrecords"></div>

Once you’ve made those changes, go to Settings > Last.fm Records, make sure that the CSS is disabled else it won’t look pretty and make sure the placeholder is set to “lastfmrecords”.

Enjoy :)

I will let the developer of this theme know so he can fix this too.

Jul 14

Small application for disabling mod_security for specific domains on cPanel server

Posted on Tuesday, July 14, 2009 in cpanel, linux, mod_security, script

Alright, I’m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.

This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it’s pretty annoying to do the same work all over and over again, why not make it one line only. :)

Introducing, disable_modsec — Enjoy lazy cPanel server admins.

#!/usr/bin/perl

use strict;
use lib qw(/usr/local/cpanel);
use Cpanel::AcctUtils::DomainOwner;

if ($ARGV[0])
{
# Get username
my $username = Cpanel::AcctUtils::DomainOwner::getdomainowner($ARGV[0]);
my $domain = $ARGV[0];

# Create directory for config
system ('mkdir -p /usr/local/apache/conf/userdata/std/2/'.$username.'/'.$domain);

# Create config file
open (CONFIG, ">>/usr/local/apache/conf/userdata/std/2/".$username.'/'.$domain.'/modsec.conf');
print CONFIG "\nSecRuleEngine Off\n";
close CONFIG;

# Enable vHost includes
system ('/scripts/ensure_vhost_includes --user='.$username);
} else {
print("Usage: disable_modsec [domain]\n");
}

Jul 11

Little “makeover” to this blog

Posted on Saturday, July 11, 2009 in Uncategorized

K2 was getting boring and I have nothing to do on a Saturday evening.

This blog looks much better thanks to the awesome Absynthe theme by Chris Wallace who makes awesome wordpress themes (there’s some free SEO for you ;)

Also, he had implemented Last.FM & Twitter integration that’s very prettttttty. Thanks! ;)

Jul 2

Useful little bit of code – List all domains on cPanel server

Posted on Thursday, July 2, 2009 in cpanel

Need to list all domains on the server (no subdomains, etc)?

Here’s the magical code:

cat /etc/userdomains | awk -F ':' '{ print $1 }' | sed 's/.*\.\(.*\.\)/\1/' | sort -u