Python script to download Bing’s daily image for Mac

I previously wrote about downloading Bing’s daily image and set it as your wallpaper using PowerShell script. However, if you are a Mac user, this simple Python script will do a similar job.

I have already made the following script an app using Mac Automator. It basically creates a new directory for you, if one does not exist, under your “Pictures” directory called “Bing Wallpapers” and download Bing’s daily image there as “wallpaper.jpg”.

You can save the app in your Applications folder or anywhere you want.
Download app

Or, if you want to edit the script, download the source below and make your own app.
Download script

import urllib2
import json
import datetime
import os.path, time
from os.path import expanduser

#market options: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ
market = 'en-US'
resolution = '1920x1080'
BingDirectory= expanduser("~") +'/Pictures/Bing Wallpaper/'
WallpaperName = 'wallpaper.jpg'

loop_value = 1
while (loop_value == 1):
    try:
		urllib2.urlopen("http://google.com")
    except urllib2.URLError,

Read More

PowerShell script to download Bing’s daily image as a wallpaper

Update: Python way for Mac posted here

There are few ways you can download Bing’s daily image and set it up as your wallpaper. The easiest way at the time of writing this post is to download Bing Desktop program by Microsoft. Or, you can just head over to Bing.com and download the image manually if you do not want to install more bloatware on your computer. Lastly, if you are like me, create a PowerShell script to automate downloading Bing’s daily image for you and set it up as your wallpaper without having to install any programs.

Jump to the script download at the end of this post if you wish to skip all the technical details.

Bing has an XML page that changes daily reflecting the wallpaper name, region, and resolution. Luckily for us, we can have PowerShell parse that XML info and download the Bing image for us.

Read More

HOW-TO: Get Killer Wireless-AC 1525 working with Ubuntu

I recently got a new Alienware 15 laptop that uses the “Killer Wireless-AC 1525” combo wifi/bluetooth card. When I installed Ubuntu 15.04, everything worked right out the box except for Wifi. After countless hours of research and trial and error, I found this launchpad bug here that has the fix:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1383184

Thanks to this fix, it was as easy as just doing a fresh install and then installing this file to get wifi working. Although, the fix requires dkms package installed. Make sure you are either connected with your wired connection to resolve any dependency problems, or download dkms seperately.

Download and install

Download fix and install it with:

sudo dpkg --install ath10k-dkms_1.0_all.deb

Then reboot your system. Once back in, you can verify that wifi is working at the top right. Or, to view all of your detected network cards:

sudo lshw -class network

PS.

Read More

HOW-TO: Enable networking on minimal Linux install – Command line

Whether you are installing a new standalone Linux OS or using VMware, Hyper-V, or Amazon EC2 to install Linux as a guest OS. When you you make a “minimal” Linux install, meaning, no GUI, only install the very basic packages just to get a functional command line. Networking will not be enabled by default. Many may find that very challenging because it is not as easy to just make few clicks with your mouse to configure your ethernet adapter. However, it is really not that difficult to get networking enabled.

First, after you log in as root, browse to “network-scripts” directory

cd /etc/sysconfig/network-scripts/

Type the command ls to display the directory content

ls

Read More

HOW-TO: Install the latest Bugzilla on CentOS

I just went through installing Bugzilla on CentOS at work. I had to follow several guides online in order to get it installed and configured correctly. I thought I combine all of my findings into one simple guide.

I will be installing the latest Bugzilla at the moment which is 4.5.2 on a fresh install of CentOS 6.5 64-Bit.

Ok, Lets get started. Launch Terminal and switch to root:

su

Bugzilla

In order to get Bugzilla up and running, we need to install Apache, MySql, and also gcc for compiling the Bugzilla packages.

Installing Apache

Read More

HOW-TO: View free disk space in Linux

This is very simple yet can be extremely handy to remember. Sometime you just want to launch terminal and view all of your connected devices/harddrives/USB disk space, used space, and free space.

df -h

The -h is to display the info in “Human-readable” format, but in most distros, df and df -h output the same results.

Read More