Posted in Linux
Pidgin Attention button successfully hidden
Pidgin Attention button successfully hidden

Ever since the developers added the Attention button to Pidgin, one of the most common questions asked is how to remove it. I finally set some time aside to answer this question.

  • Download the plugin that does exactly this from the Pidgin developer page.
  • Install the Pidgin developer dependencies if you haven’t already:
    sudo apt-get install ubuntu-dev-tools subversion g++ pidgin-data libpurple0 libpurple-dev pidgin-dev libgtk2.0-dev

    This step is important or you’ll receive errors like the following:

    $ make
    [CC] hide_attention_button.o
    Package pidgin was not found in the pkg-config search path.
    Perhaps you should add the directory containing `pidgin.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'pidgin' found
    Package purple was not found in the pkg-config search path.
    Perhaps you should add the directory containing `purple.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'purple' found
    Package gobject-2.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `gobject-2.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'gobject-2.0' found
    Package gtk+-2.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `gtk+-2.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'gtk+-2.0' found
    hide_attention_button.c:24:20: fatal error: plugin.h: No such file or directory
    compilation terminated.
    make: *** [hide_attention_button.o] Error 1
  • Drop the .c and Makefile into a folder and in a terminal run the following commands:
    make
    sudo make install

    If all went well you’ll see:

    $ make
    [CC] hide_attention_button.o
    [SHLIB] hide_attention_button.so
    $ sudo make install
    mkdir -p /`pkg-config --variable=prefix purple`/lib/purple-2
    install hide_attention_button.so /`pkg-config --variable=prefix purple`/lib/purple-2

Restart pidgin and enable the plugin under Tools – Plugins – Hide Pidgin Attention Button.

Close but not Perfect

Although this plugin really does hide your Attention button, it still exists if you hover over where it used to be:

The button is much smaller but still clickable
The button is much smaller but still clickable

At least it’s much smaller now and less likely to be accidentally clicked!

Read More »

Posted (Updated ) in Linux

Tonight I discovered I had an entire folder of dual audio MKV files with the wrong default language and wrong default subtitle track. I could have used mkvpropedit to manually change each file but that’s such a hassle. Instead, here’s a handy one-liner to do them all at once:

1
find . -name "*.mkv" -exec mkvpropedit {} --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1 --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1 \;

 

Explanation

At first glance they may look a bit complicated, but let’s break it down a bit:

Find all .mkv files and execute an operation on them:

1
find . -name "*.mkv" -exec ... \;

Do an mkvpropedit on the current matched file:

1
mkvpropedit {}

Set the first audio track to not be default, the second audio track to be default, and do the same with the subtitle tracks:

1
2
3
4
--edit track:a1 --set flag-default=0
--edit track:a2 --set flag-default=1
--edit track:s1 --set flag-default=0
--edit track:s2 --set flag-default=1

 

You’ll need mkvtoolnix installed for the mkvpropedit command. To determine what the various tracks contain, do a

1
mkvinfo /path/to/file.mkv

or mkvinfo -g for you GUI users 🙂 This can be a bit tricky to read though so I tend to just open the file in VLC and look at the audio and video tracks that way.

As an added bonus, here’s the Windows equivalent of the above script:

1
2
3
4
5
6
7
8
9
@echo off
FOR /f "tokens=*" %%G IN ('dir /a-d /b') DO (
	mkvpropedit.exe "%%G" --edit track:2 --set flag-default=0
	mkvpropedit.exe "%%G" --edit track:3 --set flag-default=0
	mkvpropedit.exe "%%G" --edit track:4 --set flag-default=1
	mkvpropedit.exe "%%G" --edit track:5 --set flag-default=0
	echo.
)
pause

I’ve been told the Windows version works but haven’t tested personally.

Happy viewing!

Read More »

Posted (Updated ) in Database, Linux, PHP

Tonight I had to move my WPMU install from my local development machine to the live server – this meant a change in installation path which is always a hassle with WordPress. Below I’ll detail my issues and the corresponding fixes in the hopes it will make life easier for others experiencing the same problems.

Redirection to wp-signup.php

First thing I noticed was that when loading the site on a live domain, I’d get instantly redirected to mydomain.com/wp-signup.php?new=mydomain.com. With a bit of Googling I came across this forum thread which recommended adding the following to my wp-config.php:

1
2
define( 'NOBLOGREDIRECT', '' );
define( 'SUBDOMAIN_INSTALL', false );

Don’t do this! It will get the site closer to working order but it’s not going to help you in the long run – especially when you need the other domains working too. Instead here’s what you should be doing:

1
2
3
4
5
6
7
#Dump your DB
mysqldump - u<username> -p<password> -h<host> <dbname> > test.sql
 
#Update folder path to that of the new servers
sed -i "s/path\/to\/install/new\/path\/to\/install/g" test.sql 
#If you installed into localhost/foo/bar/mysite, change that to your live servers domain
sed -i "s/url\/path\/to\/site/www\.domain\.com/g" test.sql

This is pretty standard behavior for moving WordPress sites, however if you load the above dump up on your live domain you’ll probably be greeted with the dreaded Error establishing a database connection.

