Install and uninstall gnome shell extensions

Install:

sudo apt-get install chrome-gnome-shell

Now go to https://extensions.gnome.org/
Install required extensions after downloading the browser extension. In case of firefox, you may need to disable extension compatibility checking.
You can control extensions and their settings from gnome-tweak-tool

In case of serious issues preventing booting:

apt-get install --reinstall gdm3 gnome gnome-shell

You may also want to move everything from ~/.local/share/gnome-shell/extensions

The lower left corner legacy icons are an irritation. To move them, install the GNOME shell extension TopIcons. This moves the legacy tray icons shown in this bar to the main GNOME bar, up in the top right by the menu.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Extracting audio track from youtube video

youtube-dl -F www.youtube.com/watch?v=Ao6gQ3VzWbM

format code extension resolution note
140 m4a audio only DASH audio 132k , m4a_dash container, aac @128k (44100Hz), 79.72MiB
171 webm audio only DASH audio 133k , [email protected] (44100Hz), 66.18MiB
141 m4a audio only DASH audio 260k , m4a_dash container, aac @256k (44100Hz), 160.03MiB

avconv -ss 00:40:00 -i in.m4a -vn -c copy -t 2:00:00 out.m4a

To cut from 00:40:00 to the end (2:00:00)


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Run php files without typing in the extension in apache

On i-mscp, edit the file /etc/apache2/sites-available/domain.com.conf,

Modify:

<Directory /var/www/virtual/joel.co.in/htdocs>
        Options -Indexes +Includes +FollowSymLinks +MultiViews
        # SECTION php_enabled BEGIN.
        AllowOverride All
        # SECTION php_enabled END.
        Order allow,deny
    Allow from all
    </Directory>

adding the following:

Options +MultiViews
DirectoryIndex index.php
AddType application/x-httpd-php .php

so that final code becomes:

 <Directory /var/www/virtual/joel.co.in/htdocs>
        Options -Indexes +Includes +FollowSymLinks +MultiViews
        DirectoryIndex index.php
        AddType application/x-httpd-php .php
        # SECTION php_enabled BEGIN.
        AllowOverride All
        # SECTION php_enabled END.
        Order allow,deny
    Allow from all
    </Directory>

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

How to install php-clamav

First download, build and install clamav. I found that Debian Squeeze’s clamav in the apt package was not detected by the php-clamav installation script.

So:

wget http://downloads.sourceforge.net/clamav/clamav-0.97.6.tar.gz
tar -xvvf clamav-0.97.6.tar.gz
cd clamav-0.97.6
./configure
make
make install

Now download , build and install php-clamav

wget http://nchc.dl.sourceforge.net/project/php-clamav/0.15/php-clamav_0.15.7.tar.gz
tar -xvvf php-clamav_0.15.7.tar.gz
cd php-clamav-0.15.7/
phpize
./configure --with-clamav
make
make install

Once installed, you need to enable php-clamav.

First edit the clamav configuration file:

emacs /usr/local/etc/clamd.conf

Read the file and set your options. At the bare minimum, you need to comment out this line:

Example

So it reads this:

#Example

Now run clamscan and test that it works:

[[email protected]] /etc/php5/conf.d #clamdscan -V
ClamAV 0.97.6

If there’s an issue with the configuration, at this point it will notify you to correct it. If everything is alright, it will report the version.

Now you need to setup so that clamav php extension loads up whenever the web server is loaded.

Create a new text file in /etc/php5/conf.d/clamav.ini with the following content:

extension=clamav.so

Now restart apache2 on the webserver and load a php file with the function phpinfo (assuming it is enabled on your server of course). You can confirm that the extension is loaded by the fact that phpinfo reports a whole new section for clamav (Just use the search option on the page).


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Bash script for splitting a filename, extension and path from fullpath

Call the function split_filenames with the first argument as the full filename with path. Alternately, set the variable fullfile to this value.

#!/bin/bash

split_filenames() {
# echo "Called with Arg: $1"
if [ ! "$1" = "" ]
then
fullfile=$1

fi
# echo I got this filename for processing $fullfile
filename=$(basename "$fullfile")
fname=$(basename "$fullfile")
nameonly=${filename%.*}
ext=${fname##*.}

echo "filename $filename"

filename=${fullfile%.*}
pathonly=${fullfile%/*}

if [ "$pathonly" = "$fullfile" ]
then
pathonly="$pat"
fi

echo "Path $pathonly"
echo "Name $nameonly"

chkper=$(echo $fullfile | grep -c "\.")
# echo "Number of periods:$chkper"

if [ ! "$chkper" = "0" ]
then
echo "Extension $ext"
else
echo "No extension"
fi

#out_file=$pathonly/$nameonly"_signed."$ext

}

for i in ~/Dropbox/SSH\ Keys/*
do
echo
echo Path and Name: $i
split_filenames "$i"
#cp "$i" testssh/
done[/code]
In the example, the main event calls the function from a loop which cycles through all the files in the specified directory.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Google Adsense Classic view does not load

The most common reason is running the Adblock plus extension. Disable Adblock plus for the particular site.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.