Wednesday, September 24, 2008

linux adduser bash batch script

#!/bin/bash

NEW_USERS="/path/to/file.txt" #space separated user password group
HOME_BASE="/home/"

cat ${NEW_USERS} | \
while read USER password GROUP
do
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
useradd -g ${GROUP} -p ${pass} -m -d ${HOME_BASE}${USER} ${USER}
done

Monday, September 22, 2008

sshfs mount

sudo mkdir /mount/remote
sudo modprobe fuse
sshfs asdf@192.168.0.251:/ /mount/remote/

Friday, September 5, 2008

ltsp - xserver configuration

first in /etc/ltsp/dhcp.conf add/change this line: option root-path "/var/lib/tftpboot/ltsp/i386";
dhcp example:

authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.200 192.168.0.250;
option domain-name "example.com";
option domain-name-servers 192.168.0.150;
option broadcast-address 192.168.0.255;
option routers 192.168.0.150;
# next-server 192.168.0.1;
# get-lease-hostnames true;
option subnet-mask 255.255.255.0;
# option root-path "/opt/ltsp/i386";
option root-path "/var/lib/tftpboot/ltsp/i386";
if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
filename "/ltsp/i386/pxelinux.0";
} else {
filename "/ltsp/i386/nbi.img";
}
}


Then edit your /var/lib/tftpboot/ltsp/i386/lts.conf file.
Example:

[00:12:FB:01:74:AF]
# LDM_AUTOLOGIN=true
# LDM_USERNAME=ucenik01
# LDM_PASSWORD=ucenik
SOUND=False
XSERVER = sis
X_MODE_0 = 1280x1024
X_MODE_1 = 1024x768
X_MODE_2 = 800x600


Sunday, July 20, 2008

mpg123

VirginRadio
mpg123 -C -k 64 http://85.159.184.42:80

Play single mp3
mpg321 MP3_FILE_NAME

Create a list of all MP3 Files in the current folder…
find . -name "*.mp3"|sed 's/\.\///;'|sort>List.lst

Use this list as the play list for mpg321
mpg123 --list List.lst

Saturday, May 10, 2008

How to turn on automatic logon in Windows XP

1. Click Start, and then click Run.
2. In the Open box, type control userpasswords2, and then click OK.

Note When users try to display help information in the User Accounts window in Windows XP Home Edition, the help information is not displayed. Additionally, users receive the following error message:
Cannot find the Drive:\Windows\System32\users.hlp Help file. Check to see that the file exists on your hard disk drive. If it does not exist, you must reinstall it.
3. Clear the "Users must enter a user name and password to use this computer" check box, and then click Apply.
4. In the Automatically Log On window, type the password in the Password box, and then retype the password in the Confirm Password box.
5. Click OK to close the Automatically Log On window, and then click OK to close the User Accounts window.

Sunday, May 4, 2008

This will shutdown your box 1 minute after the file download completes:

sudo -s; wget http://www.theaddress.com/fiesty.iso; shutdown -h +1

TOO CANCEL A SHUTDOWN:

sudo shutdown -c

Wednesday, April 30, 2008

usb privelages

Give the user permission to load drivers, you can access this going to the
Control Panel > Administrative Tools > Local Security Policy > Local
Policies > User Rights Assignment > Load and Unload Device Drivers.