18 April 2006

2006 Ops Tulen



I got this threatening email a few days ago. It reports that the Malaysian Government has just Launched the 2006 Ops Tulen Korporat. It then proceeds to headline that SME's are getting Raided and a General Manager was Arrested. However nothing in the email contained more information of the headline. No details of the arrest, which companies are affected nor the nature of Ops Tulen.

Instead the email continues on offers by Microsoft and its resellers on programmes to sell more software by Licensing Education and more workshops. I guess I wouldn't be upset if it was a plain ol' marketing email to me, but whats scary is that they are using the Governments efforts to reduce piracy and subverting it as a marketing programme for a means to blatantly sell more licenses.

Wouldn't it be more effective if Ops Tulen instead of just the strong arm for the BSA, with all these arrests, changed tacked by INFORMING the citizens of Malaysia about readily available quality Free and Open Source software?

I found this posting by Khairil about Ops Tulen 2004-2005, and I think its a Great Idea.

I really need also quotes and examples of FOSS/FLOSS use by Malaysian businesses.

eg.

Chris DeMarco from MyDirectory states that, "Like others concerned about recent actions by the BSA and the police, our company has moved most our software to using free and open source software". He further states that almost all their staff are now using Fedora on the desktop and using the OpenOffice productivity suite. "We have not only saved on costs, but are also now able to make better use of more software without licensing restrictions of proprietary software" ...


Of course these quotes need to somehow fall into the ministry's press releases, or quoted by proper journalists.

Here's a 2003 Ops Tulen Circular:

The Ministry of Domestic Trade and Consumer Affairs, in its Ops Tulen enforcement campaign, has noticed a significant percentage of software infringement in the corporate end-user sector occurring as a result of software retail piracy. As such, the Ministry is viewing the issue of software retail piracy very seriously.


In it, it tells us the evils of piracy, and what happens to the pirates. Nowhere does it mention the ability for people to find cost effective alternatives in the means of FOSS, to stay legit. The ministry should point to websites such as Open Source Windows.

That way,
1) Piracy in Malaysia will decrease
2) People are educated in their Copy Rights.
3) Trade deficit in software for Msia is reduced
4) Malaysians can find software affordable and legal
5) Malaysian tax dollars would be better spent on education and self development instead on henchmen for foreign companies.

Overall, Ops Tulen can be a great thing. If only it wasnt driven by wrong intentions ...

yk.

10 April 2006

UTF8 CSV files.

We're getting lists to be imported into MySQL in Excel (.xls) formats.
When we use MS Office to export it into CSV,
reading the data gives us gibberish, because
the default encoding is plain old ASCII.

There is not obvious setting available to change the ASCII to UTF8
for the csv file in Microsoft Office.

So I tried Open Office to see if it offers anything better.
In Save As, Change the Type to CSV, then the 'Edit Filter Settings'
checkbox will be enabled. Check this, and when you click save,
a dialog will appear requesting which Character Set to use.

And sure enough, it works like a charm.
The CSV loads up and saves into MySQL OK.

Hooray Open Office. Works better for multilingual requirements.

BTW, if anyone has the solution to export as UTF8 CSV from
MSOffice, please post it here.

yk

30 March 2006

bashrc : aliases I use.

Heres the file I always put in the
/etc/profile.d/ directory on systems I use.

===== yky.sh
# aliases i like to use
# 031110 yky Created from bashrc

alias h='history'
alias j='jobs -l'
alias l='ls -Fax'
alias ll='ls -laF'
alias d='ll'
alias c='cd ..'
alias md='mkdir'
alias rd='rmdir'
alias mr='more'
alias f='finger'


====

dont forget to chmod 755 it.

yk.

29 March 2006

MySQL: CHARSET from latin1 to utf8

A website im supporting needs to have multilingual characters. The default character set for MySQL is latin1. This unfortunately will not support Chinese nor other wierd multibyte characters.

It will quietly support them, but returns gibberish and will cause frustration all round.

After digging around, the best character set to use is UTF8.
To set the default charset for the server, the my.cfg/my.ini file has to be modified:

default-character-set=utf8


Unfortunately, once a database and their tables have been defined as latin1, they remain as latin1 unless you run this for each database:

alter database mydatabase charset=utf8;


and for each table:
alter table mytable charset=utf8;


and for each varchar/char type column:
alter table mytable alter column mycol charset=utf8;


and repeat ad infinitum....

This is rather tedious and boring, so there should be a better way. And that is to dump out the sql, change the charset and dump it back in. Here is the script.


===== latin1ToUTF8.sh

echo Script to convert MySQL latin1 charsets to utf8.
echo Usage: $0 dbname
echo 060329 yky Created.

echo Dumping out $1 database
mysqldump --add-drop-table $1 > db.sql

mydate=`date +%y%m%d`
echo Making a backup
mkdir bak &> /dev/null
cp db.sql bak/$1.$mydate.sql

echo String replacing latin1 with utf8
cat db.sql | replace CHARSET=latin1 CHARSET=utf8 > db2.sql

echo Pumping back $1 into database
mysql $1 < db2.sql

echo Changing db charset to utf8
mysql $1 -e "alter database $1 charset=utf8;"

echo $1 Done!


======

There must be a better way ?!

yk.

23 March 2006

Timestamp your Photos - Filename Dater

Ive been printing digital pictures for quite a while now, and have always wondered why they never made use of the important information available in the EXIF sections of the pictures.

Wouldnt it be great if they printed that information at the back of your photo, so that you know the date and time and all the intricate details of how that picture was taken?

