Thursday, August 29, 2013

Raspberry PI - How to change desktop wallpaper?

When I right click on the desktop, a submenu pops up with these choices: terminal emulator, web browser, desktops, obconf, reconfigure, restart, exit. How can I change the desktop wallpaper? I don't see an option to do this with this submenu?

Normally when you are using Raspbian "wheezy" with the LXDE Desktop Environment Right clicking should pop up:

Create New
Selact All
Invert Selection
Sort Files
Desktop Preferences

If not ?


Open a terminal and enter pcmanfm --desktop-pref.

When the desktop preferences window pops up, click on the "Advanced" tab and deselect "Show menus provided by window managers when desktop is clicked."

That's it and PCManFM File Manager that we had by default is back!

Cisco how to check interface index using snmp

Try command

$ snmpwalk -v2c -c community-string HOST

Outcome will be:

IF-MIB::ifName.1 = STRING: Fa0
IF-MIB::ifName.2 = STRING: Fa1
             This -^- is the interface-number

so when using for example nagios plugin check_itraffic use this number as interface parameter

[SOLVED ]Nagios / Cenreon This plugin must be either run as root or setuid root.

 Warning: This plugin must be either run as root or setuid root. 
To run as root, you can use a tool like sudo. 
To set the setuid permissions, use the command: 
chmod u+s yourpluginfile 

1. chown root:nagios check_dhcp
2. chmod u+s check_dhcp 
some plugins needs chown apache:nagios 
(otherwise plugin`s outcome is out of bounds 255)

Wednesday, August 28, 2013

Colored bash in CentOS

The following is ripped from the Gentoo /etc/bash/bashrc with minor modifications for slight differences in CentOS:

# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS.  Try to use the external file
# first to take advantage of user additions.  Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
[[ -z ${match_lhs}    ]] \
    && type -P dircolors >/dev/null \
    && match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true

if ${use_color} ; then
    if [[ ${EUID} == 0 ]] ; then
        PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
        PS1='\[\033[01;32m\]\[email protected]\h\[\033[01;34m\] \w \$\[\033[00m\] '
    if [[ ${EUID} == 0 ]] ; then
        # show [email protected] when we don't have colors
        PS1='\[email protected]\h \W \$ '
        PS1='\[email protected]\h \w \$ '

unset use_color safe_term match_lhs
This script should be run after /etc/bashrc is run. Specifically, it depends on COLORS being set. This is done in /etc/profile.d/, which is sourced at the end of /etc/bashrc. One could put this in the users .bashrc after /etc/bashrc is sourced, or, for new users, in /etc/skel/.bashrc.

found at:

Tuesday, August 27, 2013

Disable Ads on YouTube With This Simple Command

There are a lot of ways to block ads, but with a simple command in the developer console, you can disable all ads on YouTube via an experiment.
Google frequently tries out new features with experiments via TestTube. A less advertised experiment can disable all ads on the site. Here's how to turn it on:
  1. Open up a YouTube video (any will do).
  2. Open up the developer console (Ctrl-Shift-J for Chrome, Ctrl-Shift-K for Firefox)
  3. Enter the following code:
document.cookie="VISITOR_INFO1_LIVE=oKckVSqvaGw; path=/;";window.location.reload();

Boom. No more ads. Since this is something that Google is allowing, it's possible it could go away in the future, but while it works, you get a lovely ad-free viewing experience without any plugins. It even works on those pesky video ads.

Monday, August 26, 2013

Unable to load dynamic library '/usr/lib/php/modules/'

When I run command
php -v

this error come up
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/' - /usr/lib/php/modules/ cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.3.3 (cli) (built: Feb 22 2013 02:37:06)


This is cause by mcrypt extension.
Edit /etc/php.d/mcrypt.ini
and change
; Enable mcrypt extension module
to this
; Enable mcrypt extension module
found at

Monday, August 5, 2013

Increasing the size of a virtual disk vmware on guest CentOS

  1. Power off the virtual machine.
  2. Edit the virtual machine settings and extend the virtual disk size. 
  3. Power on the virtual machine.
  4. Identify the device name, which is by default /dev/sda, and confirm the new size by running the command:# fdisk -l
  5. Create a new primary partition:
    1. Run the command:# fdisk /dev/sda (depending the results of the step 4)
    2. Press p to print the partition table to identify the number of partitions. By default there are 2: sda1 and sda2.
    3. Press n to create a new primary partition. 
    4. Press p for primary.
    5. Press 3 for the partition number, depending the output of the partition table print.
    6. Press Enter two times.
    7. Press w to write the changes to the partition table.
  6. Restart the virtual machine.
  7. Run this command to verify that the changes were saved to the partition table and that the new partition has an 83 type:

    # fdisk -l
  8. Run this command to convert the new partition to a physical volume:

    # pvcreate /dev/sda3
  9. Run this command to extend the physical volume:

    # vgextend VolGroup00 /dev/sda3

    Note: To determine which volume group to extend, use the command vgdisplay.
  10. Run this command to verify how many physical extents are available to the Volume Group:# vgdisplay VolGroup00 | grep "Free"
  11. Run the following command to extend the Logical Volume:

    # lvextend -L+#G /dev/VolGroup00/LogVol00

    Where # is the number of Free space in GB available as per the previous command.

    Note: to determine which logical volume to extend, use the command lvdisplay.
  12. Run the following command to expand the ext3 filesystem online, inside of the Logical Volume:

    # ext2online /dev/VolGroup00/LogVol00
    Note: Use resize2fs instead of ext2online if it is not a Red Hat virtual machine.
  13. Run the following command to verify that the / filesystem has the new space available:

    # df -h 


Internet Storm Center Infocon Status

Internet Storm Center Infocon Status
Internet Storm Center Infocon Status