How to view all startup applications and services

In Ubuntu, the Startup Applications application can be invoked from the Dash to view, disable, enable or remove startup applications. It can be started from the shell by the confusing command: gnome-session-properties. However, this application does not actually show all the applications and background services that are invoked when you login to a new desktop session.

There is a global directory that holds other startup applications and services: /etc/xdg/autostart. The .desktop files here are also started on login to a desktop. If you would like the entries here to appear in Startup Applications, then edit the files and change their NoDisplay=true entry to NoDisplay=false. Once they appear in Startup Applications, it is easy to enable, disable or remove them.

Tried with: gnome-session-bin 3.9.90 and Ubuntu 14.04

How to analyze boot process using Bootchart

Chart generated by Bootchart

Chart generated by Bootchart

Bootchart is a tool that can be used to visualize and analyze the boot process. It is a shell script that is run by the kernel in the background. It analyzes all the information and renders a chart that makes it easy to understand the CPU, disk and services that run at boot. This can be useful to understand your system or find bottlenecks that might be making your system to boot slowly.

Installing Bootchart is easy:

$ sudo apt install bootchart

That is it! It will automatically run every time the system is booted up. The chart it generates is stored in /var/log/bootchart as a PNG file.

Tried with: Bootchart 0.90.2 and Ubuntu 14.04

GNOME Tweak Tool

GNOME Tweak Tool

GNOME Tweak Tool

GNOME Tweak Tool is a tool that can be used to change the fonts and other UI elements of GNOME. Since Ubuntu Unity is based on GNOME, this affects how many of your applications and desktop will look.

Installing the tool is easy:

$ sudo apt install gnome-tweak-tool

It can be invoked from the Dash as Tweak Tool or from the shell as gnome-tweak-tool.

I typically use this tool to change the fonts for the Window Titles, Interface and Documents. These apply to an astonishing array of UI elements in many applications that are built on GTK or GNOME.

Tried with: GNOME Tweak Tool 3.10.1-2 and Ubuntu 14.04

How to parse program options in C++ using getopt_long

Any C or C++ program worth its salt will take some options and arguments from the user at the shell. Option is typically of the form -h (short) or --help (long). Options can also have a following argument, for example -o someFile.txt or --open someFile.txt. All these types of options and arguments can be processed easily using the getopt_long function in the GNU C library.

An example that illustrates its usage is given below:

Reference: Sec 2.1.3 of Advanced Linux Programming by CodeSourcery LLC and Mark Mitchell

Tried with: GCC 4.9.2 and Ubuntu 14.04

GNOME Color Chooser

GNOME Color Chooser

GNOME Color Chooser

GNOME Color Chooser is a tool that makes it easy to change the colors of GTK UI elements. Since GNOME is based on GTK, this affects the foreground, background and other colors of the UI elements of many applications and the desktop. The settings applied here might override the colors applied by your desktop theme.

Installing it is easy:

$ sudo apt install gnome-color-chooser

It can be invoked from the Dash as GNOME Color Chooser or from the shell as gnome-color-chooser. The changes are applied on the desktop and applications as soon as they are set. No need to logout of your desktop session.

Curious to know what this tool is changing? I found that this tool writes a ~/.gtkrc-2.0 file. Internally, that just points to a ~/.gtkrc-2.0-gnome-color-chooser where this tool writes all its settings.

Some of the changes I used it for:

  • The Ubuntu Ambiance theme uses a black background color for Tooltips. This looks horrible especially when they appear in applications like Eclipse. The foreground and background color of Tooltips can be changed in this tool at Specific -> Tooltips.

Tried with: GNOME Color Chooser 0.2.5 and Ubuntu 14.04

How to change font and colors of Tooltips

20150130_tweak_tooltips

The font, font size, foreground color and background color of Tooltips in Ubuntu can be changed. This can be important since Tooltips are used by applications in Eclipse.

  • To change the font and the font size: Open GNOME Tweak Tool, go to Fonts section and set the font and font size for the Interface element.

  • To change the foreground and background colors: Open GNOME Color Chooser, go to Specific -> Tooltips and set the colors you want.

Restart your application to see the effect of these changes.

Tried with: GNOME Tweak Tool 3.10.1-2, GNOME Color Chooser 0.2.5 and Ubuntu 14.04

How to mount media server using DJMount

DJMount is a program that can be used to mount the content of a UPnP/DLNA media server on your network to your filesystem. Once it is mounted, you can navigate the server’s content folders using any file explorer and play the files using any media player.

Installing DJMount is easy:

$ sudo apt install djmount

Create an empty directory and pass it to DJMount:

$ mkdir ~/media_server_here
$ djmount ~/media_server_here

You can now view all the media servers available in your network and their contents using any file explorer at the above mounted directory.

To unmount the media servers:

$ fusermount -u ~/media_server_here

Note: I had problems with DJMount. The contents would disappear if I tried to play any video file using VLC. The error I get is:

(src/ixmlparser.c::Parser_getChar), line 0: Error 63
[E] Error in UpnpSendAction 'Browse' -- -506 (UPNP_E_OUTOF_BOUNDS)
[E] BrowseOrSearchAction ObjectId='1$4'

Tried with: DJMount 0.71 and Ubuntu 14.04

How to ignore whitespace in Meld

Option to ignore whitespace is in Text Filters section in Meld

Option to ignore whitespace is in Text Filters section in Meld

The option to ignore whitespace while diffing two files exists in Meld, it is just hidden away. Go to Edit -> Preferences and click the Text Filters tab. Here you will find a whole set of filters that can be used to ignore whitespace, empty lines, comments and many other diff items.

Tried with: Meld 1.8.4 and Ubuntu 14.04

How to change time style used by ls

The date and time displayed by ls -l can be changed to any format you want.

The default is:

$ ls -l
total 88
-rw-rw-r-- 1 joe joe     6 Jan 27 12:23 a.txt
-rw-rw-r-- 1 joe joe   522 Jan 27 12:22 haha.txt
-rw-rw-r-- 1 joe joe 80360 Jan 27 12:23 jump.pdf

To change the format of the date and time use the --time-style option. Values that can be passed to it are long-iso, full-iso and iso. You can also specify your own custom format as a string.

Here is how the different time styles look:

$ ls -l --time-style=long-iso
total 88
-rw-rw-r-- 1 joe joe     6 2015-01-27 12:23 a.txt
-rw-rw-r-- 1 joe joe   522 2015-01-27 12:22 haha.txt
-rw-rw-r-- 1 joe joe 80360 2015-01-27 12:23 jump.pdf

$ ls -l --time-style=full-iso
total 88
-rw-rw-r-- 1 joe joe     6 2015-01-27 12:23:08.309375574 +0800 a.txt
-rw-rw-r-- 1 joe joe   522 2015-01-27 12:22:59.773375414 +0800 haha.txt
-rw-rw-r-- 1 joe joe 80360 2015-01-27 12:23:32.693376032 +0800 jump.pdf

$ ls -l --time-style=iso
total 88
-rw-rw-r-- 1 joe joe     6 01-27 12:23 a.txt
-rw-rw-r-- 1 joe joe   522 01-27 12:22 haha.txt
-rw-rw-r-- 1 joe joe 80360 01-27 12:23 jump.pdf

Tried with: Ubuntu 14.04

Referer Control extension for Chrome

Referer is one of the fields in a HTTP request header. It is filled with the domain from where a user clicked a link to get to the new URL. For example, say you clicked a link in a Google search result to get to a MIT webpage. The HTTP header that the MIT web server receives will have google.com in its Referer field.

Referer Control is an extension for Chrome that gives you the power to set this field to anything you want. For example, for all links heading to http://mit.edu/* you can set the Referer to be https://google.com by setting it in the Custom field.

Tried with: Referer Control 0.55, Chrome 39.0.2171.95 (64-bit) and Ubuntu 14.04

Follow

Get every new post delivered to your Inbox.

Join 112 other followers

%d bloggers like this: