Empty a file

2010-12-26 1 min read Learning Linux
Screenshot of Calculator.NET, a Free Open Sour...
  <dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">
    Image via <a href="http://commons.wikipedia.org/wiki/File:Calculator.NET_Screenshot.png">Wikipedia</a>
  </dd>
</dl>

This one is for those who know the “touch” command. Hope all of us do not follow a  command just because it is on one of the popular site without trying to understand the command and the output.

Continue reading

Repeat a portrait eight times so it can be cut out from a 6″x4″ photo and used for visa or passport photos

2010-12-17 2 min read Learning Photo

Repeat a portrait eight times so it can be cut out from a 6″x4″ photo and used for visa or passport photos

  <td>
    <div class="text codecolorer">
      montage 2007-08-25-3685.jpg +clone -clone 0-1 -clone 0-3 -geometry 500 -frame 5 output.jpg
    </div>
  </td>
</tr>
1

Yes, You could do it in the GIMP or even use Inkscape to auto-align the clones, but the command line is so much easier.

Continue reading

intercept stdout/stderr of another process or disowned process

2010-11-23 1 min read Bash Fedora Linux

The command is definately going to save your day if you have disowned the process by mistake. Only uses strace so might as well work on Solaris also, though not tried it.

intercept stdout/stderr of another process or disowned process

  <td>
    <div class="text codecolorer">
      strace -e write=1,2 -p $PID 2>&1 | sed -un "/^ |/p" | sed -ue "s/^.{9 }(.{50}).+/1/g" -e 's/ //g' | xxd -r -p
    </div>
  </td>
</tr>
1

Useful to recover a output(stdout and stderr) “disown”ed or “nohup“ep process of other instance of ssh.

Continue reading

Using SQLite to maintain your monthly bills.

2010-08-24 6 min read Linux

I was looking for a small application to maintain my every month bills. The application had to be small and script-able. I basically wanted to keep track of the bills that have been generated and pending payment and the bills that have been paid.

First we will create the <a class="zem_slink" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database">database schema with the following command:

  <td>
    <div class="text codecolorer">
      CREATE TABLE bills(name varchar(20), due_dt text, p_dt text, amount integer);
    </div>
  </td>
</tr>
1

So, I built on the knowledge gathered on <a class="zem_slink" title="SQLite" rel="homepage" href="http://sqlite.org/">SQLite. And here is a small script that I wrote:

Continue reading

SQLite – simple use in scripts

2010-08-21 1 min read Database Linux

Today we will look a the most simple use&#8217;s in the scripts and how to use them.

echo &#8221;insert into bills values (&#8221;$name&#8221;,$date_now, $date_now,$1)&#8221;|sqlite bills

or the other way to do this is

<a class="zem_slink" title="SQLite" rel="homepage" href="http://sqlite.org/">sqlite3 bills &#8221;insert into bills values (&#8221;$name&#8221;,$date_now, $date_now,$1)&#8221;

OK, now in the next post we will see a simple application that I am currently developing or planning.<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://tobu.lightbird.net/">Tobu Tutorial (tobu.lightbird.net) <li class="zemanta-article-ul-li"><a href="http://go.theregister.com/feed/www.theregister.co.uk/2010/07/02/openoffice_adopts_gstreamer/">OpenOffice gets Ubuntu-media friendly (go.theregister.com) <li class="zemanta-article-ul-li"><a href="http://elegantcode.com/2010/07/02/using-transactionscope-with-sqlite/">Using TransactionScope with SQLite (elegantcode.com) <li class="zemanta-article-ul-li"><a href="http://www.slideshare.net/aikisteve/flash-and-the-city-2010">Flash And The City 2010 (slideshare.net) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=7b7c893c-d92b-44bc-8923-d7c6fddc8b42" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">

Continue reading

SQLite : Manager for this simple database

2010-08-19 2 min read Database Linux

We will look at sqliteman – <a class="zem_slink" title="SQLite" rel="homepage" href="http://sqlite.org/">SQLite Database manager.

If you are looking for a tool for tuning <a class="zem_slink" title="SQL" rel="wikipedia" href="http://en.wikipedia.org/wiki/SQL">SQL statements, manage tables, views, or triggers, administrate the <a class="zem_slink" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database">database space and index <a class="zem_slink" title="Statistics" rel="wikipedia" href="http://en.wikipedia.org/wiki/Statistics">statistics then Sqliteman is the perfect choice.
If you are looking for a <a class="zem_slink" title="Graphical user interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Graphical_user_interface">graphical queries creation wizards, <a class="zem_slink" title="User interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/User_interface">user interface designers for your database, or an universal report tool try the applications designed for tasks such this (<a class="zem_slink" title="Kexi" rel="homepage" href="http://kexi-project.org/">Kexi, knoda).

Continue reading

SQLite – Easy to use, dependable and good to use database for small applications.

2010-08-17 2 min read Database Linux

For last couple of days I am looking at <a class="zem_slink" title="SQLite" rel="homepage" href="http://sqlite.org/">SQLite, a very footprint, file based Database.

SQLite is a C <a class="zem_slink" title="Library (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Library_%28computing%29">library that implements an <a class="zem_slink" title="SQL" rel="wikipedia" href="http://en.wikipedia.org/wiki/SQL">SQL database <a class="zem_slink" title="Database engine" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database_engine">engine. A large subset of <a class="zem_slink" title="SQL-92" rel="wikipedia" href="http://en.wikipedia.org/wiki/SQL-92">SQL92 is supported. A complete <a class="zem_slink" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database">database is stored in a single disk file. The <a class="zem_slink" title="Application programming interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_programming_interface">API is designed for convenience and ease of use. Applications that link against SQLite can enjoy the power and flexibility of an SQL database without the administrative hassles of supporting a separate <a class="zem_slink" title="Database server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database_server">database server. Version 2 and version 3 binaries are named to permit each to be installed on a single <a class="zem_slink" title="Server (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Server_%28computing%29">host.

Continue reading
Newer posts