World Cup Final Match

I like  the batting of Dhoni very much under the pressure when we have lost the two early wickets, I also like the batting of Gautam Ghambir very much under pressure. In the last it was  the effort of Gautam Ghambir, Dhoni that we can win the world cup after 28th Years. The sri lankan player Mahela Jaywardene batting was very good, he has scored a century, But when the batting of India started, I got very tense as when the sehwag  got out on the second ball , when Lastin Malinga bowled him leg before wicket, but in the end I got very happy with the performance of Dhoni & Ghambir that because of them we had won the World cup after 28th years. I also enjoyed the speech of Tendulkar,Yuvraj and Virat Kohli very much after winning the World Cup.

REFRESH YOUR MAC DESKTOP WITH BING HOMEPAGE

Everyone would agree that Bing Homepage Wallpaper are cool and refreshing daily. If you are on Mac you would be little jealous with Windows 8 desktop Wallpaper, which are refreshed on daily basis. Well, after looking around, I got the solution which refreshes your Mac desktop with Bing Daily Homepage.

1. Create a shell script file, bing-wallpaper.sh (you can rename it whatever you want):

#!/usr/bin/env bash

PICTURE_DIR="$HOME/Pictures/Bing-Wallpapers"

mkdir -p $PICTURE_DIR

# Picks
# urls=( $(curl -s http://www.bing.com | \
#     grep -Eo "url:'.*?'" | \
#     sed -e "s/url:'\([^']*\)'.*/http:\/\/bing.com\1/" | \
#     sed -e "s/\\\//g") )

urls=( $(curl -s http://www.bing.com | \
    grep -Eo "g_img={url: \".*?\"" | \
	sed -e "s/g_img={url: \"//g" | \
	sed -e "s/\"//g") )

if [ "$urls" = "" ]
then	
	urls=( $(curl -s http://www.bing.com | \
    	grep -Eo "g_img={url: \".*?\"" | \
		sed -e "s/g_img={url: \"\([^\"]*\)\".*/http:\/\/bing.com\1/" | \
		sed -e "s/\\\//g") )
fi

if [ "$urls" != "" ]
then
	
	if [[ $urls = //* ]]
	then
		urls="http:$urls"
	elif [[ $urls != http* ]]
	then
		urls="http://www.bing.com$urls"
	fi

	rm -Rf $PICTURE_DIR/*.*

#	Use this for today's Bing Wallpaper	
	filename=$(echo $urls|sed -e "s/.*\/\(.*\)/\1/")
	# echo $urls
	# exit 0
	curl -Lo "$PICTURE_DIR/$filename" $urls
		
#	Use this for today's and next day's Bing Wallpaper 
#		
#	for p in ${urls[@]}; do
#    	filename=$(echo $p|sed -e "s/.*\/\(.*\)/\1/")
#    	if [ ! -f $PICTURE_DIR/$filename ]; then
#        	echo "Downloading: $filename ..."
#        	curl -Lo "$PICTURE_DIR/$filename" $p
#    	else
#        	echo "Skipping: $filename ..."
#    	fi
#	done

	killall Dock
	exit 0
fi

exit 99

2. Provide execute rights on this file

chmod +x /Applications/Custom\ Apps/bing-wallpaper.sh

3. Create launchd scheduled job (com.yourname.bing-wallpaper.plist file) to run it every morning 7 AM and execute our shell script (create in Step #1)

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Label</key>
   <string>com.yourname.bing-wallpaper</string>
   <key>ProgramArguments</key>
   <array>
      <string>/bin/bash</string>
      <string>/Applications/Custom Apps/bing-wallpaper.sh</string>
   </array>
   <key>LowPriorityIO</key>
   <true/>
   <key>Nice</key>
   <integer>1</integer>
    <key>KeepAlive</key>
    <dict>
        <key>SuccessfulExit</key>
        <false/>
    </dict>
    <key>RunAtLoad</key>
    <true/>
    <key>StartCalendarInterval</key>
    <dict>
      <key>Hour</key>
      <integer>7</integer>
      <key>Minute</key>
      <integer>0</integer>
    </dict>  
</dict>
</plist>

4. Copy this file to $HOME/Library/LaunchAgents folder

cp /folder/location/of/com.yourname.bing-wallpaper.plist $HOME/Library/LaunchAgents

5. Generally launchd load these jobs on login but you can load it manually

launchctl load $HOME/Library/LaunchAgents/com.yourname.bing-wallpaper.plist

If required, you can disable this job using following command –

launchctl unload $HOME/Library/LaunchAgents/com.yourname.bing-wallpaper.plist

You can find the status of job using the following command –

launchctl list | grep com.yourname

CHECK YOUR SERVER AGAINST OPENSSL HEARTBLEED

Heartbleed is one of the biggest security flaw, silently infecting thousands of web sites including Yahoo! As per reports, within OpenSSL (from v1.0.1 to v1.0.1f), this bug named as Heartbleed, can give access to 64K of memory of your server to any connected client. This bug was exposed to hackers since December 2011 and does not leave any trace on servers to let system administrators know whether security has been compromised or not.

Google Security’s Neel Mehta found this bug and reported to OpenSSL team, which had released a quick patch to fix this issue.

You can test whether your server is infected or not from this site –

http://filippo.io/Heartbleed

Just another blog!