Wednesday, January 06, 2010

 

mk.chroot

ls -al mk.chroot
-rwxr-xr-x 1 root root 2673 2009-11-01 18:41 mk.chroot

It's the new year, and I just used this mk.chroot script again. So, I thought I'd post it...

cat /etc/issue
Fedora release 8 (Werewolf)
Kernel \r on an \m

cat mk.chroot
-------------------------------------------------------------------------------------------------------
#!/bin/sh

accnt="$1"

if [ ! "$1" ]; then
echo "Usage: $0 account_name" && exit 1
fi

destdir=/www/$accnt

mkdir -p $destdir/{dev,etc,lib,usr,bin}
mkdir -p $destdir/usr/bin
mkdir -p $destdir/usr/lib
mkdir -p $destdir/usr/libexec/openssh

mknod -m 666 $destdir/dev/null c 1 3

#needed for unknown user error
cp /lib/libnss_files.so.2 $destdir/lib/

grep ^${accnt}:x: /etc/passwd > $destdir/etc/passwd
grep ^${accnt}:x: /etc/group > $destdir/etc/group

cp /usr/bin/scp $destdir/usr/bin/
cp /usr/bin/rssh $destdir/usr/bin/
cp /usr/bin/sftp $destdir/usr/bin/
cp /usr/libexec/openssh/sftp-server $destdir/usr/libexec/openssh/
cp /usr/libexec/rssh_chroot_helper $destdir/usr/libexec/
cp /bin/bash $destdir/bin/

#bash
cp /lib/libtinfo.so.5 $destdir/lib/
cp /lib/libdl.so.2 $destdir/lib/
cp /lib/libc.so.6 $destdir/lib/
cp /lib/ld-linux.so.2 $destdir/lib/


#sftp
cp /lib/libresolv.so.2 $destdir/lib/
cp /lib/libcrypto.so.6 $destdir/lib/
cp /lib/libutil.so.1 $destdir/lib/
cp /lib/libz.so.1 $destdir/lib/
cp /lib/libnsl.so.1 $destdir/lib/
cp /lib/libcrypt.so.1 $destdir/lib/
cp /usr/lib/libnss3.so $destdir/usr/lib/
cp /usr/lib/libgssapi_krb5.so.2 $destdir/usr/lib/
cp /usr/lib/libkrb5.so.3 $destdir/usr/lib/
cp /usr/lib/libk5crypto.so.3 $destdir/usr/lib/
cp /lib/libcom_err.so.2 $destdir/lib/
cp /usr/lib/libedit.so.0 $destdir/usr/lib/
cp /lib/libncurses.so.5 $destdir/lib/
cp /lib/libc.so.6 $destdir/lib/
cp /lib/libdl.so.2 $destdir/lib/
cp /usr/lib/libnssutil3.so $destdir/usr/lib/
cp /usr/lib/libplc4.so $destdir/usr/lib/
cp /usr/lib/libplds4.so $destdir/usr/lib/
cp /usr/lib/libnspr4.so $destdir/usr/lib/
cp /lib/libpthread.so.0 $destdir/lib/
cp /usr/lib/libkrb5support.so.0 $destdir/usr/lib/
cp /lib/libkeyutils.so.1 $destdir/lib/
cp /lib/libtinfo.so.5 $destdir/lib/
cp /lib/ld-linux.so.2 $destdir/lib/
cp /lib/libselinux.so.1 $destdir/lib/

#sftp-server
cp /lib/libresolv.so.2 $destdir/lib/
cp /lib/libcrypto.so.6 $destdir/lib/
cp /lib/libutil.so.1 $destdir/lib/
cp /lib/libz.so.1 $destdir/lib/
cp /lib/libnsl.so.1 $destdir/lib/
cp /lib/libcrypt.so.1 $destdir/lib/
cp /usr/lib/libnss3.so $destdir/usr/lib/
cp /usr/lib/libgssapi_krb5.so.2 $destdir/usr/lib/
cp /usr/lib/libkrb5.so.3 $destdir/usr/lib/
cp /usr/lib/libk5crypto.so.3 $destdir/usr/lib/
cp /lib/libcom_err.so.2 $destdir/lib/
cp /lib/libc.so.6 $destdir/lib/
cp /lib/libdl.so.2 $destdir/lib/
cp /usr/lib/libnssutil3.so $destdir/usr/lib/
cp /usr/lib/libplc4.so $destdir/usr/lib/
cp /usr/lib/libplds4.so $destdir/usr/lib/
cp /usr/lib/libnspr4.so $destdir/usr/lib/
cp /lib/libpthread.so.0 $destdir/lib/
cp /usr/lib/libkrb5support.so.0 $destdir/usr/lib/
cp /lib/libkeyutils.so.1 $destdir/lib/
cp /lib/libselinux.so.1 $destdir/lib/

exit 0
-------------------------------------------------------------------------------------------------------

 
the search function no longer returns results on my blog site, and it is very annoying.

Tuesday, August 08, 2006

 

multi-row insert, mysql

# users is a list of (userid, first_name, last_name, company)
c = db.cursor()
c.executemany("""INSERT INTO users
(userid, first_name, last_name, company)
VALUES (%s, %s, %s, %s)""", users)
db.commit()

In MySQLdb, this is converted internally to a multi-row INSERT, which is reported to be 2-3 orders of magnitude faster. Also works for REPLACE.


Friday, August 04, 2006

 

http://www.cites.uiuc.edu/wsg/talks/ipfilter/index.html

http://www.cites.uiuc.edu/wsg/talks/ipfilter/index.html

Thursday, August 03, 2006

 

http://www.sun.com/bigadmin/features/articles/ipfilter.html

http://www.sun.com/bigadmin/features/articles/ipfilter.html

Monday, July 10, 2006

 

adduser 3.81

adduser (3.81) unstable; urgency=low

   
[ Marc Haber ]

* fix swedish manpage addendum thanks to Thomas Huriaux.

* Update Swedish (sv) manpage translation, again from Daniel Nylander.

* Update French (fr) program translation. Thanks to Aurelien Ricard. (mh) Closes: #341264



[ Joerg Hoh ]

* (nearly) all output should now use gettext

* deluser now removes also user crontabs

* added only-if-empty parameter to delgroup.conf (Closes: #347717)

* improved search for new uid/gid (thanks to Karl Rink) (Closes: #119597)

 -- Marc Haber <mh+debian-packages@zugschlus.de>  Sat, 4 Feb 2006 11:57:27 +0000

http://packages.debian.org/changelogs/pool/main/a/adduser/adduser_3.91/changelog


Sunday, July 09, 2006

 

Black Hat Posted by Picasa

Saturday, June 24, 2006

 

Windows Vista Beta 2 attempt 2 Toshiba Satellite


Windows Vista Beta 2 attempt 2 Toshiba Satellite Posted by Picasa

Q. What is required to run Windows Vista?
A. If you purchased a PC in the last two years, chances are good that you can run Windows Vista today. To install and run the core functionality of Windows Vista, you need:

An 800 MHz processor
512 MB of RAM
A 20 GB hard drive with 15 GB of free space

http://www.microsoft.com/windowsvista/getready/upgradeadvisor/faq.mspx

This page is powered by Blogger. Isn't yours?