Tuesday, February 10, 2009

Removing the Firefox Scroll Bars

I was developing for a MID (Mobile Internet Device) and needed to remove the vertical scroll bar of Firefox, the default browser, because of the page shift that happens when viewing a long page. MID supports touch so scrolling doesn't require the vertical scroll bar.

The solution is a simple CSS rule:


<body style="overflow:hidden">

Saturday, January 24, 2009

End of Flight Simulator

Very sad news indeed. :(
Future GPU Thoughts and Musings: End of an Era - Aces Studio and Flight Sim shuttered

Friday, January 02, 2009

Watching Remote Logs

We sometimes need to monitor log files on remote servers.

A simple method, that doesn't require us to log in to the remote host, is to run GNU tail command over the network using ssh.

Example, if we want to monitor the file /var/log/sample.log on the remote host hostname.


$ ssh hostname tail -retry -follow=name /var/log/sample.log

Saturday, December 20, 2008

UNIX time to human readable

You can easily convert a UNIX time to human readable using the shell command date.



$ date -d @1212312323
Sun Jun 1 13:25:23 GST 2008

Sunday, November 30, 2008

How to have Undelete on your Linux command line.

Almost all distro now has a Trash to undo your current deleted files when using the GUI file browsers.

When you spend most of your time on the shell you usually use the command "rm" to delete a file and this command doesn't support undelete once you issued the command.

First we need to learn not to use the command 'rm' to delete our files.

In your ~/.bashrc file add the following line:
alias del='mv -t ~/.local/share/Trash/files --backup=t'
Deleting files now is done via
del filename.txt
.

Then we need a script to clean up our trash folder occasionally.
Create a script and name it whatever you want, I named mine "cleantrash" and have the code below inside it.



#!/bin/bash
#
# This will delete all files in the trash directory
# that is older than the specified KEEPDAYS
#
# It can be run using a cron job or manually
#
TRASHDIR=~/.local/share/Trash/files/
KEEPDAYS=14
find $TRASHDIR -mtime +${KEEPDAYS} -exec /bin/rm -f {} \;


Make sure you do a chmod +x cleantrash so we can execute it.