Error establishing a database connection

Heading to www.domain.com/wp-admin will shed a little more light on the situation – you need to update your wp_blogs table for the main site. WPMU is currently using your development servers URL from this table and ignoring what’s in wp-config.php. To play things safe we’ll update any occurrances of our test servers domain in test.sql:

1
2
#Update your live servers subdomain in wp_blogs to your live servers domain
sed -i  "s/yoursite\.localhost\.com/www\.yourdomain\.com/g" test.sql

This should do the trick. Load that bad boy into your live server and you should be good to go!

Read More »

Posted (Updated ) in Linux

For users not running Bumblebee or Ironhide, you’ve probably noticed alot of heat, low battery life and a roaring fan even when idle. This is almost entirely due to the nVidia graphics card. If you’re like me and don’t need that card at all, you have the option of disabling it entirely. To do so you’ll need to install acpi_call as a kernel module and use it to shut the GPU down.

Read on for a tutorial on how. I’ve also included some bonus Intel GPU tweaks!

Read More »

Posted in Linux, PHP

After upgrading to 11.10 recently, I occasionally noticed fuser firing up and using between 70% and astoundingly 9999% CPU. Googling the issue led me to this post with the solution.

As user grazer explains:

We have the same problem. This is the content of /etc/cron.d/php5 on 11.10:

09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete

And this is the content on 11.04:

09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete

Spot the difference?

The 11.10 version runs fuser for each PHP session file, thus using all the CPU when there are hundreds of sessions.

After commenting out the 11.10 line and replacing with the 11.04 equivalent, this problem was solved for me aswell. Thanks, grazer!

You can also check out the bug report to keep up to date on this issue. Hopefully a fix will be released quickly.

Read More »

Posted (Updated ) in Linux

Note: Also see the prequel to this post: Why I Hate Unity

As your typical Ubuntu user, I find Unity infuriating and have devoted countless hours towards bringing back the usability and functionality that came with Gnome 2. I’ve racked up quite a few tweaks so far that have gone a long way towards doing this and figured it was about time to share them. My aim was to make 11.10 look and feel exactly like 10.10. I’ve attached below a screenshot of the final result.

11.10 with Gnome Session Fallback
11.10 with Gnome Session Fallback

Read More »

Posted in Linux

I was receiving a 500 internal server error on one of my CPanel sites earlier tonight but the apache error logs in CPanel admin for that user showed nothing. Instead, I had to locate the global apache error logs. This information may help others so I’ve listed some of the most useful CPanel/WHM log file locations below:

Apache Logs

General Error and Auditing Logs:
Location : /usr/local/apache/logs/error_log
Description : All exceptions caught by httpd along with standard error output from CGI applications are logged here..
The first place you should look when httpd crashes or you incur errors when accessing website.

Domain Access Logs:
Location : /usr/local/apache/domlogs/domain.com
Description : General access log file for each domain configured with cPanel.

Apache Access Logs:
Location : /usr/local/apache/logs/access_log
Description : Complete web server access log records all requests processed by the server.

MySQL Logs

MySQL General Information and Errors:
Location : /var/lib/mysql/$(hostname).err
Description : This path could vary, but is generally located in /var/lib/mysql. Could also be located at /var/log/mysqld.log

 

For more log file locations, there are some great forum posts here and here.

Read More »

Posted (Updated ) in Linux, PHP

I’ve was playing with EasyApache in a WHM install recently and after the upgrade I came across a strange error:

SoftException in Application.cpp:357: UID of script "/home/mysite/public_html/index.php" is smaller than min_uid
Premature end of script headers: index.php

Turns out this error is caused by apache being unable to read files added by root to a users public_html folder. A simple fix for this problem is to

chown -R mysite:mysite /home/mysite/public_html

Thanks to user ronniev of eukhost forums for his solution here.

Read More »

Posted (Updated ) in Linux

One of my favourite plugins for GEdit2 was tabswitch. It made GEdit more consistant with browsers by allowing it to switch tabs with CTRL+Tab instead of CTRL+PgUp/Down. Ubuntu 11.10 comes with Gedit 3 and the plugin no longer worked – so I rewrote it!

This plugin will let you use CTRL+Tab to switch between tabs in GEdit 3. You can download a working implementation here.

Install it by copying the files into ~/.local/share/gedit/plugins directory (which doesn’t exist by default) or /usr/lib/gedit/plugins if you want it to work for all users. Remember to enable the plugin in Edit – Preferences – Plugins for it to work!

Read More »

Posted (Updated ) in Database, Linux

I’ve been using my Cloud Database Backup script for a few months now for weekly scheduled backups of my MySQL databases to Google Docs. Everything has been going smoothly, however I’m starting to run low on quota. For this reason I decided to look into splitting the SQL dumps into chunks small enough to be convertible and doing an upload-convert rather than a zip upload which will result in literally unlimited, quote free database backups as frequently as I like! The focus of this post though is the actual splitting script which splits a given MySQL dump into chunks of x characters.

As always, download it here.

Read More »