Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, May 19, 2015

rJava installation problem : libjvm.so: cannot open shared object file: No such file or directory


export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
or
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server

then 
R CMD javareconf
or
R CMD javareconf -e

from : http://askubuntu.com/questions/584529/libjvm-so-cannot-open-shared-object-file-no-such-file-or-directory

Friday, November 7, 2014

Fix Adobe Flash Player Issue In Chromium In Ubuntu 14.04

from http://itsfoss.com/fix-flash-player-issue-chromium-in-ubuntu-14-04/ :

sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree --install

Tuesday, November 5, 2013

Limiting sftp accounts with chroot

from http://www.techrepublic.com/blog/linux-and-open-source/chroot-users-with-openssh-an-easier-way-to-confine-users-to-their-home-directories/

#In the file /etc/ssh/sshd_config  :
#make sure the sftp subservice is defined with the line (only once)
Subsystem sftp /usr/lib/openssh/sftp-server

# add the following lines (only once)
Match Group sftp
    ChrootDirectory %h
    ForceCommand internal-sftp
    AllowTcpForwarding no

#Then on the linux shell, create the sftp group (only once)
sudo addgroup sftp

#Create the user and set its properties (for each sftp user)
sudo adduser joe
sudo usermod -G sftp joe
sudo usermod -s /bin/false joe
sudo chown root:root /home/joe
sudo chmod 0755 /home/joe
sudo usermod -G sftp joe
sudo mkdir /home/joe/Data
sudo chown -R joe:joe /home/joe/Data

The usermod command above will add user joe to the sftp group and set their shell to /bin/false so they absolutely cannot ever get shell access. The chown and chmod commands will set the required permissions for the directory. With these permissions set, the user will be allowed to upload and download files, but cannot create directories or files in the root directory. In other words, if this is used for Web hosting, ensure that a subdirectory in the root directory, such as /home/joe/public_html/ is available and owned by the user; this way they can write to and create directories in /home/joe/public_html/, but cannot make changes to the root directory (/home/joe), itself.

Monday, November 4, 2013

Disabling ProFTP service under Parralels PLESK


Edit the file /etc/xinetd.d/ftp_psa and set

        disable         = yes

