About Me

My photo
I know the last digit of PI

Thursday, December 05, 2013

Establishing VPN connection under Linux

Installation

You need to install the package
sudo apt-get install pptp-linux

Configuration

Create new VPN connection:
sudo pptpsetup --create <tunnel> --server <my-vpn-server-ip> --username <vpn-user-name> --encrypt
Create routing for the connection - you need to create a new file in the directory /etc/ppp/ip-up.d/ that contains the route. The content of the file should looks similar to:
#!/bin/bash

# This script is called with the following arguments:
# Arg Name
# $1 Interface name
# $2 The tty
# $3 The link speed
# $4 Local IP number
# $5 Peer IP number
# $6 Optional ``ipparam'' value foo

ip route add 10.42.0.0/16 dev $1
You can take a look of the parameters in /etc/ppp/ip-up script

Establishing connection

sudo pon <tunnel>

Disconnecting

sudo poff <tunnel>

Debugging issues

Start the connection in debug mode
sudo pon <tunnel> debug dump logfd 2 nodetach
Show pon/poff log:
sudo plog

Manually adding route

sudo ip route add 10.42.0.0/16 dev ppp0

Adding new user from shell

To add new use execute following commands:

Creates the new user

sudo adduser <username>

Add the user to existing group

sudo usermod -aG <groupname> <username>

Create new group

sudo addgroup <groupname>

Sunday, September 15, 2013

F19 post installation steps

Gnome shell 3

Tweak tool

Install gnome-tweak-tool
sudo yum install gnome-tweak-tool
Then start it, go to Desktop and enable "Have file manager handle the desktop" Go to Shell and select "Show date in clock", and for "Arrangement of buttons on the titlebar" choose "All"

Themes

sudo yum install gnome-shell-extension-user-theme.noarch
sudo yum install gnome-themes
Then logout, login start gnome-tweak-tool go to Themes tab and select Crux for "Icon theme". Go to Shell extensions and enable "User themes". Close and open the gnome-tweak-tool. Now under Theme tab you have the "Shell theme" enabled.

Nautilus

Show hidden files

gsettings set org.gnome.nautilus.preferences show-hidden-files true

Show address bar instead of buttons for file path

gsettings set org.gnome.nautilus.preferences always-use-location-entry true

Ask what to do with executable files

gsettings set org.gnome.nautilus.preferences executable-text-activation 'ask'

Configuration

Admin rights

Add sudo capabilities to current user:
usermod -a -G wheel MY_USER

Transparent terminal

sudo yum install terminator

Grub theme

sudo yum install grub2-starfield-theme
Open /etc/default/grub file sudo gedit /etc/default/grub Make entry in /etc/default grub GRUB_THEME="/boot/grub2/themes/starfield/theme.txt" Update grub sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Additional software

RPMfusion repos

Go to http://rpmfusion.org/ and download corresponding version

Music player - XMMS

sudo yum install xmms xmms-faad2 xmms-mp3 xmms-pulse xmms-skins

Video players

mplayyer

sudo yum install mplayer gecko-mediaplayer mplayer-gui mencoder

VLC

sudo yum install vlc

Thursday, April 11, 2013

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object

C:\>java -version
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
First thing is to find out which java is used
c:\>where java.exe
C:\Windows\System32\java.exe
Ok this is the java wrapper that reads the registry and sets the JAVA_HOME from there. Open registry editor and go to the keys (replace 1.7 with the latest major version) HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_17

Change the JavaHome to point to correct path.
Currently it is pointing to C:\Program Files\java\jre7. Alternativly you can use C:\Program Files\java\jdk1.7.0_17\jre
You can create a java.reg file and import it into registry.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7]

"JavaHome"="C:\\Program Files\\Java\\jdk1.7.0_17\\jre"
In my case the problem was faulty installation of the JRE.
I have two options:
  1. either live with alternative path C:\Program Files\java\jdk1.7.0_17\jre
  2. I can repair the JRE installation.

I choose option 2, so I copied everything from C:\Program Files\Java\jdk1.7.0_17\jre to C:\Program Files\java\jre7 (overriding the files).