16 October 2007

erasures without consequence

Today I got rid of some files that were not intended for removal. Had been long since last such mistake. Lapse happened immediately after user switch:

user@host ~ $ su
host user # rm -rf tmp

Deletion of '/root/tmp' was intended but 'su' in place of 'su -' did not switch working directory and deletion of '/home/user/tmp'
began instead. Truly trivial. Surely it has happened many times before.

Since this was my own 'tmp' folder that contains both useless and useful crap I desired to know whether anything worth rescuing was really lost1. Quite unexpectedly user switching proved very useful for identifying lost files:

user@host ~ $ locate --version
Secure Locate 2.7 - Released January 24, 2003


user@host ~ $ su -
host ~ # locate /home/user/tmp > /home/user/rootview.txt
host ~ # exit
user@host ~ $ locate /home/user/tmp > userview.txt
user@host ~ $ diff rootview.txt userview.txt | grep "<" > lost.txt
user@host ~ $ wc -l lost.txt
1490 lost.txt

1490 lost files is quite a big number. But those did not contain my life. Just pieces of others' lives. Pictures of weddings I did not attend and vCards of people who I had no intention of contacting. No problem.

1—No, I don't do backups. Someday will. Really.
2—Secure Locate is a replacement for GNU Locate. Secure Locate indexes entire filesystem into database, but to non-privileged users it only shows the files that they currently can see.

22 September 2007

hectic lecture schedules

Every school's online system should have an (iCal/.../...) export option for the personal course plan.

Thankfully my uni has (much-loathed) online student information system, which among other things allows one to look at generated course schedule plan. My plan is especially hectic this semester—subjects are scattered around without any apparent patterns. I have printed this out but there are chances that I forget to look at it at right time or lose the track of which week of the semester is currently in progress and definitely just forget to attend some classes.

Finally I resorted to manually entering the course plan into Google Calendar and setting SMS notifications for the irregular classes. That took a lot of time because so few things could be marked 'reoccuring every ...'.

Of course I would be even happier when every page that somehow deals with future events would have an easy option to get those events into my calendar. But for schools/conferences this is such a basic feature that should always be present.