Tuesday, May 10, 2011

Setting up rsyslogd to get logs from Cisco SPA3102.

On Ubuntu Natty, the configuration order is important. Hence in folder /etc/rsyslogd.conf, file 20-ufw.conf takes precedence over 50-default.conf. Hence if one would like to have its configuration take precedence, the filename must be like 30-voip-router.conf.

Following content would suffice:
root@delbuntu:/etc/rsyslog.d# cat 30-voip-router.conf
$ModLoad imudp
$UDPServerRun 514

#$ModLoad imtcp
#$InputTCPServerRun 514

$template DynFile,"/var/log/router-log/%HOSTNAME%/%timegenerated:1:10:date-rfc3339%"
:HOSTNAME, !isequal, "localhost" ?DynFile

& ~

Monday, April 25, 2011

Moin Moin Migration

  1. When moving from one version to another, make sure that the old Cache directories are deleted, else they would cause problem by loading wrong modules.
  2. For e.g an error as following might be observed:
[Mon Apr 18 12:50:32 2011] [error] 2011-04-18 12:50:32,619 WARNING MoinMoin.log:139 using logging configuration read from built-in fallback in MoinMoin.log module!

[Mon Apr 18 12:50:33 2011] [error] 2011-04-18 12:50:33,371 INFO MoinMoin.config.multiconfig:127 using wiki config: D:\\xampp\\moinconfig\\wikiconfig.py

[Mon Apr 18 12:50:43 2011] [error] 2011-04-18 12:50:43,276 ERROR MoinMoin.wsgiapp:293 An exception has occurred [https://gjm6n1s-706/mm/MyStartingPage].

[Mon Apr 18 12:50:43 2011] [error] Traceback (most recent call last):

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 282, in __call__

[Mon Apr 18 12:50:43 2011] [error] response = run(context)

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 88, in run

[Mon Apr 18 12:50:43 2011] [error] response = dispatch(request, context, action_name)

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 136, in dispatch

[Mon Apr 18 12:50:43 2011] [error] response = handle_action(context, pagename, action_name)

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 195, in handle_action

[Mon Apr 18 12:50:43 2011] [error] handler(context.page.page_name, context)

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\action\\login.py", line 18, in execute

[Mon Apr 18 12:50:43 2011] [error] return LoginHandler(pagename, request).handle()

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\action\\login.py", line 70, in handle

[Mon Apr 18 12:50:43 2011] [error] return self.page.send_page()

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\Page.py", line 1199, in send_page

[Mon Apr 18 12:50:43 2011] [error] start_line=pi['lines'])

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\Page.py", line 1287, in send_page_content

[Mon Apr 18 12:50:43 2011] [error] self.execute(request, parser, code)

[Mon Apr 18 12:50:43 2011] [error] File "D:/xampp/moincode\\MoinMoin\\Page.py", line 1318, in execute

[Mon Apr 18 12:50:43 2011] [error] exec code

[Mon Apr 18 12:50:43 2011] [error] File "MyStartingPage", line 2, in

[Mon Apr 18 12:50:43 2011] [error] TypeError: 'dict' object is not callable

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] mod_wsgi (pid=1072): Exception occurred processing WSGI script 'D:/xampp/moinconfig/wiki.wsgi'., referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] Traceback (most recent call last):, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:\\xampp\\moincode\\MoinMoin\\support\\werkzeug\\utils.py", line 248, in __call__, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] return self.app(environ, start_response), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 282, in __call__, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] response = run(context), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 88, in run, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] response = dispatch(request, context, action_name), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 136, in dispatch, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] response = handle_action(context, pagename, action_name), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\wsgiapp.py", line 195, in handle_action, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] handler(context.page.page_name, context), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\action\\login.py", line 18, in execute, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] return LoginHandler(pagename, request).handle(), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\action\\login.py", line 70, in handle, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] return self.page.send_page(), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\Page.py", line 1199, in send_page, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] start_line=pi['lines']), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\Page.py", line 1287, in send_page_content, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] self.execute(request, parser, code), referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "D:/xampp/moincode\\MoinMoin\\Page.py", line 1318, in execute, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] exec code, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] File "MyStartingPage", line 2, in , referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

[Mon Apr 18 12:50:43 2011] [error] [client 137.72.255.193] TypeError: 'dict' object is not callable, referer: https://gjm6n1s-706/mm/MyStartingPage?action=login

Friday, July 23, 2010

Wubi has no install inside windows option

Err make sure that the USB drive has been plugged out. This option won't popup if the USB drive exist. Copy the iso and wubi.exe on local disk and then try out.

Wednesday, July 21, 2010

Using WinMerge with GIT

First set the environment as following

git config --replace --global diff.tool winmerge
git config --replace --global difftool.winmerge.cmd "winmerge.cmd \"$LOCAL\" \"$REMOTE\""
git config --replace --global difftool.prompt false

Prepare winmerge.cmd as following as it will be used by git. Make sure its in a path:

cat D:\MyDocs\bin\winmerge.cmd
echo Launching WinMergeU.exe: $1 $2
"C:/Program Files/WinMerge/WinMergeU.exe" -e -ub -dl "Base" -dr "Mine" "$1" "$2"

Use git command as :

git difftool

Thats it! Its all set.

Wednesday, June 16, 2010

Ubuntu | Force switch on screen lock and turn off lcd display


gnome-screensaver-command -l && xset dpms force off


Does the job, unless you, audience, can please suggest me better.

Saturday, June 12, 2010

Calculating time difference for reservations using Python


import datetime
# Since I wish to do reservation on 12 Sept 2010
d = datetime.datetime(2010,09,12)
# I can do reservation 90 days before
b = datetime.timedelta(90)
# The day when I can do reservation is
print d - b

Saturday, May 1, 2010

Timex HRM for Sale

Folks,

Selling following:



URL: http://www.amazon.com/gp/product/B000P8VWRC/ref=cm_cr_rev_prod_title

Mail me!