Thursday, November 15, 2012

Windows 7 NAS Shares can't connect

Thanks to this post, I implemented a GPO that disabled the requirements of Microsoft signatures for network shares and the NAS (LaCIE, et al) I couldn't see from Windows 7 x64bit now could be seen (after reboot of workstation).

Monday, November 5, 2012

mysql cheat to check is number

Is that value a number or a string?

select cast("2apple" AS UNSIGNED), cast("3 bananas" AS UNSIGNED), cast(0+ "4 cars" AS UNSIGNED), cast("100" AS UNSIGNED), cast("BAR" AS UNSIGNED), "5 bears" regexp "[A-Za-z]", "6" regexp "[A-Za-z]"

Returns:
2, 3, 4, 100, 0, 1, 0
Summary: Best way to check if the value is (only) a number is to check if it doesn't contain letters (assuming that letters are adequate for this detection. If you're expecting symbols but no letters, you'll need to test for the symbols).But, if you want to get the "Value" of the string (numbers before letters), CAST it as unsigned.If you know there will *never* be numbers before characters, you can use the CAST and test if greater than zero.

Thursday, November 1, 2012

Linux log files various ways to log

let's say the application has a log output:
Overwrite:
wget -o logfilename.ext ...
Append:
wget -a logfilename.ext ...
Overwrite with a date log:
wget -o logfilename_`date +%Y-%m-%d`.ext ...
This gives you a daily log output.

Output goes to stdout:
Overwrite:
echo "something" > logfile
Append: (creates if not exist)
echo "something" >> logfile
Daily log:
echo "something" >> logfile_`date +%Y-%m-%d`

Output (errors) goes to stderr
include with your standard log:
echo "something" > logfile 2>&1

Blog Archive