Site Moved

This site has been moved to a new location - Bin-Blog. All new post will appear at the new location.

Bin-Blog

Using Twitter, Part 2 - The Use of Twitter

Why do one use twitter? Why do you have to inform others about what you are doing? There are many answers to this question.

Intermittent variable reward

Kathy Sierra is of the opinion that a 'slot machine' like reward system exists for twitter users. That is, they get a reward sometimes(not always) - so they keep on using the system for that reward.

Addictive

Many people have described twitter as addictive. But, I still have not found it addictive - I only remember to make an update once in a while. Maybe that is because I have turned off the IM feature.

Keeping in touch

A lot of people have said that they can keep in touch with their friends using twitter. This reason is not for me. I am a geek. And by definition, I am a loner(or was that 'nerd' - I get those two confused). So, I don't what to be connected with others - if anything, I want to be disconnected from them.

Keeping track of Time

Twitter can be used to keep track of your activities. But it is not a tool made for this - so it is very limited for this purpose. But, this is the reason why I use twitter.

Ever since I resigned from my job, I have been noticing a huge time leak. I cannot understand how my time is disappearing - but it is doing that with great efficiency. So I have turned to twitter to make things better.

More on this topic in the next post.

Read More...

Using Twitter, Part 1 - Command Line Twitter Client

You may have heard of Twitter - if not, it is a microblogging platform that allows members to tell each other what they are doing and what they think. There was a huge buzz about twitter recently - made me create an account on twitter. I tried to post through the web interface - but that's not a very intuitive method. The IM method is much better - but it almost never works. So I ended up making another method - the CLI method. Or twittering using the Command Line.

Before going any further, let me say that this method is for Linux. You can use this method in windows as well - but you have to install the windows port for curl. Even if you manage to get this method to work on windows, most of the major advantages of this method will be lost.

This SxSW was huge for twitter - not only did it win the 2007 South by Southwest Web Award, they also got a lot of new members. But lately it is getting some negative reviews as well.

Quick Posting

One of the main feature of twitter is the fast publishing time. You type something into a text box and click submit - and the stuff is published. That's fast! The only problem is that you need to open a browser and type in the URL to get to that text box. I need something faster. The IM method is a bit faster - but it rarely works. This situation will change in the future - but I don't want to wait.

The fastest method I can think of is like this - I press a keyboard combination and an small text box opens up. I type in the status and press Submit and this application will post the data to the twitter site using the Twitter API. The only problem is there is no such application. That's when I decided to do something about it. Of course, I am too lazy to create an entire application for it - so I had to settle for the next best method - posting from a terminal.

Posting from a Terminal

I have configured my system to open the Terminal(konsole) when I press Ctrl+Alt+A. Now all I have to do is create a command, say, 'twitter' that will publish the command line arguments to the twitter site. My input will be something like this.

Ctrl+Alt+A
twitter "Using the CLI Twitter client"

That's fast enough for me.

Twitter API

To create the script, I took a look at the twitter API...

All of the methods (except for the public timeline) require user authentication via Basic Auth. The username is the email address you have stored on Twitter, the password, your password.

....

Updating your Twitter

Done with a HTTP POST using the "status" parameter. status=Walking the dog.

  • http://twitter.com/statuses/update.json
  • http://twitter.com/statuses/update.xml

The simplest API I have ever seen.

Curl

After I saw that API, I realized that I don't need to do any coding to create the application - I just need to use the curl command. curl is a tool to transfer data from or to a server. All I have to do is execute this command...

curl --basic --user "<User>:<Password>" --data-ascii "status=<Twitter status>" "http://twitter.com/statuses/update.json"

In my case it will be

curl --basic --user "binnyva:******" --data-ascii "status=Using Twitter from command line" "http://twitter.com/statuses/update.json"

The Twitter Shell Script

But I don't think you would like to type all that everytime you want to twitter. So we have to put it into an executable file. Also, we have to modify the script to enable the support for command line arguments.

curl --basic --user "<User>:<Password>" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json"

Replace the <User> and <Password> with your twitter user id and password. Now save the text to a file called 'twitter' and give the file execute permission. Put this file in any folder in your path(like /usr/local/bin or ~/bin)

Using Twitter CLI

Just call the command with your message as the argument - like this

twitter Writting Content for Bin-Blog about twitter.
twitter "Using Twitter CLI"

