Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Sunday, July 3, 2011

Google +1 Button in your site

Implement +1 button to your website

The implementation button is simple. You just need to insert two line of codes to your HTML or theme file.
1. Insert the following javascript code to your  tag
<script type="text/javascript" src="http://apis.google.com/js/plusone.js">script>
2. Insert the following tag to the place where you want the button to appear.
That ‘s it.
For WordPress
As of this post, there are no plugins for adding the +1 button yet (but I am sure it will be available very soon). To add the +1 button, in your themes folder, open the header.php file. Insert the javascript code to the  tag
Open your single.php or index.php, and place the  to the place where you want it to appear.
plus1-button-code

Parameter

There are several parameters that you can use.
Size of the button: The default is “standard“, which is 24px tall. You can choose “small” (15px), “medium” (20px) or “tall” (60px).
Include count: The default is set to “true”. You can turn it off if you don’t want the +1′d count to appear.
URL (href): By default, the button will grab the URL of the existing page, but you can specify your own URL with the parameter href="your-url-here".

http://maketecheasier.com/add-google-1-to-website/2011/06/02
Source: 

Thursday, June 23, 2011

Disabling / Enabling Keyboard and Mouse in Linux (Xinput)

http://wpkg.org/Disable_/_enable_keyboard_and_mouse_in_Linux


Here is how to do it:
  • First, list the devices your X sees:
$ xinput --list
"Virtual core pointer"  id=0    [XPointer]
"Virtual core keyboard" id=1    [XKeyboard]
"Keyboard2"     id=2    [XExtensionKeyboard]
"Mouse2"        id=3    [XExtensionKeyboard]

  • Now, list details for the mouse (id=3):
$ xinput --list-props 3
Device 'Mouse2':
        Device Enabled (119):   1
        Evdev Reopen Attempts (254):    10
        Evdev Axis Inversion (257):     0, 0
        Evdev Axis Calibration (258):   
        Evdev Axes Swap (259):  0
        Evdev Middle Button Emulation (260):    2
        Evdev Middle Button Timeout (261):      50
        Evdev Wheel Emulation (262):    0
        Evdev Wheel Emulation Axes (263):       0, 0, 4, 5
        Evdev Wheel Emulation Inertia (264):    10
        Evdev Wheel Emulation Timeout (265):    200
        Evdev Wheel Emulation Button (266):     4
        Evdev Drag Lock Buttons (267):  0

  • Disable the mouse:
$ export DISPLAY=:0
$ xinput set-int-prop 3 "Device Enabled" 8 0

  • Enable the mouse again:
$ xinput set-int-prop 3 "Device Enabled" 8 1

  • Disable the keyboard:
$ xinput set-int-prop 2 "Device Enabled" 8 0

  • Enable the keyboard again:
$ xinput set-int-prop 2 "Device Enabled" 8 1

  • You may find more details in "man xinput".

Wednesday, May 25, 2011

SSH Socks Proxy


$ssh -D 9999 username@ip-address-of-ssh-server


Listens to Port 9999 and tunnels the connection via the ssh-server connected

Tuesday, May 17, 2011

base_url() function for php



function base_url(){
    $pathinfo = pathinfo($_SERVER["SCRIPT_NAME"]);
    $dirname = $pathinfo["dirname"];
    if($_SERVER["HTTPS"] == "on"){
    $protocol = "https";
    }else{
        $protocol = "http";
    }
    $base_url = $protocol."://".$_SERVER["HTTP_HOST"].$dirname."/";
    return $base_url;
}

Thursday, May 12, 2011

Thursday, January 6, 2011

Adding network printer in linux

$ lpadmin -p some-printer-name -E -v ipp://network-ip-address/printers/printer-name

forexample
$ lpadmin -p LBP3050_on_server -E -v ipp://192.168.144.1/printers/LBP3050

Local printer alias - LBP3050_on_server
Server 192.168.144.1
Server Printer - LBP3050
Your Ad Here