Thursday, March 7, 2013

50 Things [Reblogged]

Reblogged - is that a term? Anyhoo, came across a lovely blog post and thought I'd share it with you guys (also serves as a personal reference in this age of broken links, you wouldn't believe the amount of browser tabs and bookmarks I've lost track of).

Original source - http://mitadmissions.org/blogs/entry/50_things


Dear Class of 2010,
This will be my last entry written specifically for you; beginning with the launch of our new site in early September, I'll begin focusing on the future class of 2011. I hope that you guys won't be strangers; stay in touch either in person (come visit us!) or online (please drop by the blogs from time to time and say hi).
As you begin your college experience, and I prepare for my 10-year college reunion, I thought I'd leave you with the things that, in retrospect, I think are important as you navigate the next four years. I hope that some of them are helpful.
Here goes...



  1. Your friends will change a lot over the next four years. Let them.
  2. Call someone you love back home a few times a week, even if just for a few minutes.
  3. In college more than ever before, songs will attach themselves to memories. Every month or two, make a mix cd, mp3 folder, whatever - just make sure you keep copies of these songs. Ten years out, they'll be as effective as a journal in taking you back to your favorite moments.
  4. Take naps in the middle of the afternoon with reckless abandon.
  5. Adjust your schedule around when you are most productive and creative. If you're nocturnal and do your best work late at night, embrace that. It may be the only time in your life when you can.
  6. If you write your best papers the night before they are due, don't let people tell you that you "should be more organized" or that you "should plan better." Different things work for different people. Personally, I worked best under pressure - so I always procrastinated... and always kicked ass (which annoyed my friends to no end). ;-) Use the freedom that comes with not having grades first semester to experiment and see what works best for you.
  7. At least a few times in your college career, do something fun and irresponsible when you should be studying. The night before my freshman year psych final, my roommate somehow scored front row seats to the Indigo Girls at a venue 2 hours away. I didn't do so well on the final, but I haven't thought about psych since 1993. I've thought about the experience of going to that show (with the guy who is now my son's godfather) at least once a month ever since.
  8. Become friends with your favorite professors. Recognize that they can learn from you too - in fact, that's part of the reason they chose to be professors.
  9. Carve out an hour every single day to be alone. (Sleeping doesn't count.)
  10. Go on dates. Don't feel like every date has to turn into a relationship.
  11. Don't date someone your roommate has been in a relationship with.
  12. When your friends' parents visit, include them. You'll get free food, etc., and you'll help them to feel like they're cool, hangin' with the hip college kids.
  13. In the first month of college, send a hand-written letter to someone who made college possible for you and describe your adventures thus far. It will mean a lot to him/her now, and it will mean a lot to you in ten years when he/she shows it to you.
  14. Embrace the differences between you and your classmates. Always be asking yourself, "what can I learn from this person?" More of your education will come from this than from any classroom.
  15. All-nighters are entirely overrated.
  16. For those of you who have come to college in a long-distance relationship with someone from high school: despite what many will tell you, it can work. The key is to not let your relationship interfere with your college experience. If you don't want to date anyone else, that's totally fine! What's not fine, however, is missing out on a lot of defining experiences because you're on the phone with your boyfriend/girlfriend for three hours every day.
  17. Working things out between friends is best done in person, not over email. (IM does not count as "in person.") Often someone's facial expressions will tell you more than his/her words.
  18. Take risks.
  19. Don't be afraid of (or excited by) the co-ed bathrooms. The thrill is over in about 2 seconds.
  20. Wednesday is the middle of the week; therefore on wednesday night the week is more than half over. You should celebrate accordingly. (It makes thursday and friday a lot more fun.)
  21. Welcome failure into your lives. It's how we grow. What matters is not that you failed, but that you recovered.
  22. Take some classes that have nothing to do with your major(s), purely for the fun of it.
  23. It's important to think about the future, but it's more important to be present in the now. You won't get the most out of college if you think of it as a stepping stone.
  24. When you're living on a college campus with 400 things going on every second of every day, watching TV is pretty much a waste of your time and a waste of your parents' money. If you're going to watch, watch with friends so at least you can call it a "valuable social experience."
  25. Don't be afraid to fall in love. When it happens, don't take it for granted. Celebrate it, but don't let it define your college experience.
  26. Much of the time you once had for pleasure reading is going to disappear. Keep a list of the books you would have read had you had the time, so that you can start reading them when you graduate.
  27. Things that seem like the end of the world really do become funny with a little time and distance. Knowing this, forget the embarassment and skip to the good part.
  28. Every once in awhile, there will come an especially powerful moment when you can actually feel that an experience has changed who you are. Embrace these, even if they are painful.
  29. No matter what your political or religious beliefs, be open-minded. You're going to be challenged over the next four years in ways you can't imagine, across all fronts. You can't learn if you're closed off.
  30. If you need to get a job, find something that you actually enjoy. Just because it's work doesn't mean it has to suck.
  31. Don't always lead. It's good to follow sometimes.
  32. Take a lot of pictures. One of my major regrets in life is that I didn't take more pictures in college. My excuse was the cost of film and processing. Digital cameras are cheap and you have plenty of hard drive space, so you have no excuse.
  33. Your health and safety are more important than anything.
  34. Ask for help. Often.
  35. Half of you will be in the bottom half of your class at any given moment. Way more than half of you will be in the bottom half of your class at some point in the next four years. Get used to it.
  36. In ten years very few of you will look as good as you do right now, so secretly revel in how hot you are before it's too late.
  37. In the long run, where you go to college doesn't matter as much as what you do with the opportunities you're given there. The MIT name on your resume won't mean much if that's the only thing on your resume. As a student here, you will have access to a variety of unique opportunities that no one else will ever have - don't waste them.
  38. On the flip side, don't try to do everything. Balance = well-being.
  39. Make perspective a priority. If you're too close to something to have good perspective, rely on your friends to help you.
  40. Eat badly sometimes. It's the last time in your life when you can do this without feeling guilty about it.
  41. Make a complete ass of yourself at least once, preferably more. It builds character.
  42. Wash your sheets more than once a year. Trust me on this one.
  43. If you are in a relationship and none of your friends want to hang out with you and your significant other, pay attention. They usually know better than you do.
  44. Don't be afraid of the weird pizza topping combinations that your new friend from across the country loves. Some of the truly awful ones actually taste pretty good. Expand your horizons.
  45. Explore the campus thoroughly. Don't get caught.
  46. Life is too short to stick with a course of study that you're no longer excited about. Switch, even if it complicates things.
  47. Tattoos are permanent. Be very certain.
  48. Don't make fun of prefrosh. That was you like 2 hours ago.
  49. Enjoy every second of the next four years. It is impossible to describe how quickly they pass.
  50. This is the only time in your lives when your only real responsibility is to learn. Try to remember how lucky you are every day.

Be yourself. Create. Inspire, and be inspired. Grow. Laugh. Learn. Love.
Welcome to some of the best years of your lives.
-B

Sunday, December 16, 2012

Reference for some nifty Linux tricks

CLI is fun, but the commands can be a bit of a pain to remember. Here's some stuff I'm writing for my own reference, but it might be useful to you too.

1. Create a disk image

dd if=/dev/sda of=<fileName>

Web references also specify block size etc, but I didn't need them, apparently.

2. Mount that disk image

mount -o loop,offset=$START*512 -t [auto|FSType] /path/to/image /mount/point

loop - used to mount files as block devices or something

$START - the start value of that partition in fdisk -l or fdisk /path/to/image

3. Turn screen off (as in power save mode)

xset dpms force off
xset dpms force off; xscreensaver-command --lock #[Locks screen also] 
 
 
4. Find the process using a file

fuser /dev/sda3
fuser /path/to/file

 
5. Spindown your HDD (eject from nautilus doesn't work)

Obtain the sdX->sgY mapping
sg_map

sdparm -C stop /dev/sgY

6. Install Ubuntu on newer UEFI systems along with Windows 8.

Ok, so Wubi won't work on the newer UEFI-enabled systems. So don't even bother. Either use Ubuntu as a Virtual Machine (tsk tsk...) or follow this guide.

http://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-supported

Thursday, November 8, 2012

Operating Systems!


This post is intended to serve as an archive for various interesting links/references/sources I come across while doing OS assignments or other stuff. I hope you find these as useful as I do. Most of these were (shamelessly?) copied from the first page of Google search results (as someone said, the best place to hide a dead body is the second page of Google search results).

http://stackoverflow.com/questions/1401359/understanding-linux-proc-id-maps

http://tcpdumper.blogspot.in/2009/05/minor-fault-vs-major-fault.html (Good for VM basics)

http://igor.chudov.com/tmp/LinuxVM/html/understand/node35.html (Good link for page faults, but there seems to be lots of documentation on other aspects as well)

http://condor.depaul.edu/slytinen/373f12/l1.html (Nice notes, I guess)

Note to self: awk '{ print $1 }' - double quotes won't work, printf won't work, add awk to to-learn list.

11/11/12

Just came to know about a tool/lab assignment called Buffer Bomb. It's based on buffer overflow attacks, and apparently, is a standard assignment/activity at many universities. Kind of puts into perspective the number of things IIIT's Operating Systems course is missing.

Useful resources:

https://docs.google.com/viewer?a=v&q=cache:M6bI62pfENkJ:condor.depaul.edu/glancast/373class/docs/lab3.pdf+&hl=en&gl=in&pid=bl&srcid=ADGEESiOjL7s9ZC3Wx_-6ndlBiWvXB9QqWkHMP9qE27Xjirgnl48tHErHkqoX2apzmCejB32039mvDQAZ_T8o26PSVxh8SHe7_VMRHFy8i_3Q4QWazGafmLK9Iw3CT6kO6fiM5Grupj5&sig=AHIEtbQV86i2aX_1ZbcQ68rngusq_kF2TA

http://www.ricera10.com/wordpress/?p=2516

http://conniefan.com/tutorials-labs-from-computer-systems.html

http://www.cs.rochester.edu/u/scott/252/assignments/A3.shtml

 ------------------------------------------------------------------------------------------------------------------------


Monday, June 4, 2012

Tackling Ubuntu installs for dv6 users - part 1

In the last 6 months, I've seen a lot of people buying HP dv6 laptops. HP has had a bad reputation with laptop buyers with all the heating problems and other issues, but it seems to have hit the bulls eye with the newer dv6s. Newer models arrive frequently, and are quite a bit of improvement over the older ones. The dv6 6012tx, for example, made a major leap in sound quality, and I would rate its sound almost as good as the XPS's famed JBL speakers (yep, it's that good). With all the hardware improvements, care packs (extended warranty packs) that cost half as much as Dell's, and a much sleeker profile, the dv6 has emerged as a solid alternative to the XPS.

(PS: I can't vouch for HP's warranty quality, but I know for a fact that Dell's is downright awesome. They are more than happy to change parts, whatever the reason for failure be. However, seeing that I spilled lassi on my lappy's keyboard, causing 4-5 keys to stop functioning, a review on HP's after-sales service will be up shortly). The only thing that disappoints me in the newer dv6 7000 series is the switch from AMD Radeon 6770M in the i7 model to nvidia 630M. Granted, nvidia's switchable graphics implementation (called Optimus) is much better than AMD's. Getting AMD cards to switch smoothly can be a pain in Linux, which is what this post is all about. But the 6770M is a solid mid-end graphics card, ranking 82nd on notebookcheck's mobile graphics rank lists, whereas the 630M is decidedly mainstream at a rank of around 112.

Anyway, if you are a new dv6 user who plans to install Ubuntu, you'll have a fair share of problems, more than XPS users anyway.

First, you'll have to deal with HP's ABSOLUTELY HORRIBLY HORRENDOUSLY (DIE, YOU PARTITION SCHEME DESIGNING BITCH AT HP!!!) CRAPPY partitioning scheme. HP saves the average noob the trouble of evaluating a different OS, because he won't be able to make an informed choice on how to re-partition his system. Here's HP's partitioning scheme found on all dv6s. It consists of four primary partitions (which is the maximum number of primary partitions allowed on a hard drive).

1. (<100 MB) Bootloader partition - This one contains files required by Windows at the time of boot.
2. Windows partition - it contains the Windows install and most of the empty hard disk space.
3. (~14GB) Windows recovery partition - it contains files needed to restore Windows to a factory state in case you've screwed up with your current install. It can also be used to create recovery DVDs (only one set of such DVDs can be made).
4. HP_TOOLS (<100MB) - This partition is required if you need to upgrade the BIOS. If you download and run the BIOS setup from HP website, it places new files in this partition, and these files are detected by the OS on restart.

If you want to install another OS, you need to get rid of one of these partitions, since there is a limit of four primary partitions per hard drive.

In my opinion, the HP_TOOLS is the most expendable since it's easy to restore it in case a newer version of the BIOS with some major feature is released. First, make sure you've installed the latest BIOS available on the website, and then you can remove this drive. Some people prefer to create recovery DVDs and then remove the recovery partition, but I don't trust optical disks. IMO, they're too fragile and prone to environmental factors. Plus, the convenience of having a recovery partition on the hard disk in unmatched. Although, you can not combine the 100MB you gained by removing HP_TOOLS with the space recovered by shrinking the Windows partition. Which means that that 100 MB as good as gone, small price to pay for the freedom to install any OS.

Anyway, you can then shrink the Windows partition by some suitable amount - I prefer about 40GB for Ubuntu. I also suggest that you mount /home and / on separate logical partitions. It comes in handy when you're testing multiple distros. After that, it's quite easy - installing Linux is a breeze once you figure out the partitioning scheme, even if tweaking it to get all hardware working is not.

That's it for this post. In the next post, I'll outline how to switch off that darned discrete GPU by installing the fglrx driver.

Sunday, May 13, 2012

youtube-dl - a CLI script for downloading streaming videos

Yes, I've been lazy and negligent about updating this blog, but then, that's the story of personal blogs worldwide.

Anyway, this one's gonna be short and quick. I just found out a Python-based script youtube-dl to download youtube (and other supported) videos via command line.

You can get it here:

http://rg3.github.com/youtube-dl/

The syntax is pretty simple, once you have added executable permissions to the script (requires Python 2.5 or newer):

./youtube-dl <Web URL here>

Or you can check your official repositories for a package called 'youtube-dl'.

There're a plenty of tools/addons/websites available online, and most of my batchmates have their own versions of youtube downloaders to their credit, so why this post?

1. Apparently, with browser/OS/whatever updates, the older method of copying the streamed video from the file descriptors (/proc/*/fd/*) doesn't work.

2. This thing does not use the 'saving streamed content' concept. It *somehow* obtains a download link by itself. And it's written purely in Python. Understanding how it works could help you in clearing a lot of concepts. (Fair warning though: it's a 4500 line code, and most of the modules used are unheard of, to me. This one's not for the weak at heart.)

3. If you just wanted a method to get it done, and are least interested about the inner workings of such utilities, I'm sorry - you're looking at the wrong blog.

Tuesday, December 6, 2011

Plans and dreams

There was a time when I thought no ordeal could be as taxing as hearing Rebbecca Black singing (Justin Beiber came very close). I was naive.

My college loves its Humanities. The people here believe that making kids go through weird and complex moral science stuff, where most of them are - if not physically - mentally asleep is supposed to help them in later life. And at the end of first sem, you have a hardcore 4 day/36 hours Jeevan Vidya camp which is basically a crash course on the "weird and complex moral science course". One thing's for sure, the topics discussed, their absolute irrelevance, the mental exhaustion that accompanies them, the lack of sufficient time to have fun just after end-sems, seems like the type of thing Kingfisher would sponsor to get students drinking. (Well, you can't find Vijay Mallya for plotting evil schemes to get his babes, he already has a hard time maintaining his planes).

On a more relevant note, I have plans for two projects I hope to execute in near future. A portable USB charger, and a notebook cooler (both DIY, d-uh).

For the uninitiated, DIY means Do it Yourselves. DIYers believe in trying to do their stuff themselves before handing it over to professionals. If you can't figure out what's the fun in that, it's probably not for you.

None of the devices mentioned require any extreme engineering. Equipment, maybe. Lack of which may prevent me from actually implementing them.

The portable USB charger would run of batteries and charge any USB powered device. No biggie - just connect a 9V battery to a 7805 and connect the output to a female USB port. You could add capacitors to both the input and output to handle any spikes that may occur. Problem? A 9V battery can't deliver a lot of current - barely enough to keep the battery level constant. And I have a feeling that it won't be very sufficient - a 500 mAh battery would only charge 1/3rd of my phone and then drain itself. Still a handy accessory, I suppose.

The laptop cooler project is also pretty simple. I've been feeling the need for one when I put my lappy through heavy workload - gaming being one of them. I just need to get 2 fans that run off 5V and join them to an acrylic sheet. The power comes from USB ports.  Lock and load. Problem? I don't have a Dremel. Again, for the noobs, Dremel is the god tool for any kind of DIY/modding. In one line:-

Grinder : Super Food Processor :: Drill : Dremel

It's expensive too. Last time I checked, it started from 4k, and has a lot of accessories available which seriously affect your wallet.

I also learned some things about game ripping from a friend of mine - Nehal. He created a game rip in Class 9! Beyond awesome. Turns out it just involves re-encoding the audio files to ogg and reducing the bit rates and compressing them. You create a batch file that automatically reverses the process which you call your setup file. And it produces pretty awesome compression results too. And I've been told that the difference between sound qualities of the original and compressed audio files is barely audible. Of course, this only works for games which do not use proprietary formats/advanced protection techniques. UHARC is the most popular and a very powerful compression tool. Command line version FTW. You also need to have a good understanding of Windows Command line scripting. I hope to try out a game in a day or two.

Hopefully, by the next, or the next-to-next post I'll have something more concrete than wild theories and plans. See ya around.

PS: Two days to train, and 4 days to home. Hurray!!! Can't wait to drive the PB**AE-5**6 (My Activa). I also plan to buy skates (confused between roller and inline). Any advice? Leave in the comments below.

Wednesday, November 30, 2011

Of tablets and gates

Good Mornin', fine folks. It's 6 am and I'm awake. Wide awake.

I've been seeing a lot of 6 ams lately. Not because I wake up early, but became it's usually the time I sleep. Not today, I have a DLP exam in 3 hours - and I'm hungry as well. One of the bad things about IIIT is the lack of eating options from 2 am to 12 pm, excluding the morning breakfast.

Anyway, since this blog is supposed to be more tech-oriented than a personal diary rant, I'll talk about the Aakash tablet in this post. We had Prof. Vijay from IIT Rajasthan visiting the institute yesterday. He gave a brief introduction of the tablet (which I missed, thanks to me assuming that events in IIIT will be their usual unpunctual self, and reached 30 minutes late). And then there was a hands on demo. I couldn't lay my hands on the device.

I did, however, stay for 30 minutes after I came, and observed. The tablet hardware is nothing to write home about, a 350 Mhz Conexant processor, a 840x400px screen and other standard stuff - nothing amazing. What's amazing is that they managed to produce these devices for ~Rs. 2,000. That's one-fifth the price of the cheapest tablet I know of, the Kindle Fire. The government isn't wrong in prioritizing arming citizens with productive tools over a Super AMOLED+ screen. If you're keen to know - the touch was pretty basic (resistive) and the screen looked somewhat washed out.

From what I saw and heard, the professor who came for the demo wasn't very well-versed with the tablet and it's development. I'd have loved to ask him if the tablet would allow me to play with custom ROMs, but he didn't seem the right kind of guy to ask. Let's hope Koush and other fine folks at xda-developers get interested in this device and at-least, figure out how to unlock the bootloader. I love playing around with my Nexus S - it's currently running on a custom ROM, Cyanogen Mod 7.1 - but for a newb like me, risking a 20k phone is pretty scary.

That reminds me, I'll put up a blog post on rooting my Nexus S sometime soon. I know I promise a lot that I fail to deliver, but my end-semester exams are almost over (the last exam is Computer Programming, and there's not a lot to study in it).

Wish me luck. Good day!

EDIT: I also had some thoughts on startups I want to share - I saw the guys from MyDrona (a IIIT startup) talking to the prof after the interaction. Maybe sometime later. :). This was more of a personal reminder.

PS: Don't count on the specs and stats used in this post to be accurate. This is not a news report. They're approximate enough to convey the feeling/idea.