Monthly Archives: November 2013

Increase the phpMyAdmin session timeout

Edit your config.inc.php file (in my Ubuntu 12.04 it was located at /etc/phpmyadmin/config.inc.php) and add the following line (where X is the amount of seconds the session will last):

$cfg['LoginCookieValidity'] = X;

phpmyadmin-login

In my development machine I have 36000 that is 10 hours (all work day) but you should never do this in a production environment.

You may also have to set the same value on session.gc_maxlifetime in your php.ini file because it will probably be smaller than LoginCookieValidity value you set before (it’s default value is 1440).

session.gc_maxlifetime = 36000

Ref: http://venutip.com/content/increase-phpmyadmin-session-timeout

Avoid Android File Transfer starting automatically in Mac OS X after Android device plugin to USB port

“Android File Transfer” application starts automatically in Mac OS X when you plug your Android device to the USB port. Even if you only want to charge it.

Adroid File Transfer

This are the steps you have to take to avoid this (annoying) behaviour:

  1. Open the “Activity Monitor” and kill the “Android File Transfer Agent” process.
  2. Open “System Preferences” > “Accounts”. Go to the “Login Items” tab of your user. Remove the “Android File Transfer Agent” (I didn’t have this item anyway).
  3. Find your “Android File Transfer.app” file (usually in /Applications):

    • Right click (or ctrl+click) on it and select “Show package contents”.
    • Go to Contents/Resources.
    • Rename “Android File Transfer Agent.app” to e.g. “Android File Transfer Agent_DISABLED.app“.
  4. Go to /Users/username/Library/Application Support/Google/Android File Transfer (you can open Library folder from the terminal running “open ~/Library”) and rename “Android File Transfer Agent.app” to e.g. “Android File Transfer Agent_DISABLED.app“.

Now “Android File Transfer” won’t auto-start when you plug your phone on the USB port, but if you open it manually everything will work just fine.

Ref:

Using screen to leave processes running in a terminal

If you are using an SSH connection and run a command that takes very long to process you can use nohup to prevent that process to be terminated when you logut from the SSH session:

nohup command > /dev/null 2>&1 &

But using this method detaches the process from stdio, stdout and stderr (unless you redirect them somewhere, as previous example redirected them to /dev/null). If you want to be able to reattach to that process later on screen is the right tool.

Firt install screen:

sudo apt-get install screen

Then run a bash shell using screen:

screen bash

A new shell wil be openen and the you can run anything you want. Lets supose you start converting a huge video to another codec. Once the process has started you have to press CTRL+A and then D to detach from that shell. Now you’ll be back to the original shell but the video process will still be running.

If you have only one screen process running you can reattach to it by just running this:

screen -r

If you can have multiple screen processes at the same time you have to specify to which of them you want to attach. Using this command will tell you the names and some more info about all current screens:

screen -list

Then you can attach to them using that name:

screen -r name

If you want to terminate a screen process just attach to it and press CTRL+D.

Source: http://raspi.tv/2012/using-screen-with-raspberry-pi-to-avoid-leaving-ssh-sessions-open

Fix locale problems in Raspbian

If you get errros like this while running commands on your Raspbian:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "es_ES.utf-8",
        LC_MONETARY = "es_ES.utf-8",
        LC_CTYPE = "es_ES.utf-8",
        LC_COLLATE = "es_ES.utf-8",
        LC_MESSAGES = "es_ES.utf-8",
        LC_NUMERIC = "es_ES.utf-8",
        LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Or those:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

You may have to edit /etc/default/locale and add the default locales:

LANG=en_GB.UTF-8
LC_ALL=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8

Fix “macports checking for Tcl configuration… configure: error: Can’t find Tcl configuration definitions” when selfupdating Macports in Mac OS X 10.9 Mavericks

Solucionar "macports checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions" al actualizar Macports en Mac OS X 10.9 Mavericks">

I’ve just upgraded my Mac OS X to Mavericks 10.9. When I tried to update Macports I got an error and when I used the verbose mode of selfupdate (sudo port -v selfupdate) it came out this:

macports checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions

I fixed the problem after reinstalling the Command Line Tools of Xcode and accepting the license from the command line:

sudo xcode-select --install
sudo xcodebuild -license

Then the selfupdate worked just fine:

sudo port selfupdate
  • Page 1 of 2
  • 1
  • 2
  • >