Category Archives: General

Default category for all posts.

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" | \
	sed -e "s/\\\u0026/\&/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" | \
		sed -e "s/\\\u0026/\&/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

Google Nose – Google’s April Fool 2013 prank

It’s April 1st and Google has launched there April Fool’s prank, Google Nose…Beta.

Every year on April 1st, Google launches a prank product whereas few of those pranks became reality something like Gmail, Google Fibre, etc. This year Google has launched a new prank Google Nose. It searches based on smells and can also tell you how a stuff or thing smells like. Well, it is gonna realize in future as one of the product….who knows.

For now enjoy the video –

[youtube=http://www.youtube.com/watch?feature=player_embedded&v=9-P6jEMtixY&w=540&h=330]

Read more…