I just purchased a Samsung ML-2010 Mono Laser Printer and wanted to turn it into a network printer. Since my linux box is online 24/7 I connected the printer to it. Something good about it is that it came with drivers for linux. So I ran the installer in the CD and installed the drivers. Than I used the configuration tool provided with the CD to install and configure the printer. CUPS was happy with it. I use slackware linux so i just had to chmod +x /etc/rc.d/rc.cups and now my printing daemon starts on boot. So the linux printing was done. But I also have an iBook and my roomate has windows box. So I had to configure SAMBA. Here is my config file:

[global]
netbios name = Geodar
security = SHARE
passdb backend = guest
ldap ssl = no
hosts allow = 192.168.0.

[share]
path = /mnt/D
read only = No
guest ok = Yes

[ml-2010]
path = /var/spool/samba
guest ok = Yes
printable = Yes
use client driver = Yes

that’s it.
My printers.conf for CUPS is :

<DefaultPrinter ML-2010>
Info Samsung ML-2010 Series (SPL II)
Location
DeviceURI usb:/dev/usb/lp0
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>

cupsd.conf is a little bigger but all I did was to add Allow From 192.168.0.* below every Allow From 127.0.0.1
restarted cupsd
started smbd
and the next step was to install the driver on the windows and mac machines.
Installing the printer under windows is easy. Just browse the server IP(where the printer is connected) and you should see the shared printer. Right click on it and select connect. After it finishes updating/installing you should be good to go.

Under Mac OS X, however, was a little tricky.
After installing the driver I ran the Printer Setup Utility (in System preferences, Print & Fax and you click on the +).
Pressing and holding the Option key, click on More Printers. keep holding the Option key and on the first drop down menu select Advanced. On the second select Windows Share. Now you can releise the option key. In the dialog just enter the name for your printer “Samsung ML-2010” in my case. Than in the address enter “smb://192.168.0.109/ml-2010” < – the ip is the IP of the server and the ml-2010 is the name of the printer share in your samba configuration.
Than from the drivers select the allready installed Samsung Driver and you are all set.

Now everyone in our house can print from our small Samsung ml-2010.

This script is an updated version of the one posted by max.hedroom in cpanel.net forums. It supports scp/ftp uploads and remote directories. You can execute this script from you scp host,home computer or your host server. I’d suggest using it from your own machine since it contains plan text passwords!
All You have to do is save the following code to a .php file and add a cron job to execute the php file every tome you would like to have a full backup of your entire web page(emails, DBs, web files) on your own machine.
Enjoy

< ?php // PHP script to allow periodic cPanel backups automatically. // Based on script posted by max.hedroom in cpanel.net forums // This script contains passwords. KEEP ACCESS TO THIS FILE SECURE! // It is updated to support secure ftp connections and remote directories // ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED ********* // Info required for cPanel access $cpuser = "username"; // Username used to login to CPanel $cppass = "password"; // Password used to login to CPanel $domain = "www.host.com"; // Domain name where CPanel is run $skin = "x"; // Set to cPanel skin you use (script won't work if it doesn't match) // Info required for FTP/SFTP host $ftpuser = "sshusername"; // Username for FTP(SCP) account $ftppass = "sshpassword"; // Password for FTP(SCP) account $ftphost = "sshhost"; // Full hostname or IP address for FTP(SCP) host $ftpmode = "scp"; // FTP mode ("ftp" for active, "passiveftp" for passive, "scp" for secure ftp) $ftpport = "22"; // PORT for FTP(SCP) host $ftprdir = "/path/to/directory"; //Remote Directory on SCP host // Notification information $notifyemail = "mailto@somehost.com"; // Email address to send results // Secure or non-secure mode $secure = 1; // Set to 1 for SSL (requires SSL support), otherwise will use standard HTTP // Set to 1 to have web page result appear in your cron log $debug = 0; // *********** NO CONFIGURATION ITEMS BELOW THIS LINE ********* if ($secure) { $url = "ssl://".$domain; $port = 2083; } else { $url = $domain; $port = 2082; } $socket = fsockopen($url,$port); if (!$socket) { echo "Failed to open socket connection!\n"; exit; } // Encode authentication string $authstr = $cpuser.":".$cppass; $pass = base64_encode($authstr); $params = "dest=$ftpmode&email=$notifyemail&server=$ftphost&user=$ftpuser &pass=$ftppass&port=$ftpport&rdir=$ftprdir&submit=Generate Backup"; // Make POST to cPanel fputs($socket,"POST /frontend/".$skin."/backup/dofullbackup.html?".$params." HTTP/1.0\r\n"); fputs($socket,"Host: $domain\r\n"); fputs($socket,"Authorization: Basic $pass\r\n"); fputs($socket,"Connection: Close\r\n"); fputs($socket,"\r\n"); // Grab response even if we don't do anything with it. while (!feof($socket)) { $response = fgets($socket,4096); if ($debug) echo $response; } fclose($socket); ?>

Сложих малко от новите снимки на галерията. Добавих снимки на Плеадите, на наводненията от дъжда и на един тиквички, които си правихме наскоро. За по-голямо удобство преместих албумите с новите снимки в началото на първата страница.

I reserve the right to change the howto and I’ll not be held responsible if ANY
damage is caused by this how-to. If you don’t agree please do not use it! Thanks

The idea of this how-to is to help you deal with this situation:

Imagine you have server with let’s say 10 users. Your server is getting too old
and you want to upgrade it. A good system administrator will not just shut down
the old server work on the new one for few days and then bring it up. A better
solution would be to leave the old server runnin, build the new one, configure
the new one, copy user files from old one to new one and for few seconds just
switch the IPs of both servers.

Now the problem comes when users change their files after you have transfered
them to the new server but before you have switched the IPs.

In this howto I’ll give you set of commands to run and set a cron job that will
update your /home for example every hour without causing high trafic on the
network. Only the first time!

What you need is:
ssh(d) on both servers
rsync on both servers
OpenSSL on both servers

Let’s give some names to our servers:
New server = thunder(192.168.0.101)
Old server = light(102.168.0.100)

we have a bunch of directories in /home/ on “light” that we want to transfer to
/home/ on “thunder”

here is what we do:

SSH no password part:
login to thunder as root
execute:
thunder#mkdir -p /root/.ssh
thunder#chmod 0700 /root/.ssh
thunder#ssh-keygen -t dsa -f /root/.ssh/id_dsa -P ” (two single quotes)

now you will have two new files:
/root/.ssh/id_dsa(your private key)
/root/.ssh/id_dsa.pub(your public key)

login to light as root
execute:
light#scp 192.168.0.101:.ssh/id_dsa.pub .
light#cat id_dsa.pub >> /root/.ssh/authorized_keys2
light#chmod 0600 /root/.ssh/authorized_keys2
NOTE: you might have to do the same for /root/.ssh/authorized_keys

now try to login from thunder to light with the key:
from thunder execute:
thunder#ssh -i /root/.ssh/id_dsa 192.168.0.100
you should login to light without entering password

!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!
if someone gains root access on thunder he will be able to ssh to light without
entering any password if he figures out that you have a key!
!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!

if everything is OK let’s test it trough rsync:

create a directory on light and touch some files:
light#mkdir /home/testdir
light#cd /home/testdir
light#touch a
light#touch b

from thunder execute:
thunder#rsync -azx –delete –numeric-ids -e “ssh -i /root/.ssh/id_dsa” \
192.168.0.100:/home/testdir/ /home/testdir/

you should now see /home/testdir on thunder with a and b in it

now move a to c on light:
light#mv /home/testdir/a /home/testdir/c

execute the same rsync command on thunder:
thunder#rsync -azx –delete –numeric-ids -e “ssh -i /root/.ssh/id_dsa” \
192.168.0.100:/home/testdir/ /home/testdir/

now on thunder you should have /home/testdir/b and /home/testdir/c

