domingo, 8 de junio de 2014

Screenshot on Xfce4 using Imp Pant button

Xfce4 comes with one tool to take pictures of your actual window, this tool is xfce4-screenshooter. It has a prompt that let you select which window or region to capture, if you want your mouse to appear, and how many seconds of delay you want it to wait before taking the picture. It can be very useful, but the problem is assigning this tool to the "Imp Pant" button. In that case it will ask you to fill all this information. However, you can specify some of the options using some arguments, but still you need to specify the file-name in the prompt.

I found somebody asking for a functionality for not showing the prompt, but in the words of the developer it was done before without succes. (https://bugs.launchpad.net/ubuntu/+source/xfce4-screenshooter/+bug/585478)

In order to solve this problem I found in Archlinux wiki a very good explanation about different methods to take screenshots:

https://wiki.archlinux.org/index.php/Taking_a_screenshot

I really liked this method:

$ import -window root screenshot.jpg

Then I wanted to add this command to "Imp Pant" button, the problem is that it is not able to execute the inner command "date" in the same command line.

$ import -window root /home/maikel/screenshot/screenshot_`date +%F_%H%M%S`.png

For that reason you just need to create a small script that executes these lines:

#!/bin/bash
FOLDER=/home/maikel/screenshot
FILENAME=screenshot_`date +%F_%H%M%S`
import -window root ${FOLDER}/${FILENAME}.png

I created this script just open some editor and paste the above code (change the FOLDER and point to the desired one, make sure the folder exists, as I didn't want to make this script slower just by looking if the folder exists and creating it in case it doesn't.

vi /home/maikel/bin/screenshot

And added the execution flag

chmod u+x /home/maikel/bin/screenshot

The just open the keyboard settings

$ xfce4-keyboard-settings

go to application shortcuts



Click add buttom, and write the path to your script (in my case)

/home/maikel/bin/screenshot

Then just press OK and the desired button to assign this script : "Imp Pant"

Now you can just press the button "Imp Pant" and your shots will be saved in the specified folder.

jueves, 10 de abril de 2014

Activate windows without a product key


Fix Windows XP Activation Infinite Loop


1 - Start windows XP in safe mode with Comand Prompt
    - Boot the computer
    - Press F8 until the menu apears
    - Select : Safe Mode with Command Prompt
2 - In the command prompt write "explorer.exe" and hit Enter
3 - In the dialog box select "Yes"
4 - Go to "Start" and "Run"
5 - Type "rundll32.exe syssetup,SetupOobeBnk" and press OK
6 - Restart the computer

jueves, 3 de abril de 2014

Vim scheme in Tmux session

If the Vim scheme (or other programs) are not shown in a Tmux session, you just need to indicate to Tmux to use 256 colour palette. It can be done by calling Tmux with "-2" parameter, or setting the environment variable TERM appropriately.

The best option I found is adding an alias into your .bashrc (in case of bash shell) with the appropriate tmux call.

alias tmux="tmux -2"
This one seems to give same results for me:

alias tmux="TERM=screen-256color-bce tmux"

jueves, 27 de febrero de 2014

Dropbox need superuser

For some reason Dropbox started asking about superuser password... However it does not need acces to other folders than user ones. It seems that there is one problem with one of the paths in its python code. Just find the path to dropbox executable:

$ which dropbox
/usr/bin/dropbox

then modify with root privileges this file.

sudo vi /usr/bin/dropbox

The incorrect line is the first of these two lines:
PARENT_DIR = os.path.expanduser("/var/lib/dropbox")
DROPBOXD_PATH = "%s/.dropbox-dist/dropboxd" % PARENT_DIR

In my case the first one needs to point to my home, then it looks like this:

PARENT_DIR = os.path.expanduser("~")

Then start dropbox

$ dropbox start -i

source: http://blog.ishans.info/2013/12/26/fixing-authentication-is-needed-to-run-usrbindropbox-as-the-super-user-error-in-linux/

miércoles, 26 de febrero de 2014

Window tiling on Ubuntu 12

To configure tiling shortcuts on Ubuntu 12

Open the CompizConfig Settings manager
$ ccsm
filter the word "grid"
Select the result
Configure the different options

source: http://askubuntu.com/questions/334559/how-can-i-setup-hotkeys-for-tiling-individual-windows-in-unity-ubuntu-12-04

ALT+TAB not switching windows

Ubuntu 12.04.4 LTS

if the key combination ALT+TAB does not switch windows it may be disable in Compiz.
In order to enable it again try these steps:

# Open CompizConfig setting manager
$ ccsm

Then go to the tab Window management
and check application switcher