Sunday, June 9, 2013

Restore missing "Create New Document" and extend it's functionality in ubuntu 13.04 Nautilus context menu

Hi,

One of the reported bugs of 13.04 is that, the creating blank document menu item is missing in nautilus context menu. It's restoration instruction was found in this link .

You just have to create an empty document inside your Templates folder in home directory and the missing menu item would be restored.

Now you can leverage the templates folder's functionality by adding different types of file schemas. For example you can create files with .txt, .html, .sh, .sql extensions and add appropriate template codes inside. For example, I have these files in this folder with those extensions and with the following contents:

untitled.txt
//nothing

untitled.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">

    <title>Title Goes Here</title>
</head>
<body>
<p>This is my web page</p>
</body>
</html>


bash.sh
#!/bin/bash
//nothing

obsql.sql
CREATE TABLE prefix_table_name
(
  prefix_table_name_id character varying(32) NOT NULL,
  ad_org_id character varying(32) NOT NULL,
  ad_client_id character varying(32) NOT NULL,
  isactive character(1) NOT NULL DEFAULT 'Y'::bpchar,
  created timestamp without time zone NOT NULL DEFAULT now(),
  createdby character varying(32) NOT NULL,
  updated timestamp without time zone NOT NULL DEFAULT now(),
  updatedby character varying(32) NOT NULL,
  
  
  CONSTRAINT prefix_table_name_key PRIMARY KEY (prefix_table_name_id),
  CONSTRAINT prefix_table_name_ad_client FOREIGN KEY (ad_client_id)
      REFERENCES ad_client (ad_client_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT prefix_table_name_ad_org FOREIGN KEY (ad_org_id)
      REFERENCES ad_org (ad_org_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
You can add any number of file types as you want.

Tuesday, June 4, 2013

Regular Commands in Linux

Hi,

Most of the time you may notice that you are having to give some regular commands in terminal when you start working in the morning. For example, in my case-opening up chrome, pgadmin, springsource toolsuite, skype, firefox, guake. Initially I had to click a few shortcuts or enter commands in the terminal. Then I've searched for a quicker and easier way and came up with this:

1. Opened up a text file in gedit/sublime-text.
2. Wrote this line:
#!/bin/bash
guake & /home/anik/ides/springsource/sts-3.1.0.RELEASE/STS & pgadmin3 & firefox & skype
3. Saved it as regularCommands.sh
4. Pasted the file inside /bin folder of the file system.
Then I was able to open up a terminal and just put "regularCommands" without the quotes or even omitting the ".sh" and all those programs were starting up one after another. Saves me time and energy.
Hope that helps. :)