Monday, February 14, 2011

I love Conky

Okay, I realise that this is probably the millionth post on the Internet about Conky, but I just want to shout it out there: I love Conky. Conky is an incredibly customisable system monitor that allows you to display pretty much any value on your system, let it be the current track playing on your xmms2, audacious, or mpd media player, the temperature of various thermal sensors in your computer, the disk i/o, graphs, rings, or bars of your cpu, memory, disk, or network consumption... if they don't provide an option for it natively, you can always devise a method of your own by ways of the ${exec} variable coupled with a custom script. Let me just show you my desktop as of this moment:


In case you're wondering what the font was, I'm a huge fan of the Inconsolata fixed-width font. The weather data comes from a script that I made myself, mostly because I didn't know about the ${weather} option until it was too late... Oops. In any case, what it does is parse out a specific web page on the data from a weather site every 10 minutes. Overkill? Probably. Anyway, here's my .conkyrc:



Also, user chorny has provided me with a bit of help on the Pastebin API. Apparently uploading to pastebin is as simple as installing the App::Nopaste library from CPAN, something that I didn't know anything about. You can also install it as a cli command by running
sudo apt-get install nopaste
on Ubuntu.

I'm also on the market for a new keyboard because I'm really not a very big fan of the one on my Thinkpad, it's a bit cramped. I realise that Thinkpad keyboards are some of the best on the market, but I'm fairly sure that this one was not famed for its keyboard. All kinds of gunk keeps getting stuck between the keys, thankfully whenever I want to do some serious typing I switch over to my MacBook Pro, whose concave keys I find marvelous. I don't think I'd ever want to move to a Unibody model because I love this keyboard so much. Anyway, I'm thinking of buying a Das Keyboard Ultimate Silent for several reasons:
  1. A regular Das Keyboard is too loud, I wouldn't be able to do any typing during the wee hours
  2. I like the idea of having actual key-switches instead of plastic domes, plastic domes are mushy and feel like pudding
  3. It's unmarked, so I get serious geek cred for being able to type on an unmarked keyboard, and I don't have to deal with the OCD stress of using a Dvorak layout with a QWERTY layout marked on my keys.
Alright, back to studying! English exam tomorrow at 8h, AP Chem the day after that at 12h. Wish me luck!

Friday, February 11, 2011

Exams

Soo linux is looking pretty good. My .tar.bz2 archive of my partition is a grand total of 978MB, something that I'm incredibly proud of. I would have gone with Slax and have a 200MB install, but the problem with Slax is that it doesn't save you radata; it has to be manually saved into a module file. Otherwise, all data is reset upon reboot.

So should end my ranting about linux. It's time for me to panic about exams. The only exam I'm really worried about is AP Chem, other than that all should go well. All the same, I have a lot of catching up to do with Chem. As of late I have a solid B in the class, which I hear is fantastic given my circumstances. A lot of my classmates can barely pull off a B-, so given that I've managed to score a B in Chem just from flying in abroad mid-term (and mid-year) is considered a feat in and of itself. Now to bring it up to an A!! :)

I'm annoyed about the pastebin code that I published. It worked at first, but then pastebin got wise and started asking for a captcha code, which my perl script could (obviously) not decipher. So now I'm off to try and figure out a way of using curl to publish my stuff, which I'm not entralled about. At least I found out about cpan, which allows me to install perl libraries from the command line. I couldn't find a way of installing the curl libraries before, but now that I have cpan it should be a bit easier.

In case you're wondering how to install libraries using cpan, go into your terminal and type:

That code was not published using my script. I've had to go in manually and install it. I'll see if I can find the time to rework it using curl later on.

Happy studying to all! And jealousy to mes amis en France qui ont finis leurs compos. Extreme jealously.

Thursday, February 10, 2011

Perl and Pastebin.com

Yes, this is me posting at midnight. Yes, my postcount has been skyrocketing, probably because I've been trying to distract myself from the huge stress that is exams. Yes, it's working. Yes, that is bad.

Anyways, I googled around trying to look for a good perl pastebin uploader and couldn't find one, so I adapted one that I found to actually work well. It's about as simple as it gets, fellow perl readers should be able to look through the code that I'm about to paste in (thanks to my shiny new perl script). My code is far from perfect, I'm planning on perfecting it by allowing me to not have to run any commands at all, which would be great considering the fact that I'm having to generate the filename (which is currently in the format of date +%m-%d-%y.title), pipe the command to the perl script (which chops off newlines and transforms my code tags into pastebins) and upload it from GoogleCL (which, by the way, is another amazing command line tool.)

