IT Base of Knowledge’s Weblog

February 6, 2009

Create an iso from a directory

Filed under: Linux — itbdc @ 11:11 am

genisoimage -R -r -J -joliet-long --hide-rr-moved -iso-level 4 -V "Label" -o label_name.iso /tmp/directoryToSave

January 9, 2009

Install VMWare on Ubuntu

Filed under: Linux — itbdc @ 10:02 am

At first install those package:

apt-get install linux-headers-`uname -r` libx11-6 libx11-dev xspecs libxtst6 psmisc build-essential

Then download binaries on http://www.vmware.com/download/server/ (server & mui tgz source).

During the download, get a license number (http://register.vmware.com/content/registration.html) it’s totally free!

If you use kernel 2.6.27 please launch:
wget -c http://www.insecure.ws/warehouse/vmware-update-2.6.27-5.5.7-2.tar.gz

Then launch ./vmware-install.pl on each directory (update&mui or install&mui).

At the end of the mui installation you will get a starting failed message, to correct this bug please change in /etc/init.d/httpd.vmware file:

start)
vmware_exec "Starting httpd.vmware:" vmware_start_httpd
;;
stop)
vmware_exec "Shutting down http.vmware: " vmware_stop_httpd
;;

by

start)
if [ ! -d /var/run/vmware/httpd ]
then
echo "Directory: var/run/vmware/httpd Not found. Creating it."
mkdir /var/run/vmware/httpd
echo "Setting user and group ownership to: User: www-data, Group: nogroup"
chown www-data:nogroup /var/run/vmware/httpd
echo "Setting directory permissions to: RWX------ (700)"
chmod 700 /var/run/vmware/httpd
fi
echo "Starting httpd.vmware:"
vmware_start_httpd
;;
stop)
echo "Shutting down http.vmware: "
vmware_stop_httpd
;;

If you use Intrepid version and can’t launch vmware console please dl patch available at this page: http://www.monarialx.it/en/vmwareserver

December 24, 2008

Add a password access to a directory of your website

Filed under: Linux — itbdc @ 12:09 pm

At first you need to create a file containing your password

htpasswd -c /var/www/itbdc/.htpasswd itbdc

Then create a file in your website: /var/www/itbdc/.htaccess

AuthType Basic
AuthUserFile /var/www/itbdc/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword

require user itbdc
require valid-user

Then edit your httpd.conf and check those two lines:

AccessFileName .htaccess
<Directory>
	[...]
    AllowOverride All
	[...]
</Directory>

/etc/init.d/httpd restart

November 17, 2008

How to insert a character in a delimited chain

Filed under: Bash, Linux — itbdc @ 9:52 am

echo “e_ff_0123_1″ | awk -F_ ‘{print $1″_”$2″_”$3″_0″$4}’

October 31, 2008

Deactivate beep in console mode linux

Filed under: Linux — itbdc @ 3:11 pm

setterm -blength 0

October 14, 2008

Select the end of a chain

Filed under: Bash, Linux — itbdc @ 8:40 am
#:~$ toto="bonjour le monde"
#:~$ echo ${toto:$((${#toto}-10))}
r le monde

${var:x} : extract sub chain of $var from char n° x to the end.
$((….)) : allow to do calculation

July 10, 2008

Ssh connection without password

Filed under: Linux — itbdc @ 1:31 pm

on client side:

ssh-keygen -t rsa

on server side:
copy the public key from client to home directory that you want to be identified
then

cat id_rsa.pub >> ~/.ssh/authorized_keys

options :
If strict_mode, chmod 600 ~/.ssh/authorized_keys
If Authentication refused : PreferredAuthentications publickey

Blog at WordPress.com.