Archive

Archive for May, 2015

[manjaro] A file belongs to which package?

Problem
You have a file and you want to figure out which package it belongs to.

Solution

pacman -Qo FILE

Where FILE can be just the name of a file or its full path.

More info here.

Categories: manjaro Tags: , ,

Speed up Firefox page load by 44%

Details here.

In short:

  1. about:config
  2. privacy.trackingprotection.enabled -> true

execute a command during boot as root

Problem
During the boot process you want to execute a command as root. For instance, I needed a symbolic link in /run, but /run is a virtual file system and its content is lost when you switch the machine off.

Solution
Edit the file /etc/rc.local . Example:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# this link is required by a project of mine
ln -s /media /run/media

exit 0

This tip is from here.

Categories: ubuntu Tags: ,

open a terminal in a specified folder

Problem
From a script I want to launch a terminal that opens in a specified folder.

Solution
Thanks to #linux, I got two solutions:

A1) I use konsole, which has an option for this:

konsole --workdir /tmp

It will open a terminal in the /tmp directory.

A2) Change directory to the specified folder and launch the terminal:

cd /tmp; konsole

If you want to do it from a script, the idea remains the same.

B) If you want to execute a command automatically in the opening terminal, use this:

konsole -e mc

C) Set the title of Konsole to a specified text:

konsole -p tabtitle='NVIM server'

Find more info here.

Categories: bash, linux Tags: , ,

resize an image to a given width by keeping the aspect ratio

Problem
You want to resize an image to a given width but you want to keep the width/height ratio of the image.

Solution

convert -resize 200 big.jpg small.jpg

Here the new width will be 200 pixels.

Categories: bash Tags: , ,

Google Maps knows where you are

If you type in Google Maps your name, it will show where you are located most of the time. It worked for me. Scary…

list your Firefox add-ons

Problem
I use several machines and I would like to create a unified list that contains my favourite Firefox add-ons. This list could be kept in Dropbox, thus I could access it on all my machines. How to generate a list of installed add-ons?

Solution
The add-on Addon List Dumper can do exactly this. Here is a screenshot about this add-on:

addons

Categories: firefox Tags: