Friday, December 26, 2008

SL Radio channels on mplayer

Lots of Sri Lankan online radio stations seem to require Windows Media Player plugin or some other plugin when you try to access them over the Internet. Went through a couple of those radio channels finding out which urls that can be used with mplayer. Below are the findings, hope they will come to some use. I currently only listen to YesFM, and YesFM only.

YesFM -> http://174.133.224.53/yesfm
TNL Rocks -> http://220.247.224.89/live
Lite FM -> http://222.165.133.161/live
Y FM -> http://174.133.224.53/yfm
E FM -> http://69.80.238.25
Shakthi FM -> http://174.133.224.53/shakthifm
Neth FM -> http://38.96.148.49:5552
Sirasa FM -> http://174.133.224.53/sirasafm
MAX Radio -> http://75.125.239.34:7045

As an example, to listen to YesFM,
you can use mplayer http://174.133.224.53/yesfm

This link helped quite a lot in finding out the Radio Channel web sites.

Thursday, December 25, 2008

tiny sparkles...


tiny sparkles, originally uploaded by Yajith.

City on the Christmas Eve...

This is an experiment. I'm checking out making videos using photos, on Picasa3. These are some of the blurry photos i captured around the City on the Christmas Eve. Got Copped once for taking photos of the City, but didn't feel bad at all. Photos are too blurry in many cases, and way too amateurish, guess i have to improve a lot more. Camera actually has a special mode for night scenes, but for that i'd have to keep it still for like 20 secs or something, which never really works out well. So i just turned off the flasher and kept shooting.

Uploaded the Clip to YouTube and Vimeo both, not judging but feel Vimeo is better. Uploading to blogger was not really working out for me for some reason, put it to upload and waited like 3Hrs, but nothing happened in the end. Perhaps i didn't do it correct.

Below are the two clips. This is waaaay amateurish, so bear with me.

YouTube Clip



Vimeo Clip

Wednesday, December 24, 2008

vim stuff

note to self

I keep forgetting this, and i want to kick my self hard so i won't!!! Even then I'm not sure i won't forget this!

To append some common text to all the lines in a text file with vi/vim, below can be used.

:%s/$/some text

\t = Tab Space

Sunday, December 07, 2008

green and white...


green and white, originally uploaded by Yajith.

Frustration...!



I burn stuff..whenever my computer doesn't work, or when the electricity is not there so i can't turn on the computer, that's what i do. I find it very hard to keep my mind from wondering into things that i don't want it to, when im home with nothing to do. Today was such a day!! Woke up around 10.30 to find out that the jerks in CEB have done it yet again, and called on a power cut!! AAARRGH!!

Not only it's fuck bad to be in a power cut, on a Saturday, when you are home, it so happens to be the day someone leaves me an important message online!!! Come evening when i finally log-in what do i find??? Offliners.!! Damn frustrating!

So, I burn stuff...

Thursday, December 04, 2008

Counter-Strike 1.6 on Wine

I wanted to play this game Counter-Strike, for some time now..and yesterday i got some free time to try this out. Actually it was pretty easy to get it to work on my Fedora9 with Wine. Only thing i had to do manually was to copy this msvbvm60.dll from a M$ Windows machine to .wine/drive_c/windows/system32/

The graphics get a bit jerky when the game is starting up, and once it loads up its quite smooth.
Btw The installer wizard was filled with some strange looking characters instead of the instructions, but i guess i got the correct buttons when i clicked. Shouldn't be hard.


This would be the second FPS game i had luck with over wine., Unreal tournament being the 1st.

Friday, November 28, 2008

yum stuff

note to self

When creating yum repositories with RHEL5 installation media,
use createrepo -g with the comps-*.xml files inside {Server, Cluster, ClusterStorage, VT}/repodata directories.

createrepo -g will add the necessary meta-data on to the repo, necessary for yum group functions to work properly.

Eg. yum grouplist, yum groupinstall

Monday, November 03, 2008

Enabling basic authentication in Squid

Found this in my gmail archive and thought it would be easier to have it on my blog. I had replied with this to someone on the lug.lk mailing list. Actually noticed an error on my reply as well, which is corrected on the below.

-2007-08-01

Squid supports lot of authentication methods. I'll put the basic method that uses ncsa_auth program. You need to make the following changes to your squid.conf. Please be advised that the below, gives only a very basic proxy setup with authentication. If you want something complex, you might want to the squid documentation.

**Backup your existing squid.conf

Put/uncomment following lines to your squid.conf
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd


ncsa_auth program is installed along squid in redhat flavours, under /usr/lib/squid/ . "/etc/squid/passwd" is the name of the file where all the passwords will be kept. You can change this to point to wherever you want in the file system.

auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off


First line below is an ACL named "authenticated_user"
Second line defines the networks in the LAN. This should be changed according to your setup. ( i just copied over from def: squid.configuration :-) )
The third allows http access through the proxy for Authenticated connections coming from the specified networks.
acl authenticated_user proxy_auth REQUIRED
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks authenticated_user

Once you have made the above changes to the squid.conf you have to create the username/passwords in the specified file. ( /etc/squid/squid_passwd in this )

For that, do,
htpasswd -c /etc/squid/squid_passwd username password

After adding the 1st user in the above way, to add more new users, use the below method.
htpasswd /etc/squid/squid_passwd username password

You can find out various parameters you can use with htpasswd from the man page.

When everything is done, simply restart the squid service..

If you want squid to connect to a separate service for authentication, refer to the squid documentation, there are quite a few methods that are currently supported.

Monday, October 13, 2008

Kernel versions on different RHELs...

note to self

When ever you need to find out a kernel version of a particular RHEL version or an update, you can head over to this Knowledge Base Article. Hope they are keeping it up-to-date.

Below is what it contains right now.

Red Hat Enterprise Linux
Update v. 2.1 v. 3 v. 4 v. 5
GA 2.4.9-e.3 2.4.21-4 2.6.9-5 2.6.18-8
U1 2.4.9-e.12 2.4.21-9 2.6.9-11 2.6.18-53
U2 2.4.9-e.24 2.4.21-15 2.6.9-22 2.6.18-92
U3 2.4.9-e.34 2.4.21-20 2.6.9-34 -
U4 2.4.9-e.40 2.4.21-27 2.6.9-42 -
U5 2.4.9-e.49 2.4.21-32 2.6.9-55 -
U6 2.4.9-e.57 2.4.21-37 2.6.9-67 -
U7 - 2.4.21-40 2.6.9-78
-
U8 - 2.4.21-47 - -
U9 - 2.4.21-50 - -

Old CentOS/RHEL packages

note to self

When there is a need for an old RHEL or CentOS rpm, head over to http://vault.centos.org. They keep an archive of package trees of previous CentOS releases.

It can not be used as a yum repo, but its good enough if you know what you need exactly. The security updates are not put in there, but this works for me..

--

Thank You CentOS.! :)

its rpm-build NOT rpmbuild..!

note to self

"rpmbuild" is the tool used to build rpms ( something like a .deb in Debian flavours ). Whenever i want to build a rpm on a system where i don't have rpmbuild installed, its quite easy to get it installed on the system using "yum".

The problem ( - not exactly a problem, just something that keeps on happening to me ) is that when i do "yum install rpmbuild" yum doesn't output what i need. Instead it outputs stuff which are not really even related to my requirement. The program that provides rpmbuild is named "rpm-build", which keeps causing me this problem. :(

The packages given as results from yum, when the query string is given as "rpmbuild", all seem to have the word "rpmbuild" on their "info" meta data, but its strange, and quite frankly annoying that "rpm-build" ( the actual package that provides "rpmbuild" ) doesn't have the key "rpmbuild" which could be the reason for this.

And, before i forget, the correct way would be "yum install rpm-build" :)
I hate that i keep forgetting these.!!!

Monday, October 06, 2008

my favorite superhero...

Something i enjoy going through.
-from the movie "Kill Bill - vol.2"


---

i find the whole mythology surrounding superheroes fascinating.
take my favorite superhero, Superman.
Not a great comic book. Not particularly well-drawn.

But the mythology..

The mythology is not only great, it's unique.

Now, a staple of the superhero mythology is,
there's the superhero and there's the alter ego.

Batman is actually Bruce Wayne, Spider-Man is actually Peter Parker.

When that character wakes up in the morning, he's Peter Parker.
He has to put on a costume to become Spider-Man.

And it is in that characteristic Superman stands alone.

Superman didn't become Superman. Superman was born Superman.

When Superman wakes up in the morning, he's Superman.

His alter ego is Clark Kent.

His outfit with the big red "S" - that's the blanket he was wrapped in as a baby when the Kents found him.

Those are his clothes.

What Kent wears - the glasses, the business suit - that's the costume. That's the costume Superman wears to blend in with us.
Clark Kent is how Superman views us.

And what are the characteristics of Clark Kent?

He's weak... ...he's unsure of himself... ...he's a coward.

Clark Kent is Superman's critique on the whole human race.

---

bunch of yellow...


bunch of yellow, originally uploaded by Yajith.

Friday, October 03, 2008

port forwarding using ssh

note to self

ssh can be used in the below way to forward traffic over a secure channel, to make otherwise un-secure ( plain ) traffic to be encrypted.

ssh access to the destination sever is required for this to work.

For an example, to secure POP3 communications with a mail server at a.b.c.d one can do something like below on their local machine.

ssh -N -f -L 127.0.0.1:1100:a.b.c.d:110 user@a.b.c.d

-f is to put the connection to the background
-N to wait infinitely for incoming connections
-L binds the tunnel to the specified port ( 1100 in this case )

this will create a ssh tunnel bound to the local port 1100 with port 110 of a.b.c.d
@a.b.c.d performs the authentication via ssh with the a.b.c.d

once this is done, the POP client can be re-configured to talk to local port 1100. ssh will happily encrypt and decrypt what you put in the tunnel from the end-points. This mechanism can be used to secure systems that are not built with such capabilities.

when you want to stop the tunnel, you can simply use "kill"

--

FAQ at www.openssh.com was quite helpful in figuring this out. thanks bud for pointing out such things can be easily done with ssh. :)

Thursday, September 25, 2008

Wednesday, September 17, 2008

bomb on bus...



got a chance to snap a couple of photos of the bus on which a bomb exploded today. photos aren't very clear, i took them from the camera on my phone.





Tuesday, September 02, 2008

squirrelmail preferences

Note to self

SquirrelMail keeps user specific preferences, address books in /var/lib/squirrelmail/prefs/

It annoys me, that i keep forgetting this sort of things. Hopefully i won't, again!

the bells...


the bells, originally uploaded by Yajith.

Thursday, August 28, 2008

No Audio with YouTube on Fedora?

Audio with Flash player doesn't seem to work on Fedora out-of-the-box. Quite an old thing really, but this is something i keep forgetting..thought of blogging this for my own references.

Below is known to fix the problem.
#yum install libflashsupport

http://fedoraforum.org/forum/showthread.php?t=195224


2009/01/28 Update:

Noticed that libflashsupport is not needed and is not there any more on Fedora 10. Installing the flash plugin rpm from Adobe does it.

beautiful blur...


beautiful blur, originally uploaded by Yajith.

Thursday, July 03, 2008

day-out - 03-07-2008

Quite an eventful day today.

Woke up to the sound of my mother answering a phone call from from back home, saying my home at Walasgala ( a little village in Matara District ) has been robbed last night.



For some reason the 1st thing that came to my mind was about the old books & magazines i have inherited from my father. As it turns out, the robbers have taken out the books i had in one cupboard, and taken away just the cupboard, you can understand my relief.

Was quite busy today, as i had to get my passport done, from Department of Immigration and Emigration AKA "the passport office". With some guidance from few of my friends, i got the necessary documents ready ( you will need NIC, Birth Certificate, Letter of Employment and your Degree Certificate with photo-copies of all of them ) as i already had the Application for a new passport and the photos ready.

Make sure you take the photo copies of all the documents before you go in, because its a pain to come back out from the counters again just to get a photo copy. They have place where you can get photos, photo copies etc. within the office complex which is quite helpful.