the ownership will be preserved while the uid and gid on both thunder and light
match(and they should, but that other how-to 🙂

now go to /etc/cron.hourly on thunder and add the rsync line:
thunder# cd /etc/cron.hourly
thunder# echo “rsync -azx –delete –numeric-ids -e “ssh -i /root/.ssh/id_dsa” \
192.168.0.100:/home/ /home/” > rsync_home_update

And that’s it! Every hour thunder will sync its /home/ with /home/ on light
remember that both directories will be identical, that means if you have new
users on thunder that are not on light, their home directoreis will be deleted!
to avoid that, create /home/oldusers/ and sync /home/ on light to /home/oldusers/
on thunder. Don’t forget to move it later when you switch the servers or change
/etc/passwd on thunder to point to the correct home directories!

Good Luck

This how-to is made to help you configure your software raid and boot your root from it.

I’m doing this on slackware 10 with updated udev and mdadm, kernel 2.6.11-rc4

first you need to make sure that your raid support is IN your kernel, not as modules.
here is my config:
/usr/src/linux# grep -i raid .config
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# Multi-device support (RAID and LVM)
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
# CONFIG_MD_RAID10 is not set
# CONFIG_MD_RAID5 is not set
# CONFIG_MD_RAID6 is not set

I have a small /dev/hda1 partition that I used to install the system and configure the latest kernel.

here is how my two drives are partitioned:
~# fdisk -l /dev/hda

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 255 2048256 83 Linux
/dev/hda2 256 498 1951897+ 82 Linux swap
/dev/hda3 499 3537 24410767+ fd Linux raid autodetect
/dev/hda4 3538 19457 127877400 fd Linux raid autodetect

/dev/hdc is the same.

so, I have /dev/hda1 as a boot partition
/dev/hdc1 as a temp root partition
/dev/hd[ac]2 for swap
/dev/hd[ac]3 for /
/dev/hd[ac]4 for /home

when you create your partitions use FD not 83 for partition type if you want your raid to be detected at boot later…

now just execute the following:
mdadm –create /dev/md0 –chunk=32 –level=1 –raid-devices 2 /dev/hd[ac]3

this will create a raid1 device for / on /dev/md0

mdadm –create /dev/md1 –chunk=32 –level=1 –raid-devices 2 /dev/hd[ac]4

and finally a /dev/md1 for the /home partition under raid1 again

Now you can observe /proc/mdstat. You’ll have something like:

~# cat /proc/mdstat

md1 : active raid1 hdc4[1] hda4[0]
127877312 blocks [2/2] [UU]
resync=DELAYED
md0 : active raid1 hdc3[1] hda3[0]
24410688 blocks [2/2] [UU]
[================>….] resync = 82.5% (20147072/24410688) finish=1.5min speed=46944K/sec

if you have problems with /dev/md* just use –auto after the –create instead of /dev/mdX
and mdadm will create md1 and md2 for your two raids (it will number them by the order of
execution of the mdadm –create command)

next:
mkreiserfs (or whatever fs you prefer) /dev/md0 (or md1 if you have used –auto)

our next task is to move the current installation on the RAID:

mkdir /mnt/newroot
mount /dev/md0(1) /mnt/newroot
cd /

now I use tar to move all my files, that way I’m sure it will preserve my links and perms.

in bash:
(cd /;tar cpf – ./bin ./dev ./proc ./sbin ./tmp ./var ./etc ./lib ./opt ./root ./usr ./sys)|(cd /mnt/newroot;tar xvpf -)

and watch 🙂

you might see some errors in /sys/ but that’s OK
now create home and boot:
mkdir /mnt/newroot/home
mkdir /mnt/newroot/boot

if you have more directories just put them in the list above. I had to use a list because I don’t want to move /boot
(separate partition) and /mnt

create /mnt/newroot/mnt/oldroot 🙂
now edit your /mnt/newroot/etc/fstab. Here is mine:
/dev/hda2 swap swap defaults 0 0
/dev/hdc2 swap swap defaults 0 0
/dev/md0 / reiserfs defaults 1 1
/dev/md1 /home reiserfs defaults 1 2
/dev/hda1 /boot ext2 defaults 1 2
/dev/hdc1 /mnt/oldroot reiserfs defaults 1 2
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

this should do the work.

and the last one:
vim /etc/lilo.conf

if you have something like:
image = /boot/bzImage-2.6.11
root = /dev/hdc1
label = Linux2.6
read-only

add another block:
image = /boot/bzImage-2.6.11
root = /dev/md0
label = Linux2.6RAID
read-only

run “lilo”
in this case your kernel will be the same. I assume you are doing the above work under your new kernel.
That means you have raid support

now reboot and choose Linux2.6RAID

Good Luck!