nareshovの日記

(TL note: nareshov's diary)

Archive for the ‘College Life’ Category

OpenVZ on a Softlayer managed server

leave a comment »

A post to record list of changes that were made to the configuration to get networking to work within the VZ containers on a managed hardware node.

Softlayer provisions CentOS machines with two bonded network interfaces: bond0 connected to their private network and bond1 to the public. We got a “portable” private network subnet and got them converted to “routed to subnet” so that all IPs in that subnet are usable (instead of 3 of them getting reserved into a broadcast IP, gateway IP and broadcast IP).

OpenVZ sends ARP requests when it’s trying to initialise a container and the interface to which the requests are to be sent has to be explicitly specified in this multi-network case. So, fix the NEIGHBOUR_DEVS variable in /etc/vz/vz.conf before you pick IPs from your portable subnet pool and start assigning it to your containers.

With that, you should be able to ping these containers from other nodes in your primary private subnet and vice versa. But you won’t be able to ping public IPs from within the containers yet. This doesn’t require you to assign public IPs to the containers too. A NAT rule on the host node should fix this: iptables -t nat -A POSTROUTING -o bond1 -j MASQUERADE

Took me a while to recall/realise that the lack of ARP requests in SL’s network was necessary. The NAT rule was something I found later on on the internet.

Advertisements

Written by Naresh

April 19, 2012 at 4:04 pm

Posted in LAN, Software

Using Dnsmasq to serve from a central /etc/hosts

leave a comment »

Recently at $work, I came across a situation where: a. public DNS records are served off of a GoDaddy account and b. a couple of domain names needed a office network-wide override pointing it to IPs in the local network.

i.e.

dig +short @8.8.8.8 qa.example.com

<returns public IP>

dig +short qa.example.com

<returns private IP>

If there aren’t too many consumers for this name resolution, we could’ve done with putting in entries into /etc/hosts on each consumer host. But our consumer hosts included a lot of android phones. And we didn’t want to root them all to be able to modify their /etc/hosts.

If we were running our own DNS server in our DMZ, we could’ve configured the infamous split-DNS setup through BIND or tinydns. (Un)fortunately, we didn’t.

The first "workaround" to this was to maintain a duplicate zone for example.com on our local DNS server (the one served by our DHCP server) and override the records as required. This would soon start to suck.

A colleague of mine – who didn’t take my word that the above two methods are our only options available – persevered through the PowerDNS docs and found an option where it could serve off the host’s /etc/hosts file. Now what was brilliant about this was, adding a ‘192.168.1.223 qa.example.com’ into /etc/hosts effectively solved the problem we had!

We didn’t really needed a full-fledged DNS server like PowerDNS and I looked if dnsmasq could solve the same problem – and it does.

[root@blr-vbox1 ~]# egrep -v ‘^#|^\B+’ /etc/dnsmasq.conf
bogus-priv
resolv-file=/etc/resolv.conf.isp
interface=eth0
no-dhcp-interface=eth0
no-dhcp-interface=lo0
conf-dir=/etc/dnsmasq.d

Our ISP’s DNS servers go into /etc/resolv.conf.isp

Ensure that the host that’s running dnsmasq has only ‘nameserver 127.0.0.1’ in /etc/resolv.conf and put in all your entries to be served into /etc/hosts.

Written by Naresh

December 2, 2011 at 12:12 pm

Posted in LAN, Work Life

Updates as of 3rd May, ’09

with 6 comments

Part 1

Plenty of things have happened ever since the humble beginnings of this semester that just ended with my last exam 4 days ago. Let me try summing up how things went this semester – which should’ve been my last semester here in my campus. I’m still unsure of the current state (OARS likes to keep secrets from me until a select date, what can I do?)

Right before this semester started, I remember partying* almost everyday. It was the winters I stayed back for to jumpstart on my second part of the BTP, but it turned out to lead me on a whole different path altogether. The semester starts and a few classes were attended. Soon, the “everyday partying” mode kicked back into our (the ones who were partying) lives. I’ll refrain from mentioning any detail regarding the others. This new way of life was, well, new to me. Partying everyday only to end up lethargic enough to not do anything else for almost a couple or more months during a semester – woah! How irresponsible and devoid of self-discipline I must’ve been. I was the kind of person who was largely amotivated and had no long term goals at that point. To keep up with my lethargic life and give time to partying, I cut myself off from other activities I kept myself busy with.

In the second half of the semester I had reached such a crazy state that I couldn’t sleep well without partying that night. It took me some self-realisation, re-orientation towards my purpose in being a student at this campus and most importantly, strong-minded individuals to help me get back on track. And boy was it a good one. It feels good to be reborn this way. Makes one think about the future once in a while rather than live completely for the present.

Evenings spent with a certain individual thinking back on how things went helped me reshape myself. The “everyday partying” mode that I had been in wasn’t completely a bad thing, it had its own share of pluses and minuses. The decision I made was to stick with moderation and to give up on certain things altogether. I’m just glad I’m making my own decisions. People aren’t the only things that can influence the state of mind. There are other things too.

I blame nobody at this point. It’s quite unfortunate if I’ll have to stay back in the campus for a while longer. But I’m glad I’m a different person today. On the other hand, maybe I wouldn’t have minded my “everyday partying” mode much had I been better off in life. You know? Like an owner of an island off the Pacific or something. Living my own life. But that’s not the case. I’m a student. I need to dedicate time to being one.

partying: wasn’t really celebrating anything, started off purely as a recreational activity and turned into a daily, dull-ish chore. Mind altering intoxicants were involved.

Part 2

This section is dedicated to observations I’ve been making on the people around me in this not-so-normal (temporary) human settlement. Let me list a few characteristics of the environment: The weather here ranges from one extreme to the other. Everyone gets a share of their favourite weather. Food – good for some, bad for some, unbearable for some. Totally skewed male-to-female ratio. Amotivated students. Motivated students. Good faculty. Old-school faculty. Comfort-oriented, make-lots-of-money-as-soon-as-possible kind of students. Whacky, I’m-the-next-avatar-of-Lord-Vishnu kind of students. I’m-perfectly-right-and-everyone-else-is-a-retard kind of students.

This list doesn’t end so easily. This place, as an environment to aspiring engineers, scientists and researchers, consists of a wide variety of inhabitants where plenty of them genuinely require help and constant evaluation at regular intervals to help to re-orient themselves to their true purpose in being here – as a minimum requirement. I mean, come on, this place is supposed to serve a few purposes, quite specific ones at that. Once a student is able to focus with that, if he’s got the time, he can go in directions that don’t affect his focus as much as he pleases. Actually, I’d have loved to refer to a document of sorts that lists what is expected of of a student in this campus. I’m unable to find it on the institute website and if such a document really exists, it’d be a good document to look into once in a while.

These are, at best, observations and suggestions. I don’t want to make judgments on any individual. I prefer humility and losing once in a while rather than having to go off my top and belittle a person because it didn’t fit my view of things or whatever it is that should’ve made me boil with anger or fill me with the need to “correct” a person so I can “satisfy” myself. Or maybe this is how some are accustomed to satisfying themselves. It’s pretty messy towards people who haven’t learnt to adopt a nonchalant nature when it’s called for. Washing dirty linen in the public? No thanks.

Part 3

The undergrad students in the newer batches seem to be a lot more focused compared to the ones in my batch. A friend of mine went “just as I thought” when I mentioned this to him with the anti-ragging initiatives in mind. He says (and I agree with him, empathise even) that the “ragging” sessions that take place during the first fifteen days of a fresher’s stay here is detrimental to their lives in various ways for the rest of their lives here and beyond. One of the ways in which it affects the not so careful fresher is his being accustomed to a mediochre student life. Missing classes, gaming, movies, tv series, intoxicants, and so on are some of the obvious side effects of these “interaction sessions”.

I belong to the Y4 batch and I’m in touch with students from the younger batches (Y5, Y6 and Y7). This semester (and the previous one) I happened to witness certain things that were quite different from how things used to be in the Y4 and Y5 batches. The anti-ragging initiatives were active from the Y6 batch onwards. Lucky chaps. You can see them attend a lot more (CS classes, I happen to be in the CS department so I’ll refrain from talking about the other departments – some departments are known to drive students in their final years crazy) classes, with plenty of scoring A’s and living a decent student life. Man! I wish I had been in their batch.

Things have begun to look a lot brighter now. The newer, younger faculty too are just as sincere and simply superb. It relieves me personally to think that these faculty won’t lose hope and continue to give their best in this symbiotic relationship that’s supposed to exist in this place. Had such faculty been initially exposed (and continued to be exposed for a few batches down the line) to batches such as ours who’ve been “ragged”, who knows, they might lose hope in students down the line and turn harder or rigid.

Note to self: Exercise your body (that includes your brain) regularly and stop being a prick.

Written by Naresh

May 3, 2009 at 5:51 pm

Updates as of 27th March, ’09

with 2 comments

Nothing much. Mundane. Lethargic. Hopeful. Bleak.

A few days ago, the Students’ Gymkhana in the campus came up with a somewhat “April Fool’s Prank”-like decision when they were serious about dropping Techkriti and Megabucks from the Gymkhana calendar and introducing a “techno-entrepreneurial” festival. Now, don’t ask me what “techno-entrepreneurial” is. At the moment, it sounds like certain people in the campus are catching the Capitalist world’s bugs or something. It’ll probably be a techfest like usual with some gambling in the name of “business”, perhaps. What is sad is that the name “Techkriti” shall no longer be in active use. The Gymkhana President has called for an Open-house meeting on this. I can only hope that those in power don’t kill off Techkriti so easily. Megabucks has been disappointing to some no matter what people claim and Techkriti was just hitting the popularity charts among the technical college croud in this part of the country. Sub-events like FOSSkriti have made a huge mark in the past two years and several corners of the planet recognise FOSSkriti as part of “Techkriti – IITK’s premiere techfest”. Afterall, Megabucks, too, started off as part of Techkriti back in ’98 (approx.) – if reducing the number of events per Gymkhana term is a concern, merging Megabucks back into Techkriti should surely cause less harm than blowing the daylights out of Techkriti itself?

Speaking about the number of events that are organised in the campus; IITK, primarily, is an institute of technology. Some bright young ones recently claimed that so is MIT- and yet, MIT doesn’t restrict itself to activites purely technical in nature. Sure, MIT is a huge place with a large faculty in various fields and all – and more importantly with geniunely interested students. Unlike the scenario in our campus – where research isn’t really a flagmark these days (mind you, we’ve got some excellent professors here and yet most theses or undergraduate final year projects aren’t as awesome as they are elsewhere), the activities in other larger institutes that seemingly betray their name have a good reason to be doing so – there are *people* who’re not, say, selfishly looking for personal gains alone. The local newsgroup has been pretty active at discussing these outright Talibanistic decisions that were made in the present Gymkahana’s first meet. I hope this doesn’t cause too much of a damage in the long run. Slow Talibanisation has been happening right here in the campus for a while and very few seem to notice it. Also, I seriously suggest we drop NNTP altogether and switch to reddit’s code – unless there’s a sizeable population still stuck with console-based nntp-clients.

Galaxy – a controversial event in its own right has been resurrected. Well, it’s good and all. But hey, the end-semester exams are right around the corner. But last night’s “Naruto Fan Quiz” was a welcome addition to the set of mundane events that happen in any cultural fest up here – dancing to crappy tunes, lame drama, etc. About half of L1 was filled up last night. It was a good surprise. But the anime community as such exists in fragments. Could be a good thing if the junior batches put aside differences and for a single community. Oh, but wait, I think they’re mostly fragmented because there hasn’t been enough interaction across batches in the past couple of years (thanks to anti-ragging policies which hasn’t really helped those who actually require it). Meh, whatever.

Apparently, Galaxy was resurrected in the hope that Hall days of respective halls would be put an end to. I mean, honestly, they were all a waste. Cheap, half-assed entertainment, the same old standard party food (various kinds of Indian bread, some panneer, you know, the exact same old food which people never seem to get bored of), obligatory invitations, general noise pollution, and so on. One Galaxy for a few days, in several venues throughout the academic and Outreach area, fought between teams made up of members from a bunch of halls, may not be such a bad idea.

I happened to notice a particular feature of Google Chrome (yes, I haven’t looked up the list of features of Chrome yet, and I believe that good interaction design is when one doesn’t need to go through a list or read up plenty on – at least on a browser, duh). So, here it is. You may have visited several websites that have a general search box in them. The next time you want to search something in such a box, don’t visit the site as yet. Type the URL, for example: “thepiratebay.com” and notice what appears on the right-end of the address bar.

Google Chrome search

Google Chrome: enter search keywords and hit enter

Google Chrome: enter search keywords and hit enter

Now, press TAB as it says, and enter your search keywords. Hit ENTER. Voila. Beat that fat-fugly-browsers.

Updates as of 25th Feb., ’09

with 3 comments

Hello. I’ve got some fresh news here – http://timesofindia.indiatimes.com/India/Bloggers-can-be-nailed-for-views/articleshow/4178823.cms

Getting back to the post, a lot of things, as usual, have happened in the past couple of months. FOSSKriti- IITK’s FOSS event during Techkriti was once again organised this year and turned out pretty well. Here‘s a longer account.

More interesting updates in the campus include the introduction of a modern internet service in the campus. I can now stop looking for alternatives to necessary applications with HTTP(connect) proxy support. Our campus can now boast of a 1GBps internet connection (the whole country’s bandwidth is apparently 33GBps). Back then (four years ago), we started off with a measly 2MBps connection which went higher and higher up with time – eventually leading us all to this pleasant surprise. Well, pleasant or not is another day’s debate… approx 4.5 crores p.a. for such bandwidth (turns out to about 1lac per day!).

OS update: Used Windows Vista for more than a semester, then Windows 7 Beta for about a couple of weeks or more. Now on Debian 5.

Music update: check my last.fm page.

Written by Naresh

February 25, 2009 at 5:37 pm

Updates as of 31st October, ’08

leave a comment »

Been a while since I last blogged and several things have happened meanwhile including intervals of idleness.

First, getting back on track with my final year project. I was given a last chance and I took it. Although, after having started watching Kaiji I feel like I should get really serious about it. It’s mostly system integration work and addition of a layer of easy configurability. Java work and it’s pretty interesting stuff going by the underlying technologies that are involved and why it sets itself apart from the smaller ones as an Enterprise-level software. /me points to Alfresco.

For two weeks, I’ve been suffering from an upset tummy. It’s a sad thing. Due to which, I couldn’t even attend the events at this year’s Cultural Festival (don’t ask my why “.org”, I don’t know) in my campus. Synchronicity, my favourite event in Antaragni, is a rock fest. Of course, there’s metal too \m/. This time around, around 25 bands showed up for round one preliminaries and 8 (or 9) managed to go upto round two. The finale had the best 5 from round two perform first followed by the main show by Irish band Glyder. And, yes, my stomach stopped me from staying back for Glyder and I don’t really feel like I missed it. It’s not the genre I’m into. But those two days of preliminaries and the pre-Glyder performance was something I was very satisfied with.

Antaragni is over, and so is Deepawali, the festival of lights. I had a good time that eve in my Advisor’s house. Fireworks with kids, prepared our own food, discussed some Philosophy – that was a nice family evening. Too bad I caught a cold while returning to my hostel.

Written by Naresh

October 31, 2008 at 2:40 pm

Summer 08′ Anime Season Ends

with 6 comments

Zero no Tsukaima season 3 ended a week ago. The ending looked like they were in a haste. One more episode for World Destruction and it was just getting interesting.

Soul Eater is progressing well, but currently, the fansub group that has been releasing on time for the past two weeks don’t seem to like doing the h264 encodes. Naruto Shippuuden, although out of fillers, still wastes a lot of time with people jumping around on trees.

Code Geass R2 ended today. And what an end it was. Highly recommended shows (season 1 and 2) if you don’t mind unpredictability (in other words, good suspense) and a great, thought-provoking storyline.

Incidentally, it’s midsem exams time now. I’m supposed to be busy so I’ll sign off at this point.

UPDATE: Code Geass R2’s ending isn’t as simple as it might seem. Going with the unpredictability of Code Geass and that it’s a Sunrise/Gonzo production. There’s probably more to it: http://animeotaku.animeblogger.net/2008/09/code-geass-r2-25-so-is-lelouch-dead-or-not/

Written by Naresh

September 28, 2008 at 8:47 pm