Posts Tagged ‘behaviour’

Change Internet Explorer to open in tabs / Force IE Open Links in new tab

Thursday, November 28th, 2013

Internet-explorer multiple opened windows annoying behaviour fix howto picture

If you have to work on MS Windows 7 / 8 with Internet Explorer for the reason websites you're forced to work are only properly working under IE. This is common in big companies like my employer Hewlett Packard or IBM for instance. You certainly have been annoyed by default Internet Explorer 7 / Internet Explorer 8 or EI 9 behaviour to open each new link in separate Windows. By default normal browsers like Opera, Firefox and Google Chrome does not behave in such irritating ways but open each new link in separate tab. If you're like me used to work most of your life with Firefox, this IE behavior can quickly drive you "crazy" so you will look for fastly to change that abnormal browser actions. What makes things with default IE behavior even more messy is the fact that there are sites which automatically open in Separate tab (for they were javascripted) to do so and ones that open in new Window making the whole browsing experience a "pure windows hell".

Thanks God IE new window page popups can be easily changed

1. Open Internet Explorer and Click on
-> Internet Options

Internet explorer Internet options menu screenshot
(Note: if your version of Internet Explorer is hiding menus press Alt key to make it visualize menus)

In General (tab) select on (Change how webpage is displayed in Tabs) Settings

Internet Explorer internet options change webpage displayed in tabs settings screenshot

3.  Under field When a popup is encountered: Choose radio button of ( Always Open Pop-ups in new tab )

Internet explorer tabbed browser settings Microsoft Windows 8 screenshot

After Apply and OK press finally Pages will start opening in a "human readable" way 🙂 in new Tabs. Hope this hint helps someone. Enjoy 🙂

PHP system(); hide command output – How to hide displayed output with exec();

Saturday, April 7th, 2012

I've recently wanted to use PHP's embedded system(""); – external command execute function in order to use ls + wc to calculate the number of files stored in a directory. I know many would argue, this is not a good practice and from a performance view point it is absolutely bad idea. However as I was lazy to code ti in PHP, I used the below line of code to do the task:

echo "Hello, ";
$line_count = system("ls -1 /dir/|wc -l");
echo "File count in /dir is $line_count \n";

This example worked fine for me to calculate the number of files in my /dir, but unfortunately the execution output was also visialized in the browser. It seems this is some kind of default behaviour in both libphp and php cli. I didn't liked the behaviour so I checked online for a solution to prevent the system(); from printing its output.

What I found as a recommendations on many pages is instead of system(); to prevent command execution output one should use exec();.
Therefore I used instead of my above code:

echo "Hello, ";
$line_count = exec("ls -1 /dir/|wc -l");
echo "File count in /dir is $line_count \n";

