Ever wanted to get the MAC/IP address of your computer in a Linux shell script? The following two commands should work on most flavours of Linux/Unix

Note: It retrieves the address of eth0 interface by default. Make necessary changes as required.

IP:

/sbin/ifconfig | grep ‘\<inet\>’ | sed -n ‘1p’ | tr -s ” ” | cut -d ” ” -f3 | cut -d “:” -f2

MAC (H/W address)

/sbin/ifconfig | grep ‘eth0′ | tr -s ” ” | cut -d ” ” -f5

I was working on a project which required a simple calendar with inline edit. The calendar is for a school which marks if the day is working or not, and the comment (told ya, its very simple). Needs PHP, jQuery, jQuery jEditable plugin and a MySQL table to store the data.

The demo is here. If anyone is interested in the code, drop a comment.

P.S: Yea I suck at CSS. If anyone does a better job, please let me know.

Working on a project of considerable size will change one’s perception about coding. I happened to work on a tiny PHP/MySQL project with a team of 4 for a relatively short duration of 6 months. Before that, even though I personally followed sound programming conventions for my own convenience, I hadn’t a clue as to how important it is in a sizable project. Now that its over, I chanced to read up a little on programming conventions prescribed for various languages/projects here, here and here.

Read more

After my post about developing a new jQuery plugin, I’ve managed to shake off my apprehensions, and get it hosted on googlecode. The project is titled jGridTable, and hopefully isn’t already taken. I will dedicate a page to it in this blog, where I can keep track of day to day developments, invite comments and suggestions from people, and more importantly, ask for guidance. And if at all I get it to work, I intend to publish it with the liberal MIT license, so that others can keep improving it. My overall aim for the project is to make it as flexible as possible, without bloating up.

So here is to jGridTable. Lets see how far it goes.

After weeks of searching for the perfect grid based data editor for my project, I’ve aspired to build one myself. Sure there are hundreds of existing plugins and more which are well established, and developed by well knowledgeable folks, I find a few shortcomings. Drawing inspiration from the existing plugins, here are my goals:

Goals:

  • Uses jQuery library
  • Small and light. Size should be less than 30 KB for minified version
  • Dynamic data source for easy table population (JSON or plain HTML)
  • Create, Read, Update and Delete (CRUD) operation
  • Sorting based on columns (using tablesorter plugin)
  • Searching based on filters for multiple columns
  • Follows KISS Principal – Keep it simple stupid. No unnecessary insertion of DOM elements
  • Insertion of checkbox for each row and defining custom button to perform an action

What seems like a huge list of features add to my very basic problem : I’m still a noob at jQuery and javascript. So, as a personal goal this project is a way for me to learn jQuery right from scratch, and to put it to good use.

Methodology:

  • Study the existing plugins to understand how they work
  • Use code snippets that are already available. Reduces work, and will be much better than reinventing the wheel the wrong way
  • Less attention to appearance (CSS) till the code really works, partly because I’m still learning CSS, and would be tough to combine both jQuery and css code when I’m new to both.

As you’d have guessed, its an ambitious project for someone who is new to javascript/jQuery. Nevertheless, I hope I can pull it off with guidance from knowledgeable people who know their jQuery. I plan to host it on either github or google code and put up a dedicated page on this blog to keep track of the development. As the first step, I’ll start with defining the various functions that are required, thus creating a skeleton jQuery plugin, which simply displays a one line output when called in order (yea, I’m pathetic).

So anyone who reads this, please leave your thoughts, advice, comments here. Thank You.

    Stuff
    Everyone
    Calendar
    March 2010
    M T W T F S S
    « Jan    
    1234567
    891011121314
    15161718192021
    22232425262728
    293031  
    Rate this blog
    Clickity
    15353
Get Adobe Flash playerPlugin by wpburn.com wordpress themes