Author: tripux

auto connect vpn with password

The problem seems to be, that your password in keyring is not accessible.

Source

Solution mentioned there is to open file /etc/NetworkManager/system-connections/ConnectionName and set the

password-flags=0

and add the below lines to the file

 [vpn-secrets]
 password=YourPassword

Then restart network manager to pick up the change:

 sudo restart network-manager

For more info refer the source

start screen in .profile to access windows in X session ssh

DISPLAY and AUTHORITY

An X program needs two pieces of information in order to connect to an X display. (Note that wmctrl is an X program, even if it accesses other processes’ windows rather than creating its own.)

  • It needs the address of the display, which is typically :0 when you’re logged in locally or :10, :11, etc. when you’re logged in remotely (but the number can change depending on how many X connections are active). The address of the display is normally indicated in the DISPLAY environment variable.
  • It needs the password for the display. X display passwords are called magic cookies. Magic cookies are not specified directly: they are always stored in X authority files, which are a collection of records of the form “display :42 has cookie 123456”. The X authority file is normally indicated in the XAUTHORITY environment variable. If $XAUTHORITY is not set, programs use ~/.Xauthority.

Inside a screen session, the environment variables are determined when the session starts, unless you explicitly change them at some point. So if you start a screen session locally on your desktop machine, then attach to that session remotely, $DISPLAY and $XAUTHORITY are still pointing to your desktop machine. But if you start the screen session from an ssh connection from some machine C to your desktop machine, then the variables are not set. (They would be set to point to C if you had an X server on C and had enabled X forwarding over the ssh session.)

Getting the values of the variables

As far as I understand, you’re trying to act on the windows that are displayed on your desktop. If you’re the only person using your desktop machine, it’s very likely that the display name is :0. Finding the location of the X authority file is harder (under the default setup in Ubuntu, it’s in a file with a randomly generated name).

Here are a few ways to obtain the values of DISPLAY and XAUTHORITY:

  • The easy solution is to always start a screen session from your desktop, perhaps automatically in your login scripts (from ~/.profile; but do it only if logging in under X: test if DISPLAY is set to a value beginning with : (that should cover all the cases you’re likely to encounter)). In ~/.profile:
    case $DISPLAY in
      :*) screen -S local -d -m;;
    esac
    

    In the ssh session:

    screen -d -r local
    

starting vpn from conmmand line

Also note that regular users usually don’t have permission to control networking. Using the commands above with sudo should work for most connections, but VPN specifically might fail with “Error: Connection activation failed: no valid VPN secrets.”

If that happens to you, it’s likely that the VPN password is stored in your user’s gnome-keyring, which makes it inaccessible to the root user. This comment explains why.

To fix this, edit /etc/NetworkManager/system-connections/ConnectionName and under [vpn], change the password flags line to:

password-flags=0

And add the following:

[vpn-secrets]
password=YourPassword

Then starting the VPN connection with sudo nmcli con up uuid ConnectionName should work without problems.

keyboard bindings shortcuts in Lubuntu

To see what keyboard shortcut bindings are currently set, and to add more without using xbindkeys, you can dig through the following file and edit it:

/home/<user>/.config/openbox/lxde-rc.xml

I imagine you can figure it out just fine, but for a quick start, at least on PC hardware,
A- means “Alt+”
C- means “Ctrl+”
S- means “Shift+”
W- means the “Windows” key
so, for example, C-A-T is ctrl+alt+”t”, which runs a terminal window.

irsii

hide join part:

/ignore * JOINS PARTS QUITS

run commands on startup:

edit: ~/.irssi/startup

add each command on a new line without the /

bluetooth audio in ubuntu

pactl load-module module-bluetooth-discover in command line after syncing. Then make sure A2DP is selected as a profile in the bluetooth settings

edit 17-03-2016 followed:

/etc/pulse/default.pa

