Mobile WebApp Frameworks
So I went digging for mobile webapp frameworks, and I found a nice list to investigate at a later time. While I have used iUI in the past, and it worked well for my purposes… I have read a few reasons why you may consider others (CiUI). Also, I seem to think that there would be some obvious advantages (and disadvantages) to using a cross-platform mobile webapp framework like PhoneGap and others.
Here the list I came up with:
Update (2010-08-13). I just found this article: Announcing the jQuery Mobile Project
Once they get up and running, I imagine it will be a serious contender with the others.
Update (2010-08-18). Here’s an article from Mashable about some of the frameworks and libraries talked about above (and others): HOW TO: Make Your Mobile Websites Act More Like Native Apps
Posted by Karl Herrick on July 29th, 2010 in Javascript, Apple, Web Development | No Comments »
Gnome background changer
Gnome 2.3 on Ubuntu 10.04 LTS (Lucid Lynx) doesn’t appear to have an automatic wallpaper changer built in. While it appears there are many ways to accomplish this, I decided to write my own little script to get some time in with bash… alternative ways I have found include using “Wallpaper-tray” (which doesn’t appear to be in 10.04), Desktop Drapes, or a variation of the script below using things like “gconftool-2“.
To use this script, do the following:
- Right-click on the desktop and choose “Change Desktop Background“
- Look through the backgrounds, and make sure the ones listed are the ones you want to have the script randomly select
- Open up a text file using “gedit“, and add the contents of the script:
#!/bin/bash
installedDir=~/Pictures/backgrounds/randomi=0
while read line; do
data=`echo "${line}" | grep -i filename`
if [ "$data" != "" ]; then
filenameCutLength=$((${#data}-11))
filename=$(echo $data | cut -b11-$filenameCutLength)
if [ "$filename" != "(none)" ] || [ "$filename" != \
"random.img" ]; then
extension=$(echo ${filename,,} | \
cut -b$(expr ${#filename} - 2)-${#filename})
if [ "$extension" == "jpg" ] || [ "$extension" \
== "png" ] || [ "$extension" == "svg" ]; then
fileArray[$i]=$(echo $filename)
i=$(expr $i + 1)
fi
fi
fi
done << EOF
$(grep deleted=\"false -A7 ~/.gnome2/backgrounds.xml)
EOFfileArrayLength=`echo $[ ( $RANDOM % ${#fileArray[@]} ) ]`
cp "${fileArray[$fileArrayLength]}" \
"$installedDir/random.img" - Save the file as “gRandomBackground.sh” in a directory (this example uses: “/home/$USER/Pictures/backgrounds/random”, if you install it elsewhere, be sure to change the $installedDir variable in the script)
- Open “Terminal” and enter the command:
crontab -e
If you haven’t used crontab before, stick with the default, “nano“
- Paste the following as one line into the editor:
0 */3 * * * bash ~/Pictures/backgrounds/random/gRandomBackground.sh
This will change the background every three hours, on the hour. “Ctrl+O, and then Ctrl+W” should get the crontab saved and also get you exited out of nano. For more information on how to use cron, see Google.
- Open up the “Appearance Preferences” dialog again, by right-clicking on the desktop and selecting “Change Desktop Background“
- Click the “Add…” button and browse to the directory that gRandomBackground.sh is installed to
- Select the “random.img” background, click the “Open” button, and then the “Close” button
Your background should change every three hours.
Posted by Karl Herrick on June 16th, 2010 in Linux, Cron, Bash | Comments Off
McAfee deleted svchost.exe
Wednesday afternoon I had at least two reports of workstations that were suddenly rebooting on their own. No networking and no taskbar were also symptoms. I thought it may be a virus, so I did a few scans with some of the well known Windows malware scanning tools, all the while thinking… why didn’t McAfee catch this? After two hours of scanning and no positives on the scans, I decided to rebuild the machine, but declared that I would begin on it the next day.
Well… turns out, McAfee was the issue. I got an email from them that read in part like this: “Our initial investigation indicates that the error can result in moderate to significant performance issues on systems running Windows XP Service Pack 3.” Moderate to significant? One person affected couldn’t get on the network, had no taskbar, and their computer was auto rebooting… That sounds more like extreme systemic failure!
For verification of the issue, see the following screenshot:

Here are some steps I took to fix it (taken mostly from the following website: http://brianseekford.com/index.php/2010/04/21/how-to-fix-the-mcafee-svchost-crash-from-the-virus-definition-update/)
- Boot workstation in safe mode and login as an administrative user
- Press the following keys: CTRL-ALT-DEL.
- Click the “File>Run” menu item, type in “cmd”, and press the “Enter” key
- Run the command: del “C:\Program Files\Common Files\McAfee\Engine\avvscan.dat”
- Next, we have to copy a replacement svchost.exe from the system if available. Some have found it in “c:\windows\system32\dllcache” and I found it in “C:\Windows\$NtServicePackUninstall$” so I will go with the instructions for what I had on this particular system…
- within the “cmd” window type the following below:
- cd C:\Windows\$NtServicePackUninstall$”
- copy svchost.exe c:\Windows\System32
- Next, restart the workstation, login, and update McAfee to the latest dat file. As of this writing they have replaced the broken 5958 dat with 5959.
- Once McAfee has been updated, I had to restarted the workstation again to get McAfee to report as being updated.
And more reading regarding the issue:
http://www.cnet.com.au/how-to-fix-your-mcafee-crippled-computer-339302608.htm
http://www.switched.com/2010/04/21/mcafee-update-sends-windows-xp-machines-into-endless-reboot/
Posted by Karl Herrick on April 22nd, 2010 in Microsoft, Windows | Comments Off
Screensavers in Ubuntu 9.10
I used to do some incredible tweaking for my screensaver in Ubuntu, especially because gnome-screensaver wouldn’t allow for editing the particular screensaver options like xscreensaver would (see: https://wiki.ubuntu.com/ScreenSaver). These days, I don’t want to tweak… I just want the thing to shut off when I am watching fullscreen flash video, so that I don’t have to wiggle the mouse every ten minutes.
So I made a simple toggle script and created a launcher for the script on the desktop. Gonna watch video? Double-click the icon. Done watching video, double-click the icon.
PID=`pidof gnome-screensaver`
if [ "$PID" != "" ]; then
#gnome-screensaver is running shut it down
killall -9 gnome-screensaver
else
#gnome-screensaver is not running, start it up
gnome-screensaver
fi
Posted by Karl Herrick on March 12th, 2010 in Linux, Bash | Comments Off
Post via script
I just whipped up some PHP and threw it in the root of a brand new Wordpress 2.9.2 install:
include_once('wp-config.php');
include_once('wp-load.php');
include_once('wp-includes/wp-db.php');
$my_post = array();
$my_post['post_title'] = 'My post';
$my_post['post_content'] = 'This is my post.';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
wp_insert_post( $my_post );
?>
Voila. The post appeared when navigating to the .php file.
See: http://codex.wordpress.org/Function_Reference/wp_insert_post.
For more creativity, get into the database: http://codex.wordpress.org/Function_Reference/wpdb_Class
Posted by Karl Herrick on March 11th, 2010 in Wordpress, PHP, Web Development | No Comments »