Submitted the documents and paid the 7.5k Rs. which is the amount they charge, for 1-day service and came out around 11 a.m. If you too, are planning to go there, then go around 10.30 - 11.00 as the crowd is minimal around at that time.

Had a customer site visit after that, at this place we are doing a small POC kind of a thing with GNU/Linux based spam/av protection system. They wanted me there, before they actually put the mails to come through it.



Rushed to my old office, as i had left my VGA card there, to collect it. :) Then rushed back to the office while helping this friend of mine with his new fedora installation.



Back at office, there was a small thing i took take care of, with a little postfixing.. :) Postfix is by far the best MTA i have come across and it continues to amaze me, on daily basis.



Returned back to "passport office" and collected my passport around 3.30 which was surprisingly quick. Getting the passport must be the easiest thing i have gotten done from a government office.
Now I have a passport..yey!!! :)



Got back to office quick..and thought of putting something on the blog..so this is it..

You can go and have a look at this if you are planning on getting a new passport, it will tell you hows and whats.. ;)

Wednesday, July 02, 2008

Its funny, how mind works at times.

I wanted to get this nice looking usage graphs to report on Squid, Postfix etc. For sometime now, i was thinking of trying this out and seeing how its done.

Today i gave it a go, by working on to get Squid to work this way. I had heard from somewhere you need/can have Squid+SNMP work together to get such a result.

I skimmed through the SNMP wikipedia entry as the beginning.

After reading a little on the squid-WiKi i found this article giving a basic idea of what i have to do.

Since the initial SNMP setup seemed to work without a problem, the next step was to get the graph/reporting tool installed and configured. Article suggested 2 options, MRTG & RRDtool.

Now comes the funny part.

Since the my proxy is using RHEL4( One of my favorite OSs btw ), and i didn't feel like searching around for RPMs, i thought of getting yum installed on the RHEL4. Since RedHat only provides update services for customers with subscriptions -which i don't have for my proxy, at the moment- i thought of using CentOS repositories instead.

Now, since yum isn't built in to the RHEL4 (RHEL5 is yum enabled), the easiest way, that i know of, in getting yum to work, is to use the necessary RPMs from a CentOS repo.

I had all these RPMs on another machine, a one which i did a similar thing sometime back, i thought of simply copying them to this machine, over ssh, as i always do.

But then, it involves me typing the proper ssh password, when prompted..Then, i i got this idea of setting up ssh-keys setup so i wouldn't have to type the password, when i'm copying the files over.

So i took a look at my own blog where i put some info. i found from here and there about this, sometime back. hmm.. i have mentioned about both rsa and dsa keys in that post..which got me thinking.., which is better..? & how do you select one ? etc..

Search in Google takes me to some forums/mailing lists where other people have asked similar questions..read a good explanation/discussion on one of them, and now I'm have questions like cryptanalysis, asymmetric vs. symmetric encryption algorithms etc.. popping up in my mind.., and also a feeling that i should blog this. -which is what I'm doing now. :) I actually had a bit of a hard time, recalling where all this began.

It really is funny to me how my mind works at times..guess its the same with many.

Hopefully i will be able to find my way back and get the proxy reports to work, because they look cool.

Friday, May 30, 2008

Very Basic Mail Server setup with Postfix + Dovedot

This is just a very basic overview on setting up a MailServer with Postfix + Dovecot. I'm basing this on a Redhat flavored GNU/Linux, but this should work on other GNU/Linux's as well.

1. Install postfix and dovecot ( ex. if using yum, yum install postfix )

2. Go in to /etc/postfix dirtectory and re-name the main.cf to main.cf.orig or something similar.

3. Create an empty main.cf

myhostname = mail.domain.com
mydomain = domain.com
myorigin = $mydomain
mydestination = domain.com, mail.domain.com, localhost, localhost.localdomain

inet_interfaces = all
mynetworks = 127.0.0.0/8

local_recipient_maps = unix:passwd.byname, $alias_maps

smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions = reject_rbl_client bl.spamcop.net,
reject_rbl_client dnsbl.njabl.org,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client list.dsbl.org,
reject_non_fqdn_sender,
reject_invalid_hostname,
reject_unauth_destination,
reject_unlisted_recipient,
reject_unauth_destination,
reject_unknown_sender_domain,
reject_unauth_pipelining,
permit_sasl_authenticated,
permit_mynetworks

4. Add/Change the below lines in /etc/dovecot.conf

protocols = pop3
pop3_listen = *

5. Make sure your /etc/sysconfig/network has the correct FQDN

...
HOSTNAME = mail.domain.com
..

6. Make sure your /etc/hosts is correct.

127.0.0.1 localhost.localdomain localhost
interface_ip mail.domain.com mail

7. Do chkconfig service_name on for services postfix, dovecot and saslauthd and start the services with the service service_name start command.

8. Create the necessary user accounts with useradd command and assign passwords, and configure your mail clients to use the server for incoming(POP3) and outgoing(SMTP) with authentication.

ex: useradd -s /sbin/nologin username
ex: passwd username

Thats it.

You should be good to go..of course you have to have the necessary DNS settings and other changes, depending on your setup ( ex: firewall ), but for the Mail Server configuration, this is pretty much it.

Please keep in mind, that this is a very basic setup, and i have not tested the configuration above. This is just in case someone wants to get an idea. There are so many good guides on the net in setting up postfix, just search around for a while and you will see. If you need any help, there is always helpful #postfix on freenode. But please examine the situation well before asking for help, so they can help you better.

Other than that, put a comment or reach me at yajith at gmail dot com (yajith@gmail.com). I will help you ( or at least try ) with my limited knowledge.

Friday, April 11, 2008

Installing Pidgin on RHEL5

It's over an year since the last time i wrote something about pidgin on my blog.

Yesterday one of my friends installed her machine with RedHat Enterprise Linux 5, the OS that i have come to like so very much ;). During the installation she had forgotten to go in to the detailed package selection dialogs -probably because, on the text mode installation, anaconda keeps the package details hidden in a dialog which you have to access by pressing a function key- and ended up not having pidgin on her installation.

A new comer to pidgin, she then went on and downloaded the Pidgin RHEL5 RPMs from the Official pidgin RHEL/CentOS 5 yum-repo as i have told her at a previous time.

The problem here is like this.
You can't just install the RPMs from there, as they seem to have a few dependencies, most of them are for the package libpurple.

Now this by it self is not a problem at all, if you have been using RHEL for sometime, then you would know how to figure out the missing packages from the rpm dependancy error messages, which is what i started doing.

There were few packages like cyrus-sasl-MD5 and gtkspell which fixed a lot of errors, but this error regarding some libsilc and silc-client which just wouldn't go away.

The funny thing is, when you google for libsilc or silc-client you don't get anything that you can work on really. Yes, it does give you this site http://silcnet.org which seem to belong to them who maintain this component. Little look on to the site revealed that SILC is actually a method or a protocol for secure conference (chat).

It actually took me a while to try and install the packages that are there..as they seem to be for Fedora 7, and i wasn't very sure how it might affect the system.

SILC Client 1.1.4
SILC Toolkit 1.1.7

Finally, as i couldn't find any RPM for RHEL5 which fulfills my missing packages, i went ahead with the installation of these two packages.

The problem still remained, and kept giving me an error.
Then i tried a 3rd link from the same site.

SILC Pidgin 2.4.0 and after clicking through few links i ended up on a Fedora mirror. I tried searching for the word silc and found this package libsilc which did the job for me finally.

So far i have not been able to find a matching set of RPMs for RHEL5 which would install pidgin without a problem, its quite possible im looking at wrong places, but am i. Only place i didn't look in to yet is the CentOS 5 mirrors which could have all i need. But what i'm wondering is what has happned to all these RPM sites with huge collections of RPM, which have been doing a damn good job by the way over the years...

Perhaps i should try my hand at creating a few RPMs on my own, and only problem there is i don't yet know how..but hey, rome wasn't built in one day, rite?

Thursday, April 10, 2008

Listen to your CPU

Listen to your CPU..It knows whats best for you. ;)

Found this cool way of "listening" to your cpu..
Try this out..and enjoy..

