• Using gpg-agent to write authenticating scripts

    April 30, 2011

    Sometimes you want to write a shell or other script, and that script is going to have to run under sudo. Under such conditions if the script does anything that requires authentication it will not act as expected. In plain terms it means that the regular popup for authentication will not appear. The tool maybe [...]

  • Producing MySQL dates from Perl

    April 24, 2011

    Ever written the occasional Perl script and wanted to insert the current date and time into a MySQL database? Here is the function to do it. This works for a column of type ‘datetime’. 1 2 3 4 5 6 # function to return the current time in mysql format sub mysql_now() { my($sec,$min,$hour,$mday,$mon,$year,$wday, $yday,$isdst)=localtime(time); [...]

 
Powered by Wordpress and MySQL. Theme by Mark Veltzer derived from Shlomi Noachs openark theme