Note that the process will have to repeated when PLESK will be upgraded :(

Disabling openssh/sftp service

Edit and comment out the line :

Subsystem sftp /usr/lib/openssh/sftp-server

and restart the openssh server

sudo restart ssh (or sudo /etc/init.d/ssh restart)










Monday, May 20, 2013

Selective recursive file input for tar archive creation :

find . -name \*L2.dat |tar -czvf file.tgz --files-from -

Saturday, November 24, 2012

Tuesday, May 15, 2012

Enable Skype Icon on Unity Notification Panel on Ubuntu 12.04 LTS

http://www.tautvidas.com/blog/2012/05/enable-skype-icon-on-unity-panel-on-ubuntu-12-dot-04-lts/

Wednesday, May 9, 2012

Nvidia driver does not install in Ubuntu 12.04 precise

Follow http://dragly.org/2012/05/04/installing-the-nvidia-driver-in-kubuntu-12-04/

Tuesday, May 8, 2012

Repairing grub by booting from the Ubuntu live-CD

I just installed the new version of Ubuntu (12.04). The installation went fine but the bootloader installation at the end did not work. When I turn on the computer, the new version of the ubuntu does not show in the old bootloader (grub2) menu. What to do? #Boot the computer with the Ubuntu live cd, mount the / partition under /home/ubuntu/a and issue the following command : sudo mount --bind /dev/ /home/ubuntu/a/dev sudo mount --bind /proc/ /home/ubuntu/a/proc sudo mount --bind /sys/ /home/ubuntu/a/sys sudo chroot /home/ubuntu/a #Then let grub2 create /boot/grub/grub.cfg by autodetecting the present OS'es sudo update-grub Found linux image: /boot/vmlinuz-3.2.0-23-generic Found initrd image: /boot/initrd.img-3.2.0-23-generic Found memtest86+ image: /boot/memtest86+.bin Found Windows 7 (loader) on /dev/sda1 Found Ubuntu 10.10 (10.10) on /dev/sda6 done #Exit from the modified chroot exit #Run grub-install sudo grub-install --root-directory=/home/ubuntu/a /dev/sda You should get the message : Installation finished. No error reported.

Wednesday, March 21, 2012

Compiling source code of netcdf4 on linux

First obtain szip libraries (from the link at http://www.hdfgroup.org/HDF5/release/obtain5.html)
wget http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz
tar -xzvf szip-2.1.tar.gz
cd szip-2.1

./configure --prefix=/home/acizmeli/opt
make 
make test
make install

Then obtain the hd5 source code  (again from http://www.hdfgroup.org/HDF5/release/obtain5.html)
wget http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz
tar -xzvf hdf5-1.8.8.tar.gz 
cd hdf5-1.8.8
./configure --prefix=/home/acizmeli/opt  --with-szlib=/home/acizmeli/opt/
(make sure that ./configure has recognized the szip libraries)
make
(or for parallel compilation : ) make -j -16
make install

Then obtain the netcdf4 source :
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.2.tar.gz
tar -xzvf netcdf-4.2.tar.gz
cd netcdf-4.2
CPPFLAGS=-I/home/acizmeli/opt/include/ LDFLAGS=-L/home/acizmeli/opt/lib ./configure --prefix=/home/acizmeli/opt/
make
make install

If there is a doxygen error, try adding --disable-doxygen

Wednesday, February 29, 2012

Switch the layout of your keyboards

Handy switch if you need to change regularly between layouts of keyboards.


Setxkbmap is a tool to set the keyboard layout. In the options of the tool you're allowed to set a switch.

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll be,us

sets the keyboard to belgium (be) and with alt+shift I can switch to a us layout.

You can find the explanation for the coding in:

/usr/share/X11/xkb/rules/xorg.lst

You might want to execute this command autocratically on login, so you don't have to type it all the time again.

create a file "setxkbmap.desktop" in "~/.config/autostart/"

nano  ~/.config/autostart/setxkbmap.desktop

and enter the setxkbmap command

[Desktop Entry]
Encoding=UTF-8
Name=sertxkbmap
GenericName=set keyboard layout
Comment=Switch with alt+shift the layout of your keyboard
Exec=setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll be,us

this file will be run every time you login to your system

Monday, June 27, 2011

Graphical file diff editor for Linux

Meld is a wonderful little graphical program for Linux that helps differentiate between text files :

sudo apt-get install meld

Monday, May 30, 2011

Mounting SeaGate GoFlex from Linux

Download the driver from :
http://download.pogoplug.com/install/linux/pogopluginstall.tar.gz

Create a conf file .pogoplugfs.conf under the same directory as the driver :

svcuser=your_email_registered_with_pogoplug.com
svcpassword=PASS

To mount the file system in a non-empty direcory :
./pogoplugfs --mountpoint /home/acizmeli/Pogoplugfs/

Monday, May 16, 2011

use lapply to modify a list of lists in R

modifyList package:utils R Documentation

Recursively Modify Elements of a List

Description:

Modifies a possibly nested list recursively by changing a subset
of elements at each level to match a second list.

Saturday, May 7, 2011

Stream an image file from a web server and restore it to a partition:

Stream an image file from a web server and restore it to a Linux partition:

wget -qO - http://server/backup.img | \
ntfsclone --restore-image --overwrite /dev/hda1 -

Friday, April 29, 2011

grep with the find command with the Linux bash shell

use grep's command line option -H to print the filenames when used within the command "find"

find . -name \*.py -exec grep -Hn string_to_search {} \;

Wednesday, March 10, 2010

Virtualbox mounting a Windows host directory under Linux client

C_DRIVE /C_DRIVE vboxsf uid=acizmeli 0 0


or


Documents /home/me/Host vboxsf uid=1000,gid=1000,nodev,noexec,nosuid,auto,rw 0 0

(http://ericgazoni.wordpress.com/2011/03/25/mounting-virtualbox-osx-share-on-ubuntu-guest/)

Wednesday, September 30, 2009

Bluetooth GPS in Linux with gpsd


I have the following no-name bluetooth-only gps device. When I plug it into the USB port of my computer for a recharge, it is seen as :
$lsusb
Bus 003 Device 011: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

I already have the bluetooth stack working on Ubuntu so I could make a bluetooth scan for it. The gadget presents itself as GT-750F :


$hcitool scan
Scanning ...
00:0B:0D:76:83:73 GT-750F

Following the instructions at http://gpsd.berlios.de/bt.html, I added the following section into /etc/bluetooth/rfcomm.conf :
rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:0B:0D:76:83:73;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "GPS GT-750F";
}

I then launched gpsd with the following command :

sudo gpsd -D 2 -N /dev/rfcomm0

and using xgps and gpsdrive, I saw that it al worked fine.