Wednesday, January 12, 2011
2 Thessalonians 3:13
And as for you, brothers and sisters, never tire of doing what is good.
New International Version, ©2010
http://www.biblegateway.com/passage/?search=2+Thessalonians+3:13&version=NIV
Tuesday, January 11, 2011
2011 Federal Holidays
Federal law (5 U.S.C. 6103) establishes the following public holidays for Federal employees. Please note that most Federal employees work on a Monday through Friday schedule. For these employees, when a holiday falls on a nonworkday -- Saturday or Sunday -- the holiday usually is observed on Monday (if the holiday falls on Sunday) or Friday (if the holiday falls on Saturday).
| Friday, December 31, 2010* | New Year’s Day |
| Monday, January 17 | Birthday of Martin Luther King, Jr. |
| Monday, February 21** | Washington’s Birthday |
| Monday, May 30 | Memorial Day |
| Monday, July 4 | Independence Day |
| Monday, September 5 | Labor Day |
| Monday, October 10 | Columbus Day |
| Friday, November 11 | Veterans Day |
| Thursday, November 24 | Thanksgiving Day |
| Monday, December 26*** | Christmas Day |
* January 1, 2011 (the legal public holiday for New Year’s Day), falls on a Saturday. For most Federal employees, Friday, December 31, 2010, will be treated as a holiday for pay and leave purposes. (See 5 U.S.C. 6103(b).)
** This holiday is designated as "Washington’s Birthday" in section 6103(a) of title 5 of the United States Code, which is the law that specifies holidays for Federal employees. Though other institutions such as state and local governments and private businesses may use other names, it is our policy to always refer to holidays by the names designated in the law.
*** December 25, 2011 (the legal public holiday for Christmas Day), falls on a Sunday. For most Federal employees, Monday, December 26, will be treated as a holiday for pay and leave purposes. (See section 3(a) of Executive order 11582, February 11, 1971.)
Wednesday, December 1, 2010
Time offsets to UTC in MySQL
The offset from UTC is given in the format ±[hh]:[mm], ±[hh][mm], or ±[hh]. It is appended to the time. The offset from UTC changes with daylight saving time, e.g. a time offset in Chicago, would be "-06:00" for the winter (Central Standard Time) and "-05:00" for the summer (Central Daylight Time).
The following times all refer to the same moment: "18:30Z", "22:30+04", "1130-0700", and "15:00-03:30". Nautical time zone letters are not used with the exception of Z. To calculate UTC time one has to subtract the offset from the local time, e.g. for "15:00-03:30" do 15:00 − (−03:30) to get 18:30 UTC.
The offset can also be used in the case where the UTC time is known, but the local offset is not. In this case the offset is "-00:00", which is semantically different from "Z" or "+00:00", as these imply that UTC is the preferred reference point for those times.
The following times all refer to the same moment: "18:30Z", "22:30+04", "1130-0700", and "15:00-03:30". Nautical time zone letters are not used with the exception of Z. To calculate UTC time one has to subtract the offset from the local time, e.g. for "15:00-03:30" do 15:00 − (−03:30) to get 18:30 UTC.
The offset can also be used in the case where the UTC time is known, but the local offset is not. In this case the offset is "-00:00", which is semantically different from "Z" or "+00:00", as these imply that UTC is the preferred reference point for those times.
SELECT CONVERT_TZ('2004-01-01 11:30:00','-07:00','+00:00');
Wednesday, November 24, 2010
Make WinXP’s NTP client poll more frequently (hourly)
At the registry key:
Change the value SpecialPollInterval to 3600
3600 seconds = 1 hour
Save and restart the Windows Time service:
net stop "Windows Time"
net start "Windows Time"
net start "Windows Time"
Thursday, October 21, 2010
Dizzy Gillespie on Music
"...and all about how music can transport people spiritually."
Dizzy Gillespie in Carr, I., Fairweather, D, Brian P, The rough guide to Jazz. page. 291.
Dizzy Gillespie in Carr, I., Fairweather, D, Brian P, The rough guide to Jazz. page. 291.
Tuesday, October 12, 2010
Using back references in SED
Today I have several CSV files, everyone with a header at the first line and a date at the first fields with the format mm/dd/yyyy. It was necessary to change that field into the format yyyy-mm-dd.
Here there is a Perl solution and also a SED one:
#!/usr/bin/perl
use strict;
use warnings;
while (<>) {
chomp;
if (/^[^0-9]/) {
print "$_\n";
next;
}
my @Fields = split /,/, $_, 2;
my ($Month, $Day, $Year) = split /\//, $Fields[0];
print "$Year-$Month-$Day, $Fields[1]\n";
}
__END__
Yesterday on my way home I realized that the Perl script was horrible, a one-liner should be OK, like the one below:
perl -i.bak -pe 's!(\d+)/(\d+)/(\d+)!\3-\1-\2!' *.csv
Here there is a Perl solution and also a SED one:
#!/usr/bin/perl
use strict;
use warnings;
while (<>) {
chomp;
if (/^[^0-9]/) {
print "$_\n";
next;
}
my @Fields = split /,/, $_, 2;
my ($Month, $Day, $Year) = split /\//, $Fields[0];
print "$Year-$Month-$Day, $Fields[1]\n";
}
__END__
sed -i.bak 's/^\([0-9]\+\)\/\([0-9]\+\)\/\([0-9]\+\)/\3-\1-\2/' *.csv
Yesterday on my way home I realized that the Perl script was horrible, a one-liner should be OK, like the one below:
perl -i.bak -pe 's!(\d+)/(\d+)/(\d+)!\3-\1-\2!' *.csv
Monday, October 4, 2010
Deleting Glassfish old logs
#!/bin/bash
DAYS_TO_KEEP=$((7 * 86400)) # In seconds
LOG_DIR=/var/lib/glassfishv2/domains/domain1/logs
TODAY=$(date +%s)
for FileName in $(ls ${LOG_DIR}/server.log_*)
do
FileDate=$(stat --printf=%Y ${FileName})
DateDiff=$((TODAY - FileDate))
if [ $DateDiff -gt ${DAYS_TO_KEEP} ]
then
echo Deleting ${FileName} ${FileDate} ${TODAY} ${DateDiff}
rm ${FileName}
fi
done
##END##
DAYS_TO_KEEP=$((7 * 86400)) # In seconds
LOG_DIR=/var/lib/glassfishv2/domains/domain1/logs
TODAY=$(date +%s)
for FileName in $(ls ${LOG_DIR}/server.log_*)
do
FileDate=$(stat --printf=%Y ${FileName})
DateDiff=$((TODAY - FileDate))
if [ $DateDiff -gt ${DAYS_TO_KEEP} ]
then
echo Deleting ${FileName} ${FileDate} ${TODAY} ${DateDiff}
rm ${FileName}
fi
done
##END##
Subscribe to:
Posts (Atom)