give the below command as root.
cat /proc/kcore > /dev/dsp

You can stop by pressing "Ctrl+C" when you are done listening.

I'm not sure weather this is good or bad for your system,
so don't blame me if you get your system screwed..i have
already warned ya.

Tuesday, April 01, 2008

AG School GNU/Linux Training Event - Day 2

The time of the writing is almost 24Hrs behind with the time of the actual event's wrapping up time.

Woke up around 6.30 and settled down to do some more of translation work. We were -as dassa, kunchana, chanux, danishka and myself spend the night at AG School, expecting suchetha and anuradha's arrival.

Suchetha arrived around 8.40 ( if i recall correctly ) and straight-away got on with his session, "Job Opportunities in FOSS".

And guess what? The audience loved it..yeah, BIG surprise there.. :)

I settled at a computer to the back of the LAB and got started with making copies of Ubuntu GNU/Linux cds to be handed out to the participants.

After the session we all went down for some tea, when anuradha arrived..at this point danishka had already left for work and rajkumar had arrived there.not exactly sure about the actual sequence though, as i was a bit hung over, i went to sleep the night before around 2.x am. :)

After this it was anuradha's session about Image manipulation/Creating HDR images which was quite good. Too bad i wasn't paying a close attention.. I think i was trying to translate something to sinhala on somewhere, not quite sure..

Sessions went on as planned and i got to use suchetha and dassa's cameras which was fun.

I thought of leaving a bit early, as i have to show up early at work the next day ( which is actually today ). Around 4.30 i left from the place, got on to a trishaw, came to the bus-terminal, caught an AC bus heading colombo.

All around the event was both fun and a new experience hanging-out-with-the-geeks-sort-of-a-thing to me.

Sunday, March 30, 2008

AG School GNU/Linux Training Event - Day 1

The 1st day of the GNU/Linux training sessions to youngsters at AG School was carried out successfully. I got a little late arriving here at Negambo, as i took ( unknowingly ) a really-really slow bus.

Got to the place around 10.45 - 11.00 , and when i got there anuradha had already finished his session.. :( . Dassa & Kunchana was carrying out GNU/Linux installation session, which was quite interesting..

Once the installation was completed, we took a little break to have lunch. After lunch, rajkumar carried out an openoffice seesion ( 1 of 2 ) with the support chanux while we( anuradha, kunchana, dassa, ravith and myself ) discussed how we can get involved, and co-ordinate our work on GNU/Linux localiztion/translation.

A Getting started guide for sinhala translators can be found here. Don't forget to check out the sinhala translation of the same post here which i just finished up translating.

Check out Dassa's Blog post too, on today's event.

Wednesday, January 23, 2008

Australian born actor, Heath Ledger dies..

http://www.news.com.au/perthnow/story/0,21598,23096402-5005361,00.html
http://www.washingtonpost.com/wp-dyn/content/article/2008/01/22/AR2008012202890.html?hpid=topnews

:( :( :(

Friday, January 11, 2008

Pledge to Be Veg for 30 Days!

I want to eat better, feel better, and stop supporting cruelty to chickens, pigs, cows, fish, and other animals raised for food. By signing my name, I pledge to explore vegetarianism for at least 30 days.

Date Signed : January 11, 2008 04:40 AM
Yajith Ajantha Dayarathna

sign this pledge!

Thursday, January 10, 2008

My Eco Resolutions for the new year...

At Home
o I unplug my mobile charger when not in use
o I don't leave electrical equipment on standby
o I never use a tumbledryer
o I give my unwanted clothes to charity
o I try to sell or give stuff away and not throw them away
o I download music & books online
o I turn off the tap when I brush my teeth
o I wash my hands in cool water rather than hot water

At Work
o I always print in low-resolution to save ink
o I use ecological paper
o I use both sides of a piece of paper
o I recycle paper
o I don't print my e-mails
o I read the news online instead of buying newspapers and magazines

Food
o I buy food that hasn't travelled far
o I buy food from the markets that is not packaged
o I wish I could buy more organic food

Transport
o I use the bus or the metro
o I don't have a car

Join me and other's at http://www.tree-nation.com