Currently now, they just print the first 8-12 characters of the filename, plus a whole load of unreadable junk at the back. Since I dont like printing the date on the picture itself, I have always renamed my images with the first 6 characters as the date, so there is a means of finding out the dates taken.

e.g. 060101_NewYearParty1.jpg, etc...

Now this is tedious, especially when doing over 300 pictures to process (I usually wait 6 months before processing images, as I do alot of retouching and some fancy stuff)

So I wrote a little delphi program to do this for me.
It will scan through the files in a directory, and if applicable, prepend the date information on the filename. The Date is either extracted from the EXIF data, or if not available from the modified date. If there is a date already tagged to the image, it will skip yet another prepend.

The original files:


After processing:


Note that the digicam pic uses the 'Date Picture Taken' and the movie uses the Modified date.

The very simple UI:


And its rudimentary output:


It was written in Delphi, and Im in the process of getting the permission of the dEXIF author, Gerry McGuire (believe it or not), to release this as GPL if possible. (The website says its 'opensource', but Im not sure which license...)

In the meantime, here is the executable:

FilenameDater.exe : 570KB v1.0

Have fun.

yk.

22 March 2006

dspam: Sendmail + Quaranteen

I had this nagging problem with dspam + Web UI where I couldnt send the quaranteened emails to the recipient if dspam caught as a False Positive email.

maillog gives this error: ======

Feb 13 16:55:04 rslinux27 postfix/sendmail[14503]: fatal: usage:
sendmail [options]
Feb 13 16:55:05 rslinux27 dspam[14495]: Delivery agent returned exit
code 64: /usr/sbin/sendmail -d lo@user.com.my

The Web UI gives this error: =====

An Error Has Occured
The following error occured while trying to process your request:

sendmail: invalid option -- d
sendmail: fatal: usage: sendmail [options]
14269: [02/13/2006 16:46:08] Delivery agent returned exit code 64:
/usr/sbin/sendmail -d lo@user.com.my

This was described in my post to the newsgroup. Unfortunately for me no one answered this cry for help, until another user found the same problem. I emailed him, and he found a solution:

postfix sendmail implementation doesnt know the "-d" parameter. It is
defined in the configure.pl script of the cgi.

replace the -d with a -- and it should work :)


In detail:

In the directory where the cgi scripts for the WebUI for dspam are held:
e.g. /var/www/html/dspam/configure.pl

edit the line which has
$CONFIG{'DSPAM_ARGS'} = "--deliver=innocent --class=innocent " .
"--source=error --user %CURRENT_USER% -d %u";

to:

"--source=error --user %CURRENT_USER% -- %u";

The reason why its obscure is because there is no mention of 'sendmail' nor any indication that these params will flow to sendmail.

Anyway, now it works, so False Positive emails in Quaranteen can be released
and forwarded to individual users as per advertised.

yk.

16 February 2006

UUUHHHGGG-rrrrRRR! HHHurrRRRRRRRRn hhhh!!

Haha, a great blog by Chewie!

http://rrrrrrrrrrrrrnnnnnnnnnnhhhh.blogspot.com/

Lots of thought provoking posts.
You'd never think that he could be so eloquent...



btw, Wookies come from the planet Kashyyyk.
If they can only enounciate words by inhalation,
how is it that they can pronounce the name of
their home planet at all?!

Try it!

yk.

27 January 2006

Lamer

I was walking around KLCC before Christmas and I saw this display in Isetan.
The kerning was definitely wrong which severely destroyed any value this brand enjoyed.

Lamer

Anyway, La Mer is suppose to mean "The Sea" in French,
as used by Nemo's "Beyond the Sea" and Lost.
which brings us to this amazing discovery I found today.

I did a search, and found "google book search" to try.


I clicked on it, and there was this scanned image of an old
french dictionary with the relevant text highlighted! Amazing!




not so lame after all!

yk.

6 January 2006

Postfix...


Spent the day wrestling with Postfix.

Ive finally gotten it to do what I need, and at the end of it all, it certainly is a cleaner approach to handling emails than sendmail.

Now Ive been using sendmail for many years and Im quite comfortable with its settings. However its syntax can get a little daunting.

With Postfix, things look alot 'simpler' but full featured as I have yet to find a function which it cant do.


The reason why Im looking onto Postfix is because sendmail cant seem to pipe emails through dspam before dispatching to its virtual users.

Postfix can.

Im using the webmin interface for Postfix and its quite full featured. It automatically calls a 'postfix reload' whenever a map is updated. However it doesnt have access to the master.cf file, so that still has to be done manually.

yk.

Saruman the Leet


You've read The Darth Side, now a chance to read about the innerworkings of yet another evil megalomaniac: Saruman the Leet.

The premise is that he's back from the dead, atoned for his sins, and is now trying to be good. Also he's a wizard in both senses of the word: magical and technical. Lets see how long he can last being 'good'.

yk.

5 January 2006

Sendmail and Webmin settings.

Note to self:

To get webmin to config sendmail config files,
make sure that the "Sendmail M4 base directory" is correct.
the default is "/usr/lib/sendmail-cf"

For Redhat configs, its "/usr/share/sendmail-cf"

yk.

6 December 2005

FOSS Adoption

Im preparing for a presentation Im giving for
FMM (Federation of Malaysian Manufacturers) soon.
Currently Im gathering some data which will help
the case for FOSS adoption in the case for
local manufacturing companies, in terms of
cost savings, features and of-course freedom.

I found this by chance:
Why not go for 100% OSS Adoption? by Robert Adkins of Technetra,
and it was quite interesting as he tries to extrapolate some figures.

If you have any other interesting links, please add them on.
  • stats on piracy
  • costs of upgrades
  • training costs
  • and any other info



yk.