For best results, enclose the message within quotes. This will prevent problems when using wild card characters like '?'

Twitter Users

Before I leave, how many of my readers are twitter users? OK, you three - leave a comment with your twitter ID. By the way, I am binnyva.

Another thing - this script is thrown together in a very short time - is there a better, more foolproof way of doing this? If you know one, leave a comment.

Read More...

Saving Code Snippets - Part 2

Fileing

In the last post, we saw various methods of storing text snippets. Each of the discussed methods had its advantages and disadvantages. I could not use any of those methods. But eventually I found one method that was perfect. It was WordPress.

My requirements for a text snippets storing system are simple...

  • Must be able to store text snippets (Duh!)
  • Searchable
  • Tagging support
  • Easy to use interface
  • Backupable

After looking at the list for a few moments, I had an epiphany. I don't need a custom solution for this problem - all I have to do is make a few adjustments to a system I am already using. I already have experience using WordPress - so there is no learning curve.

So, I created a new domain and installed WordPress using Dreamhost's One Click install system. I made a few adjustments to the default configuration, installed a few plugins, customized the theme - and I have a shiny new site...

txt - Text Snippets collection of BinnyVA

Go on, click on that link and play around on my Text Snippets collection for a while - I'll wait.

Storing Text Snippets using WordPress

Advantages

New Site
You have a new site which will be updated frequently - without having to put much effort into it. Another plus point is that your collection is useful for others also.
Stable/Supported Platform
WordPress is an industry standard Platform - used by thousands of people world wide. If you run into a problem, you will be able to get help.
Open Source
You can modify the software - and make it 'just right' for your need.
Offline Access Possible
Just install the WordPress on your system and sync the database once in a while.
Multiple Clients can be used
You are not forced to use the WordPress's web interface to add/edit snippets - there are a lot of clients that support WordPress. I prefer ScribeFire(was known as Performancing earlier).

Disadvantages

  • Added overhead of managing a new site
  • Need Hosting
  • Need net access
  • Need a web/database server for Offline site
  • The purpose of the tool is different

Tagging Problem

There was one problem associated with using WordPress for this purpose - tagging. Sure, you could use categories to tag each snippet - but that is nowhere as intuitive as, say, tagging on del.icio.us. To add a new category, you have to use a separate text field - instead of just typing it after a ','. That is when I found out about a great WordPress plugin - Ultimate Tag Warriors.

Ultimate Tag Warrior

Using Ultimate Tag Warrior you can tag your post with multiple tags. These are completely independent of the 'Categories' feature of wordpress. Two important features for this plugin makes it perfect for our purpose.

Friendly Link support

del.icio.us style links makes it easier for us to find the snippets later on. For example, the URL for all the text snippets with the tag 'perl' is http://txt.binnyva.com/tag/perl.

Can embed tags inside the content

You can specify the tags within the content of the post - you are not forced to use the web panel's tags field to do it. This makes it possible to tag the text snippets even if you are posting from a client.

All you have to do is is enclose the tags within '[tags]...[/tags]'. For example, say you wish to tag a snippet, with database, mysql, sql. So you put this at the end of the snippet...

[tags]database, mysql, sql[/tags]

txt

My Text Snippets collection site have been running for two months. As of yet, I don't have a single complaint about it. In my opinion, this is the best method to store text snippets. If you know a better way of doing this, please let me know.

Most of the saved snippets on txt are Linux Commands. There are some code snippets as well. This is a site where I store script snippets, Linux commands and other such tidbits of information. The posts will be minimal and often crude.

Before leaving you, I want to highlight some cool snippets in that site...

And for Linux users...

Read More...

Saving Code Snippets - Part 1

All programmers have their own ways of storing useful code for future use. Some don't do anything special for it. They can remember which project they had used the code - all they have to do is call up the source code for that project, search around a bit and they have the code they wanted. I used to be in this class - but now, I have too much projects and too much code for that to work. So I am exploring alternative methods to do this.

Text Files

The simplest methods are often the best - storing all the text snippets as text files. You can arrange it into folders for easier management. I have tried this approach - but it did not work for me. Searching gets a bit hard after some time. Another problem with this method is that the data is limited to one computer - you will have to carry all these files around if you want to use it in other systems.

Single Text file

You can save all the code snippets in one big text file - this will make searching easier. Another advantage of this method is that you can carry this file around - so it is more portable approch. I have not tried this method - if I find multiple text files hard to manage, there is no way I can do it with a single text file. But there are people who have done it - and swear by it.

