Wednesday, November 18, 2009

perl: warning: Please check that your locale settings:

If you ever get this from an Ubuntu install:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "en_US.utf8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory


Just do:

you may have to regen the locales using "locale-gen " where localename is the name of the locale you want to regenerate (e.g. "en_US.UTF-8"), then "dpkg-reconfigure locales"


ref: http://ubuntuforums.org/showthread.php?t=75493

Friday, July 24, 2009

Find files based on modification time and copy to new directory

I've been trying to find a script to copy files from one directory to another. I stumbled upon this article but I don't want to download scripts to the server. Trying to modify it had eaten a lot of time, since I'm a bash noob.

Resolved to find a simple answer, I experimented with moving files using the find command:

find -fprintf outfile 'mv "%h/%f" targetdir"%h/%f" \n';

After generating the outfile, I chickened-out and decided to copy the files instead. One stumbling block was that plain cp by itself does not copy directories recursively.

I found the answer here:

find . -name "*.mp3" -exec cp -v --parents {} /new/directory \;

The --parents option saved the day for me.

Thursday, April 30, 2009

Mount a USB Drive in an old Linux Distro

I always forget this, prompting me to search the web everytime...

To mount a USB device in an old distro such as RH9, just plug the device and wait for a few moments before typing dmesg. The output should list a new device at /dev/sd?. Once you know this, you can mount it using mount -t auto /dev/sd? /mnt/usb if you have created /mnt/usb prior to that. If not, then create a similarly named directory under the /mnt folder or wherever you want to mount it.

If you cannot find anything useful from dmesg output, type modprobe -r ehci_hcd once you plug the disk while you are already in gnome. In that way, you remove the module

ehci_hcd

and the module

ohci_hcd

handles the disk automounting process

Monday, March 23, 2009

Legacy MSSQL DB migration

Saturday, we migrated an MSSQL7 DB to MSSQL2K. We also have MSSQL2005 but our VB6 front-end could not handle the newer version. Today its rolled into production. It was a non-event but the power interruptions spoiled the fun.

WAP enabled Blogger or S60 App

I hope Blogger will come out with a WAP enabled site or an S60 app for those who think as fast as his thumb can type! My last post was also done on my phone...

Globe Tattoo Mobile in GenSan

just tested my usb dongle without using a cable at several locations in GenSan. At GensanVille Subd: with signal but no Internet. 50m from Laurel cor Bayabas Sts Globe cellsite: just GPRS/EDGE signal and slow Internet. Maybe one needs to use the usb cable to improve the signal or Globe is not yet ready for this product here. Hope this will improve soon!

Wednesday, March 11, 2009

Web Proxies

Today, a problem emerged when internal LAN users connect to http://xxx.xxx.xxx/xxx. They all get a blank page. I was able to trace this a badly configured proxy in another part of our network.

After deciding on several options, I decided to use our own proxy connected to our own gateway. Several questions came up, among which are:

1) How do you force a squid proxy to use a certain parent cache for a certain domain?

example answer: cache_peer_domain 172.16.1.57 .co.in
(see http://wiki.squid-cache.org/CategoryConfigExample)

2) How about making sure that requests for certail URL goes direct, instead of querying the cache:

ACL foo dstdomain .example.net
Always_Direct Allow foo

3)If you want to configure Apache as a proxy, use this as reference: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html. Apache can be configured in both a forward and reverse proxy (also known as gateway) mode

These and other administrative functions occupied my day today...

Sunday, March 8, 2009

C# to GMail

As a way to mark this date, when this blog was created, I am posting what is on my platter. I hope someone would stumble to this and lead me to the right direction...

Testing email sender


Exception Error: 504 5.3.3 AUTH mechanism LOGIN not available
at System.Net.Mail.SmtpClient.Authenticate (System.String Username, System.String Password) [0x00000] at System.Net.Mail.SmtpClient.PerformAuthentication () [0x00000] at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] at emailtester.Page_Load (System.Object sender, System.EventArgs e) [0x00000]
SMTP HOST: localhost
SMTP PORT: 25
FROM: xxxxxx
USE FROM: xxxxxx
======================================================


RECEIVER TEST:

Exception Error: Read failure
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] at System.IO.StreamReader.ReadBuffer () [0x00000] at System.IO.StreamReader.ReadLine () [0x00000] at OpenPOP.POP3.POPClient.Connect (System.String strHost, Int32 intPort) [0x00000] at Emailer.Receiver.Connect () [0x00000] at Emailer.Receiver.TestPop3 () [0x00000] at emailtester.Page_Load (System.Object sender, System.EventArgs e) [0x00000]
System.Net.Sockets.SocketException: Operation timed out. at System.Net.Sockets.Socket.Receive (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] POP3 HOST: pop.gmail.com
POP3 PORT: 995
POP3_USERNAME: xxxxxxxxxxx
POP3 PASSWORD: xxxxxxxxxxx

One more blogger joining the melee

I used to have doubts if I can sustain blogging, but after being initiated to Twitter, Friendfeed, Facebook, Yammer, etc...I decided I go the extra mile and go for a blog. What for? I don't know yet, but I figure I can share my insights, experiences, knowledge acquired, and inanities in general. So watch out for a noob on blogging