Posts

Showing posts from December, 2005

CLI shortcuts, 5

To get error code of last executed command: echo $?

Simple script to switch IPs

#!/bin/bash # Switch IP script, v.1 - [email protected] CONFIG_DIR=/etc/sysconfig/network-scripts ROOT_UID=0 ERRROR_XCD=66 ERROR_NOTROOT=67 # Run as root if [ "$UID" -ne "$ROOT_UID" ] then echo "Must be root to run this script." exit $ERROR_NOTROOT fi cd $CONFIG_DIR || { echo "Cannot change to config dir." exit $ERROR_XCD } if [ -z "$1" ] then echo "Usage: `basename $0` [afrdis|preginet|globe]" exit 1 else if grep -q $1 ifcfg-eth0 then echo "Already linked. Not switching anymore." exit 0 else echo "Switching to $1 link..." cp ifcfg-eth0.$1 ifcfg-eth0 ifdown eth0 ifup eth0 ifconfig eth0 exit 0 fi fi

Drupal modules loaded in CMS

Using the following modules in my Drupal CMS implementation: Archive Attachment BasicEvent Event Excerpt Feedback Filemanager Flexinode Forward Help Image Img_assist Menu Node Nodewords Notify Page Path Pathauto Print RSVP Search Service_links Similar Simplenews Sitemenu Taxonomy Taxonomy_access TinyMCE WatchdogNotify Up next: Themeing the front_page. I've created a PHP snippet to list and beautify recent news items. Clean up the code. The HTML source is a mess! Will have to dig deeper into that. Integrate with Gallery (there's a Drupal module for this) and MediaWiki (if possible). I wil be needing these apps if I want to make my life easier. Migrate from the old CMS. Now this will be a pain. Would have to do this manually as the tables are way, way different. Ugh!

Google Maps API experiment, revisited

Apparently, I goofed. When I visited my Google Maps API project this morning, the map was missing! Thanks to Migs Paraz for pointing that out. In the previous version, I added a few div items that shouldn't be there (in the spirit of separating content, presentation and behavior in the code). I cleaned the code a bit: completely separating the Javascript code to another file so the HTML will not be cluttered, and added an if (GBrowserIsCompatible()) check. The XML is still as it is. Will have to consult with the content developers on what other info to include. And I'm still not sure about the GPS locations because I just gathered the samples from Global Gazetteer Version 2.1 . Will have to check with the GIS people on Monday. For now, here it is . It's really not that much: there's a list of interesting points on the left that you can click to display info on the map. I'll be adding the relevant information soon, such as the websites, statistics and related link...

Playing with Google Maps

I'm messing around with the Google Maps API for an app I'll be deploying for my project. The idea is to map all available (preferably web-based) information on agriculture in the Philippines. The resulting map can also be used to display other agricultural information resources like available seed stocks, farmers cooperatives, learning centers for extension workers and farmers, etc. For now, I'll just be displaying the locations. The (very) alpha app (baby steps here...) uses GPS waypoints from an XML file, then display them as markers on the map, with the corresponding info in the infowindows. Our GIS people here at the office were off on a field study so I couldn't grab the available GPS data. (Memo to self: suggest a central {shareable} repo for their accumulated data.) I had to grab some sample GPS points from WayPointsDotPH . I use dBoracay for, sort of, my centerpoint in the map. Heh. There's plenty of room for improvement. The XML, for example, is flat and ...

Yummy?

Buy-off anxiety? Del.icio.us ( recently bought by Yahoo! ) has been buggered lately. It still shows bookmarks, but I can seem to do anything else. Can't fetch JSON objects, too. Oh, well...

Gingerbread PC, anyone?

Wanna learn how to make a PC out of gingerbread? This Swedish site shows you how. Time to crank up Babelfish . UPDATE: Alas! Babelfish doesn't do Swedish. This other translation site spews rubbish as well. *Sigh!* Good thing there are pictures. [ via Boing Boing ]

Onboard the IT bus

I was in Davao del Sur last week for the launching of our project's IT bus. My post is over at Pinoy Tech Blog . [ via Pinoy Tech Blog ]

New from GMail: 'Web clips'

Just got home from a gruelling five-day stint in Davao. I couldn't stay online for long because our WeROAM links were sluggish. (More on this later.) Imagine my surprise when I checked my GMail: "Web clips", as GMail describes them , are snippets of "news headlines, Gmail tips, blogs, any RSS and Atom feed, relevant sponsored links, and more." They are placed on top of the inbox and messages toolbar. The feeds are displayed at random, though, not like your regular feed reader.