Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Friday, November 16, 2012

Automatic connection to VPN server in Ubuntu Precise 12.04

Ubuntu Precise 12.04's NetworkManager service can be used to access VPN connections, and can be configured to connect at boot-time without having to add any additional packages to the system. Using the following script, I access my FreeBSD OpenVPN server (configuration was covered in a previous post) at boot time.

Save the following script to /etc/NetworkManager/dispatcher.d/02vpn :
#! /bin/bash

REQUIRED_CONNECTION_NAME="virt0"
VPN_CONNECTION_NAME="baitis vpn"


activ_con=$(nmcli con status | grep "${REQUIRED_CONNECTION_NAME}")
activ_vpn=$(nmcli con status | grep "${VPN_CONNECTION_NAME}")
if [ "${activ_con}" -a ! "${activ_vpn}" ];
then
    nmcli con up id "${VPN_CONNECTION_NAME}"
fi
Don't forget to mark the script as executable with chmod
chmod +x /etc/NetworkManager/dispatcher.d/02vpn

VPN_CONNECTION_NAME should correspond to whatever VPN connection you have configured using Network Manager. If, for some reason, you can't configure VPN connections in Network Manager, you may need to install the appropriate plug-in:
apt-get install network-manager-openvpn network-manager-openvpn-gnome

Tuesday, July 17, 2012

LibreOffice's "Automatic" text color isn't black in Ubuntu 12.04 Precise!

After using Ubuntu 12.04 Precise Pangolin for some time, I noticed that one of the applications that I use all of the time -- LibreOffice -- was not using black (#000000) as the "Automatic" (default) text colour for new documents that I created. This is extremely annoying because I like to copy and paste text into documents and use the "Clear Formatting" feature. Unfortunately, this causes the text to revert to a light grey (gray) colour: #3C3C3C. Yuck!

There is a solution, however. Benjamin Drung (bdrung) wrote Ambiance," and change the default colour to black. To fix the problem:

  1. Open the gtk theme for Ambiance
    (/usr/share/themes/Ambiance/gtk-2.0/gtkrc)
  2. Search for ntext_color
  3. Replace #3C3C3C with #000000
Re-load LibreOffice; problem solved.

Why LibreOffice uses the GTK theme system to determine its "Automatic" colour is beyond me; this seems like a very irritating "feature."