and comment out (with an # at the beginning of the line) the following line:

#load-module module-bluetooth-discover

now edit the file:

/usr/bin/start-pulseaudio-x11

and after the lines:

   if [ x”$SESSION_MANAGER” != x ] ; then
        /usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null
    fi

add the following line:

    /usr/bin/pactl load-module module-bluetooth-discover

This way the Pulse audio’s Bluetooth modules will not be downloaded at boot time but after x11 is started.

using color icc management in windows 7

1. ASSOCIATE YOUR PROFILES WITH A DISPLAY AND SET AS DEFAULT

To apply an existing ICC profile (an ICM file created by some calibration process), do the following –

Control Panel / Display / Change Display Settings / Advanced Settings / Color Management / Color Management (again!)  / Devices / select one of your displays*1  / click “use my settings for this device”*2/ if necessary add the applicable profile to the “Profiles associated with this device” box using the “Add” button (if your profile is not already listed but is available somewhere on the network or computer) / click on the correct profile in that box and click “Set as Default Profile”.

*1 the CM dialog boxes don’t label your displays the same way as other dialog boxes, they seem to lose the manufacturer and model number info that is available elsewhere, so your ABC model nn display comes up asDisplay: 1. Generic PnP monitor .  Also note that at least on my system, display ‘1’ was in fact display ‘2’ in other display settings dialog boxes, and vice versa.

*2 You would think that selecting “Use my settings for this device” would mean the Windows would use your settings for that device (display), but apparently it doesn’t.  It means … well, I don’t know what it means.  Perhaps it means if you don’t select it, even the next step (below) won’t help you.

Good work so far – tortuous and unnecessarily complex – but has a certain logic.  Unfortunately it doesn’t achieve anything at all, until you work out the secret key.  Although it seems the above should do what you want, you have to do something which is entirely unobvious, and not mentioned at all in any of the help general discussion, and apparently not known by any of the 67 people who read my question.  It is actually listed in the MS help section… at the very bottom of “Understanding color management settings” and after a mass of largely incomprehensible stuff which doesn’t appear to be relevant, there is a link which is not listed in the contents at the top and almost impossible to notice… To enable or disable calibration loading by Windows

2. ENABLE CALIBRATION LOADING BY WINDOWS

Here’s the hidden bit of help file…

To enable or disable calibration loading by Windows , you must be logged on with a user account that has administrative privileges.

  1. Click to open Color Management.
  2. Click the Advanced tab, and click Change system defaults .
  3. Click the Advanced tab in the Color Management – System Defaults dialog box, and do one of the following:
    • To enable Windows to load display calibrations, select the Use Windows display calibrationcheck box.
    • To prevent Windows from loading display calibrations, clear the Use Windows display calibrationcheck box.
  4. Click Close in the Color Management – System Defaults dialog box.
  5. Click Close in the Color Management dialog box.

Not only is it obscure, it is confused further by the fact that you are back in the same dialog box twice, but the second time it is labelled Color Management – System Defaults instead of Color Management as it was the first two times.   But only on the second time is the required box enabled to allow you to tick i.e. it’s a system wide setting.  Easy to miss.

Either MS’s experts don’t know about this, and can’t find it in the help files either, or they couldn’t be bothered answering my question.  In any case a) I hope this helps someone else, and b) I hope MS lift their support game and actually respond in future to people as frustrated and helpless as I was.  Thanks Microsoft for wasting a day of my life.

recover corrupt lightroom catalog

The first thing I did was download SQLite3 and SQLite3_analyze.

SQLite3_analyze confirmed there was indeed some sort of problem. “database image is malformed” it told me. Some searching never did tell me what that means exactly but, in any case, it confirmed there was a problem with the database.

The real find came from Gerhard Strasse’s blog. Read the blog but I just want to add a few comments.

Basically the steps are pretty simple.

First you dump the existing catalog into a text file as a bunch of SQL commands:

echo .dump | ./sqlite3 ~/lightroom_catalog.lrcat > ~/lightroom_catalog.sql

then, in theory, you can just suck that text into a new database file with:

./sqlite3 -init ~/lightroom_catalog.sql ~/lightroom_catalog_restore.lrcat

The blog notes that you may get an error or two (i.e. the duplicate keys or whatever that were causing the database issue) but it should work. It didn’t in my case. (lightroom_catalog_restore.lrcat was a zero byte file on the first try.) The secret for me was at the end of the comments.

Reader Chairat Juengmongkolwong noted that if, after the first step, you go into the text file (lightroom_catalog.sql in this case) and replace the last line that says:

ROLLBACK; — due to errors

with the line:

COMMIT TRANSACTION;

And THEN do the

./sqlite3 -init ~/lightroom_catalog.sql ~/lightroom_catalog_restore.lrcat