Single (Some format) File

You don't have to use text - you can use excel or LaTeX or some other format to store everything you need in a single file. As long as the data is findable, its possible.

Special Application

There are many applications that can be used to store text snippets. I have not used any applications for this purpose - so I cannot recommend any specific tool. I am sure that a google search will reveal many such software. In Linux, you could use KJots and BasKet to do this. Do you know any application that could be used for this?

Database

If you have done a bit of Database Designing, I am sure you are already working on a design to store the code in a Database - locally or on the web. This method will involve making an interface to input, search and display the snippets as well. If you are using a database like Access, you can use the 'Forms' feature to do it. But if you are using MySQL, SQLite or something like that, you may have to create a custom application. This could be a web application or a desktop application. I almost went this way - but my work with Nexty prevented me from doing much.

Online Services

There are sites that could be used store snippets. One such site is Text Snippets. It supports all features necessary for storing code snippets -

  • Syntax Highlight for the code
  • Easy Interface
  • Tagging
  • And more..

I tried it out - but did not find it very useful...

  • The Syntax Highlighting expects all code to be in ruby
  • No way to backup the data
  • You have to use the web interface to enter the data.
  • No way to get the data if you are offline

Other sites that could be used to do this are...

And the best method is...

I tried most of the above methods - but none matched my requirements. After much searching I found a method thats perfect. I will talk about that in the next post.

Update : Saving Code Snippets - Part 2 Ready!

Read More...

Little Flies...

I know I don't put comics in this blog - but there is a first time for everything. A comic from bLaugh...

No Need to be Concerned, Little Fly

From now one, I am going to reffer to all my clients as 'Little Flies' *Insert evil laugh here*.

Filed Under...

Read More...

Find the Dreamhost Server hosting your site

Dreamhost use multiple servers to host the sites of its customers. If you have been using their service, you would know the name of your web server. If you have been praying for the servers to come back up(as I have been doing) during the recent outage, you will know the name of your Web Server, MySQL server and the Email Server.

If you are using Dreamhost and you still don't know the names of the your servers, there is still hope. Some ways to find the names of your servers...

Control Panel

Your server's details can be viewed in the 'Account Status' tab in the newly redesigned control panel. Just log in and click the 'Account Status' tab in the upper right corner.



Ping

If you just want to know the server name of your web server, just ping the domain. The results for OpenJS.com (emphasis mine, obviously)

$ ping openjs.com
PING openjs.com (208.113.136.27) 56(84) bytes of data.
64 bytes from basic-dap.mento.dreamhost.com (208.113.136.27): icmp_seq=1 ttl=54 time=303 ms

hostname

Another method to find this name is to log into the ssh account and run this command...
$ hostname
mento

Server Information

The different servers in Dreamhost - and their configurations...

Read More...

Quitting the Job

After two years, I have decided to leave Reubro International. I joined there around March 2005 as a Perl Developer. In the time I spend there, I learned PHP, Advanced JavaScript, Advanced CSS - even a bit about Database designing and server administration.

Learning New Things

There is too many things I learned while I was there - too many to list here(two years is a long time). But lately I am finding that instead of helping me to learn new things, my work is negatively affecting my ability to learn new stuff. A lack of time is the formost problem. I have reached the conclusion that the only way to learn new things is to lose the job - and that is exactly what I did.

I have a huge list of stuff to learn - which includes - but not limited to...

So, expect some posts about these subjects here.

Getting Things Done

I have a lot of entries in my ToDo List - things I never had time for before. Time to get them done. Stuff like...

More Content

With all this free time, I should be able to produce more content. So expect a jump in the frequency of posts in this blog and my other sites. Maybe even a new site.

Freelancing

I have a decent income from Google AdSense. I also have a couple of other revenue streams. So I am not looking at freelance projects right now. Maybe after a few months.

In Short...

In short, I had a great time at Reubro. I met a lot of great guys. I learned a lot. And I understood that Corporate life is not for me. And like many others, I chose unemployment over working at a company.

Oh, and by the way, the 'official reason' for leaving is 'Excessive Eye Strain'. Happens if you spent over 15 hours a day staring at a monitor.

So, what do you think of my decision? Good? Bad? Stupid? Leave a comment and let me know.

Read More...

Subscribe to : Posts