By the way insetad of using exec();, it is also possible to just use ` (backtick) – in same way like in bash scripting's .

Hence the above code can be also written for short like this:

echo "Hello, ";
$line_count = `ls -1 /dir/|wc -l`;
echo "File count in /dir is $line_count \n";


Xubuntu improve default picture viewing with gpicview

Tuesday, March 13th, 2012

The default picture viewer on Xubuntu's XFCE is risterroro. Risterroro is quite lightweight, but anyways is lacking even basic functionality with reading a number of pictures in a directory and showing, them one by one lacks any picture automated slider. The lack of picture back/forward functionality makes picture viewing very inconvenient on those Linux distro.

Ristretto Screenshot on Xubuntu Linux Desktop

Thanksfully this kind of unconfortable default behaviour on Xubuntu can easily be changed to use a handy picture viewer program called gpicviewxubuntu-linux:~# apt-get install --yes gpicview

gpicviewer grandmothers screenshot on Xubuntu Linux

Gpicview is a good minimalistic program which has all the functionality of the default GNOME picture viewer program eog – (eye of the Gnome). If you're aaccustomed to GNOME's eog you can always install and use eog instead 🙂

Death Metal singing animals :)

Monday, February 20th, 2012

Alex, just passed me by few funny videos, with "animals singing death metal"

Death Metal Singing Rooster

This Rooster, should definitely contact Six Feet Under (SFU) 's vocalist – Chris Barnes for a solo album 😉

I guess this Camel should start innovative metal music fork to Grind Core or Noise Core metal genre sub-division 🙂

I'm sure you never imagined the donkey could be an awesome Metal singer, Well believe it or not it is a fact the donkey has a talent 🙂

This dog is quite experienced in Death Metal vocalist stage behaviour 😉

There is plenty of other Metal singing animals in Youtube, for more laugh check the related videos. Enjoy ! 🙂

How to make GNOME 3 Desktop icons to work as in GNOME 2 on Debian GNU / Linux

Saturday, February 4th, 2012

If you're using Debian GNU/Linux wheezy/sid, you have already figured out GNOME3 settings to start GNOME in Classic mode (like in GNOME 2), starts gnome in a mode where the desktop is not showing the usual Computer, Home, Trash etc.

Besides that in that strange back-compitability Classic GNOME mode its impossible to add any program as a link in desktop like in the good old GNOME 2.

Thanksfully this abusive behaviour of the backwards compitability mode is easily fixable by two simple steps, here they are:

1. Install gnome-tweak-tool – (Tool to adjust advanced configuration settings for GNOME

root@debian:~# apt-get install gnome-tweak-tool

2. Start gnome-tweak tool

Press ALT+F2 and run gnome-tweak-tool or run it via xterm / gnome-terminal:

moonman@Moon:~$ gnome-tweak-tool

Change in Desktop, Have file manager handle the desktop the settings to ON

gnome-tweek-tool Debian GNU Linux wheezy sid screenshot

gnome-tweak-tool Debian wheezy/Sid GNU Linux screenshot handle desktop on

Once the Screenshot Handle Desktop is set to ON, further drag and dropping any application to the Desktop will be working.
Something really irritating is that launching applications in GNOME 3 does not work properly if you just press ALT+F2 and type in lets say gnome-terminal , to work around this weirdity you will have to install gnome-shell package.

How to make wordpress Update Plugins prompt to permanently store password / Get rid of annoying updates wordpress prompt

Thursday, February 2nd, 2012

I'm managing few wordpress installations which requires me to type in:
Hostname , FTP Username and FTP Password , every single time a plugin update is issued and I want to upgrade to the new version.
Below is a screenshot of this annoying behaviour:

How to get rid of update plugins wordpress username password prompt

As you can see in the above screenshot, there is no way through Update Plugins web interface to store the password permanently. Hence the only option to store it permanently is to manually edit wp-config.php (file located in wordpress docroot, e.g. /path/to/wordpress/wp-config.php , inside the file find the line:

define ('WPLANG', '');

Right after it put a code similar to:

define('FS_METHOD', 'ftpsockets');
define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
define('FTP_USER', 'Username');
define('FTP_PASS', 'Password');
define('FTP_HOST', 'localhost');

Change the above defines:
path/to/wordpress/ – with your wordpress location directory.
Username and Password – with your respective FTP username and password. The localhost

That's all, from now onwards the User/Password prompt will not appear anymore. Consider there is a security downside of storing the FTP User/Pass in wp-config.php , if someone is able to intrude the wordpress install and access the documentroot of the wordpress install he we'll be able to obtain the ftp user/pass and log in the server directly via FTP protocol.

How to block IP address with pf on FreeBSD, NetBSD and OpenBSD

Wednesday, July 27th, 2011

Pf Firewall BSD logo

I’ve noticed some IPs which had a kind of too agressive behaviour towards my Apache webserver and thus decided to filter them out with the Firewall.
As the server is running FreeBSD and my firewall choise is bsd’s pf I added the following lines to my /etc/pf.conf to filter up the abiser IP:

table persist file "/etc/pf.blocked.ip.conf"
EXT_NIC="ml0" # interface connected to internet
block drop in log (all) quick on $EXT_NIC from to any
echo '' >> /etc/pf.blocked.ip.conf

As you see I’m adding the malicious IP to /etc/pf.blocked.ip.conf, if I later decide to filter some other IPs I can add them up there and they will be loaded and filtered by pf on next pf restart.

Next I restarted my pf firewall definitions to make the newly added rules in pf.conf to load up.

freebsd# pfctl -d
freebsd# pfctl -e -f /etc/pf.conf

To show all IPs which will be inside the blockips filtering tables, later on I used:

pfctl -t blockips -T show

I can also later use pf to add later on new IPs to be blocked without bothering to restart the firewall with cmd:

freebsd# pfctl -t blockedips -T add 111.222.333.444

Deleting an IP is analogous and can be achieved with:

freebsd# pfctl -t blockedips -T delete 111.222.333.444

There are also logs stored about pf IP blocking as well as the other configured firewall rules in /var/log/pflog file.
Hope this is helpful to somebody.

How to add sidebar to single.php (Single Posts) to your wordpress blog default theme

Tuesday, April 12th, 2011

Until recently, I have used a default wordpress theme which historically is a bit old and used to be a default theme to the older versions of wordpress.
Since however, I’ve went to many updates and on the other hand I do like and enjoy the template I have decided to continue use it for my blog until this very day.

However this nice theme’s default behaviour is a bit weird, since by default the Single opened posts are configured in a way that the usual index page sidebar is missing.
As in the sidebar there are plenty of navigation buttons and search in the blog button, at a certain moment I have realized it’s probably not a good idea that the single.php (single blog posts) open up with the right sidebar missing.

Thus I’ve decided to put back the missing sidebar in the single posts, with a hope that this will be helpful to my readers and hence have positive impact on the overall blog user experience.

Doing so prooved to be rather easy, here is how I added back the right sidebar to my wordpress single posts :

1. Edit blog/wp-content/themes/default/single.php

debian:~# vim /var/www/blog/wp-content/themes/default/single.php

2. In the single.php look up for the code:

<div id="content" class="widecolumn">

Substitute this html code with:

<div id="content" class="narrowcolumn">

3. Next find the code: <?php get_footer(); ?>

Right before the get_footer(); php function add in the function;

<?php get_sidebar(); ?>

Tadam! Refresh a single post in Firefox and you should see your blog index.php sidebar to show up.