Sunday, November 02, 2008
RPM for Everybody
rpm -qpl package-version.rpm
2. Unpacking of an RPM archive:
rpm2cpio < myfile.rpm | cpio -i --make-directories
all contents of the RPM package will be extracted into the current directory creating relative path..
3. Installing an RPM package.
rpm -ivh package-version.rpm
4. Upgradinga an RPM package.
rpm -Uvh package-version.rpm
5. Listing installed packaged on your system:
rpm -qai
This will list all packages installed via the RPM system.
6. Uninstalling RPM packages:
rpm -e package-version.rpm
7. Building RPM from source:
@todo
Wednesday, February 20, 2008
Reusable Calendar System
Feature and Capability List
- REST access (adding and retrieving events)
- Export to iCal, csv and text file
- Should handle (initially the following kinds of events)
- Event with no timespan.
- Event with timespan.
- Repeating event.
- Provide a notification system to the application using the system.
Initially we will try to use google calendar API. This will provide us with proven platform and a working calendar system.
Google Calendar API
Google calendar already handle all the initial requirements all that is left is to understand how to use the Google Calendar so we can have our reusable and reliable calendar system.
Google calendar API already uses REST access. They also uses their own GData protocol. Learning Google data API protocol is a good addition since it is also used by "All" Google apps.
Overview of the Google Calendar API
GData uses either of two standard XML-based syndication formats: Atom or RSS. RSS has been in the internet for a longer time and Atom is more recent but provide more features.
Atoms provides Atom Publishing Protocol(APP), an HTTP-based protocol for publishing and editing web resources. It provides the create, edit, delete resource command using POST, PUT, or DELETE respectively. This is the same access as WebDAV and the newer protocol the CalDAV.
In RSS you cannot provide a query to server to get a response containing list of matching results. GData uses the standard extension mechanism of Atom to allow queries.
Read a more thorough overview of the GData protocol here
Sunday, November 18, 2007
Backup and Restore SVN Repository
svnadmin dump /var/repo/myRepo > /home/username/myRepoBackup
To restore the repository to a different machine or a different repository, create the new repository by issuing the following command:
svnadmin create /home/username/repo
To restore the data, enter this command:
svnadmin load /home/username/repo < /home/username/myRepoBackup
For more information see the free svn book about the topic here.
Friday, July 13, 2007
Monitoring the status of servers
Attacking Log analysis tools
Wednesday, June 27, 2007
Detect Window Close Event
The <body> tag fires an event
onbeforeunload when a page is refreshed or unloaded in the browser window. This event can somehow prevent the user from navigating away from the page or closing the window.An event listener can also be attached to the window object that can do some AJAX processing or cleanup because it cannot prevent the browser window from closing.
Example:
<script type="text/javascript">
// event below works both in IE6,7 and Firefox
window.onunload = function()
{
// do processing here
alert('bye!');
}
function showUnloading(evt){
//IE specific code to cancel the navigation
//if you put a text value in that property IE will try to confirm
//if you want to navigate off the page.
//The code also works with Firefox
evt.returnValue = "You are leaving.";
//Firefox GeckoDOM specific
//below is how to handle the cancelling of firefox
if (!confirm('Are you sure?'))
{
evt.preventDefault;
evt.stopPropagation; // this makes sure it does not bubble up
}
}
</script>
<body onbeforeunload="showUnloading(event); >
</body>
There are lot of uses for the web application that detects the unloading of the body. It will be application specific on how you handle the event. There are a thousand way a user can navigate away from a web page and as always never trust that those events are guaranteed to fire.