Using rar in Linux
Q : How can I open and extract rar file ?
Rar files are compressed file, you need to decompressed it or unrar it.
There is linux software called unrar, able to read , open and extract rar files.
$ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
Untar the downloaded file
$ tar -zxvf rarlinux-3.6.0.tar.gz
Both unrar and rar commands are located in rar sub-directory. Just […]
Import into Samba
Here is a simple bash script to import a csv file into samba server.
# vi importsamba.sh
#!/bin/bash
CSVFILE=/home/domainnameyahoo/listusers.csv
CMD=`which smbldap-adduser`
for i in `cat $CSVFILE|sed ’s/, /,/g’`; do
UN=`echo $i | cut -f1 -d’,’`
PW=`echo $i | cut -f2 -d’,’`
echo $CMD$UN -P $PW
done
the CSV format is :
username1,password1
username2,password2
….
Hope this will help.