Archive for May, 2010

Highly transparent Squid proxy.

Most of the times you don’t want to show off the proxy server reference in your web requests despite the fact that it’s main purpose of any proxy software, for many reasons. With Squid 2.6, its quite easy to do. Add this to squid.conf.

via off
forwarded_for off

And then the below ‘via’ entity would disappear from web header requests being sent from a web browser making recipient webservers unaware of the intermediary proxy location, you’re coming from!

, ,

No Comments

Crontab and Unicode Characters

Crontab in Linux likes to keep its own shell environment and this can really cause frustrating problems with output of your cron jobs if they don’t get fixed as its too much ironic to see not the same behiviour of your shell scripts when they are run in crons than to what you normally see in a bash.

I was running a script that included a few of other scripts and it was not showing unicode characters properly when it ran as in a cron. Solution is to include ‘export LANG=en_US.UTF-8′ in your shell script but the ideal way to do so I found was to pass on this environment variable directly in command parameter of a cron job.

The unicode character that was missing earlier ‘degree‘ symbol became visible as soon as I added the variable LANG=en_US.UTF-8 to crontab’s command.

# crontab -l
MAILTO=""
57 9 * * * LANG=en_US.UTF-8 /root/back/hdd-report/report

3 Comments