Command Line URL Shortener

On my computer, I use Gentoo Linux with KDE. If you’re a KDE user, you might be knowing that the default clipboard tool known as Klipper has the ability to execute commands when a new entry copied to the clipboard matches regex. That’s how the idea of having a handy URL shortener came to my head.

I built a small URL shortener script using Python which would accept the source URL and output the shortened URL, using my bitly.com account.

Continue reading “Command Line URL Shortener”

Advertisements

How to Change Wifi Host Name of Your Android Device

Most of the ROMs (except CM) whether it be stock or any, don’t have a setting to change the host name of your Android device. Read on to know how to change it.

When you have a common wifi network between your desktop and mobile, it rather makes sense to have a proper host name for your phone instead of accessing it every time by the IP address. This is typically useful if you want to control your phone from your control using AirDroid for example. Chat using Texts. While most routers have an option to set host name for a specific MAC ID, but on some networks you might not have control, for example your office network.

Continue reading “How to Change Wifi Host Name of Your Android Device”

Two Ridiculous Events That Happened Recently

  1. University created a form generator for generating the examination form. A friend of mine, in Third Year computer engineering with me, tells me to come with him to the lab to complete the form… because he doesn’t know how to do it! WTF!? A student of Third Year Computer Engineering doesn’t know how to complete an online form?
  2. Another friend of mine, is friends with a second year student. The second year student wants programs/notes/etc. So my friend asks me to send him that because I had them. The complete archive is on Dropbox. I told the second year guy to just put the link I’m texting him in the browser’s address bar and download the file. My friend has suspects that he won’t be able to do it (he isn’t much of a basic techno person either). And that’s what happened. My friend has asked me now to e-mail that giant archive.

And that’s the type of computer engineering students in my college.

The Flawed Evaluation System

It’s semester end again at college and we’ve got hell lots of journal-writing work. The journal-writing work is a indespsible part of every semester in Engineering, at least in my University and possibly every other University out there.

The general trend in my college, a lot different from others is – A student (usually the topper) is given the format and sample by the professors. They are then instructed to write it (we do it by hand, unfortunately), distribute their copies to friends, and the chain goes on. So basically, every student has the same journal, differing by some extent due to unavoidable errors that creep in the copy-chain and laziness.

The job of writing journals isn’t very hard that one cannot write it by using their brain, but it is a very boring task to do. Hence everyone (that includes me) refers to be somewhere in the middle of the copy chain, and never in the front. Everyone mindlessly copies the things without even thinking what they are writing in their journals – this means they even copy nonsense. But there’s one thing for sure – nobody would try (exceptions do exist, and they are of the order of 0.01%) to even understand or alter the code which was originally written.

Continue reading “The Flawed Evaluation System”

Getting CherryPy Working With uWSGI

Since Python 3 is the future, I directly started with Python 3 for my projects. While, There are some frameworks for Python 3, but I’m not a fan of frameworks. I prefer to glue the components myself and write the application – even if it involves more work and boilerplate code, and that’s because of freedom.

When you use a particular framework, you’re bound to a few rules and and modifying the behavior of the rules gets quite difficult, unless you know the framework you’re using from head to tail completely in detail. Half knowledge is very bad.

I knew about CherryPy since Python 2, and when I studied how to write applications using that, it became my favorite framework. CherryPy is basically a minimal framework, or more specifically a server which handles the common headaches that are required to do when writing a web application in Python. The common headaches are like mapping a request into Controller/Action, handling HTTP errors, authentication, etc. No, these tasks are not difficult, but are rather time consuming because of the size of the code involved.

So, why not use a pre-built framework? I’m negating my own statement, eh? Yes. In this case, freedom is not a strict requirement as much as it is required in the application logic, and CherryPy supports Python 3 – Awesomeness.

Continue reading “Getting CherryPy Working With uWSGI”