And now, the moment you've all been waiting for, my code:

Blogging from the Terminal

So I guess this would count as my second post for today, but I just found something so incredibly cool that it'll knock all of your socks off. Okay, probably not. In any case, here goes:

So I was blogging from nano today (this involved my last post in the car) when I realized (after having posted) that nano does this really annoying thing where it adds in these line breaks at certain intervals in the text when word-wrap is turned off to allow for the word-wrap to appear to work. Why use word wrap? Mainly because it bugs me to continually type all on the same line and not be able to see what I was typing a bit further up on the page. But now it's adding line breaks. What do? Well, you see, I had actually developed a perl script to get rid of these pesky line breaks and retain the double-line breaks, and thankfully because of my packrat nature I was able to recover it. Helps to be a packrat, you know?

Later on, I actually started getting into pastebin, although I can't say I'm an avid fan of using it. I mainly just realized that I could use pastebin to embed source code on my blog. Why is that cool? Well, you see, I figured that eventually I'd get into posting code on my blog, and instead of creating my own blog and developping all of those features, I can just upload the code to pastebin and use an iframe to display it. Huzzah!! So just to show it off, here's the code I used to get rid of all of those extra newlines that were in the post that I just typed:



EDIT: Unfortunately, the API doesn't like the way I code (apparently I'm supposed to use curl, but I really don't want to...), so my code is actually currently being impeded by a captcha field.

Hardly Workin'

Hey all,

So I've decided to try and make this a daily thing again. I'm typing this up on the car ride home (don't worry, I'm not driving), and I'm pretty much just trying to hang on. All of this excitement about colleges has been making me relax, for some strange reason, and now more than ever I really need to get my head in the game. My college counselor, my parents, and I all met today on where to go, and now that she's tailored my list a bit I have a bit of a better idea on what I'm going to do. Here's my new list of colleges:

- Boston College, Boston University
- Brown
- UC Berkely, UCLA
- Carnegie Mellon University
- U Chicago
- Harvard University
- Haverford College
- Macalester College
- MIT
- McGill University
- Northwestern University
- Pomona College
- Reed College
- University of Rochester
- Swarthmore College
- Trinity College
- Union College
- Washington University in STL
- Wesleyan University

...so yeah. Exhaustingly long list, I know.

Another contributing factor is this freaking Linux obsession that I've been having. I've successfully installed Xubuntu and have compositing working (Gnome-Do and Docky can actually work, huzzah), and yet it's still just not perfect for me. I tried OpenBox but I'm clearly too much of a noob to manage anything remotely non-GUI oriented, although I'm really loving XFCE. The boot and shutdown times are absolutely outstanding, and I got Conky to work with weather services and a Gmail checker. Mutt's installed, and I'm actually writing this post from Nano because I love the Inconsolata fixed-width font so much.

Finals are only in a few days... I'm kind of freaking out, even though I only have 2 exams. The funny part is that only one absolutely terrifies me, and it's AP Chem: everyone (except me, becuase I was in France at the time) got their labs back, and were subsequently moping the entire rest of the day. Apparently it was one of those assignments where getting a good grade is out of the question and you have to just hope that it doesn't hurt your GPA too badly.

Really haven't been able to get developing on PHP lately, I should start working on that again. My teacher's going to be pretty frustrated when we meet on Saturday and all I'll have done is re-written my code to have it be object-oriented. I have ban functionality working (with an awesome image, thanks Vijay!), although it really doesn't look pretty, which bugs me. I wish I didn't specialize in PHP and Perl so that I could actually design a nice frontend for this thing. That said, it didn't stop Zuckerberg... who am I to underperform Zuckerberg!?

Hope finals are going well for everybody. :)

Wednesday, February 9, 2011

Totally gave up.

Ok, so Gentoo kind of failed miserably. I'm not going to try and save face by hiding the fact that I couldn't get Gentoo to work at all, something about the X server not seeing my displays even though they were in xorg.conf and I had properly run X --configure. I'm irritated that it didn't work, but there really is no way that I'm going to try starting over with that mess all over again, so I'm going to try a different flavor that's actually at least somewhat forgiving. I've been using Zenwalk Openbox for about a day, and while I really think that it's great, it's definitely not my favorite choice. I don't know if it's the Zenwalk or the Openbox, but quite frankly it looks hideous. Despite attempts to fix this with themes and countless .conf files, it's still ugly, and I want to get rid of it. So as I'm typing this post, I just want to let you all know that I'm downloading xubuntu. Hopefully it should be light enough to not run as slowly as normal ubuntu, but it'll also have all of the commands that I'm familiar with. XFCE is annoying, so I'll be trying out Openbox for a little while before giving up completely.

If I ever have the time, I'll try moving back to Gentoo and installing Openbox. I like Openbox a lot, I just don't like not being familiar with any of the commands. I'm not a big fan of Slackware, which is what Zenwalk was based upon, so that settles that. I'll probably check out Gentoo and Openbox next weekend, after I'm done studying for exams and all that jazz. I'm definitely not doing myself any good by putting off studying for all of this Linux crap, and I'm probably wasting time now anyways by installing xubuntu and writing this blog post. But I guess it'll be a little something to do before the studying commences, which I suppose is what I've been telling myself for the past week. Mais bon, whatever. The important part is that I get studying soon, which is exactly what I'm planning on doing. Planning.

I'm also really annoyed because Gentoo took ages to compile, although I happily played along. I then complied GNOME, which took an entire evening, and then, after compiling GNOME, I realized that I hadn't compiled an X server. So I compiled an X server. The amount of time that this consumes is staggering, I never really grasped why installing programs on Gentoo took forever while installing on Ubuntu usually didn't take over a minute for most files. Does Gentoo do some funky compiling thing that I don't know about? Whatever it is, it took freaking forever, and all the time spent on it went to waste because I've erased the disk and installed Zenwalk for the time being. Pretty annoyed.

Anyways, exams are coming up and I'm getting kind of freaked out now that I realize how close they are. I really have to get studying for chem, I guess I can just use the review packet that she gave out. Thankfully I only have 3 exams, though, because I'm taking 4 classes and one of them is a project. Taking English the first day, Chem the next, and French last. Study time!!

Tuesday, February 8, 2011

Gentoo

Insistent upon ignoring Randall Munroe's cautionary tale, I've decided to go ahead and move on from Ubuntu. Ubuntu was great until I had used it for too long, which meant that I would have installed some programs without removing them, or I would muck with the system a bit and end up breaking something or other. I'm moving on to Gentoo. Or should I say, I've moved on to Gentoo. I've successfully compiled the kernel and now have a basic CLI (command line interface) upon booting up. Not too shabby. Hopefully at the end of today I'll have enough time to compile GNOME and have a full X environment up and running. So far I really like the customization options. The USE flag is basically a dream come true for me: upon the installation of a program, you choose what programs you want it to have support for. On Ubuntu, it installed support for everything, hence the speed issues.

Another beneficial factor of having to compile everything by myself is the fact that I'll be lazy about installing programs and hopefully I shouldn't install one unless I find it absolutely necessary. Of course, I'm installing a GNOME environment because I have no idea what I'd do without one. I'm still not entirely Ubuntu free, mostly because I've been spoiled rotten by GNOME-Do and Docky. I realize that not choosing XFCE probably leads to a bit of a slowdown, but I'm giving it a try anyways and seeing what it's like. One thing that I'm somewhat concerned about is the boot time, I've looked at it and it hasn't been as stellar as I would have hoped. Ubuntu was really fast. Like, really fast. Clean installations booted in less than 15 seconds. Gentoo seems to be a bit slower, mostly because the dhcpcd client keeps looking for dhcp servers on the network, of which it finds none because eth0 isn't and probably never will be connected when I start up.

Which brings me to the other issue. Wireless. I'm going to emerge wicd when I get back home today, but for now the OS doesn't allow for WPA or WPA2 wireless authentication. That said, it could have been a lot worse seeing as iwconfig actually sees my wireless card. Only time will tell, I'm still in the early stages of building it and hopefully I should have a running GUI by the end of tonight. Another concern is the fact that I'm actually doing this during the week before finals. I always seem to have these huge projects that pop up during high-stress times. Probably for distraction purposes, and I have to say it's working a little too well. Ah, well.

I really, really want a website of my own. Having a wiki would be awesome, and not dealing with Blogger would be awesome...er. And yes, in case any of you are wondering, I haven't posted to my French blog in ages. How exactly am I supposed to explain compiling a kernel in French? My vocabulary doesn't really go that far.