Archive for 'Uncategorized'
UPDATE_ON column in MySQL with trigger
I needed to update a column with the date and time whenever a record changed in my database. So here is the recipe for the trigger in MySQL 5.0.
DELIMITER $$
CREATE /*[DEFINER = { user | CURRENT_USER }]*/ TRIGGER `my_database`.`UpdatedOn` BEFORE UPDATE ON `my_database`.`my_table` FOR EACH ROW BEGINset NEW.update_on = now(); END$$
DELIMITER ;
Posted: September 19th, 2008 under Uncategorized.
Comments: none
Auto File transfer/copying with SCP
Here is a
Here is a script (below) you can use to copy dump files between machines using scp from an
automated script. Please see attached. The script usage is as
follows:
./auto_scp.sh
local_file user@host:remote_folder
user_password
or
./auto_scp.sh
user@host:remote_file local_folder
user_password
Example:
./auto_scp.sh dump.dmp oracle@hostname:/U01/oracle
<oracle password>
and here is the script————————————————–
#!/usr/bin/expect -f
# connect via scpspawn scp “[lindex $argv 0]” “[lindex $argv 1]” #############################################expect {-re “.*es.*o.*” {exp_send “yes\r”exp_continue}-re [...]
Posted: September 19th, 2008 under Uncategorized.
Comments: none
Open Source County - Impressive Geospatial Portal
I keep having to fish around for this URL so I’m just going to blog into this online note space that I maintain. One stop shopping.
http://maps.co.mecklenburg.nc.us/gp/
This is the Mecklenburg County GIS data portal to both environmental and cadastral-type information. I ran across it some time ago as an avid reader of Tobin Bradley’s excellent blog [...]
Posted: July 22nd, 2008 under Uncategorized.
Comments: none
Handy shell file lister for cygwin or *NIX
This tip is useful for any system with a useful implementaion of ls, wc, and awk. However, some options may need to be modified. For example, the ls options work best on linux, though they suffice on my cygwin install on Windows when my username does not have a space in it
The commands for running [...]
Posted: July 5th, 2008 under Uncategorized.
Tags:
Comments: none