Mailserver on freebsd with qmail

cd /usr/ports/mail/qmail
make install
make disable-sendmail
make enable-qmail
cd ../vpopmail
make install
cd /usr/ports/mail/qmail/work/qmail-1.03
./config-fast unifix.org
cd /var/qmail/boot
cp maildir /var/qmail/rc

echo smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-smtpd > /etc/inetd.conf
echo pop3 stream tcp nowait root /var/qmail/bin/qmail-popup qmail-popup unifix.org /usr/local/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir >> /etc/inetd.conf

echo inetd_enable=”yes” > /etc/rc.conf

Udgivet i FreeBSD, Knowledge Base, Old Base | Skriv en kommentar

Normal POP3/SMTP operation

Reff til post nr 33 af BT Normal SMTP operation

Vi telnetter til POP3 serveren:
bash-2.05b$ telnet 192.168.10.180 110
Trying 192.168.10.180…
Connected to 192.168.10.180.
Escape character is ‘^]’.
+OK <2833.1090064063@unifix.org>
user test@test.com
+OK
pass testpass
+OK
stat
+OK 0 0
quit
+OK
Connection closed by foreign host.
Faar at vide at der ingen mail er , foerste 0-tal, og at de tilsammen fylder 0 bytes, det andet nul-tal. Nu sender vi en mail til test@test.com

bash-2.05b$ telnet 192.168.10.180 25
Trying 192.168.10.180…
Connected to 192.168.10.180.
Escape character is ‘^]’.
220 unifix.org ESMTP
helo testbox.com
250 unifix.org
mail from: test@testbox.com
250 ok
rcpt to: test@test.com
250 ok
data
354 go ahead
Dette er en SMTP test, du har nu en email
.
250 ok 1090064149 qp 2839
quit
221 unifix.org
Connection closed by foreign host.
Der ligger nu en mail i test@test.com’s maildir.

bash-2.05b$ telnet 192.168.10.180 110
Trying 192.168.10.180…
Connected to 192.168.10.180.
Escape character is ‘^]’.
+OK <2843.1090064162@unifix.org>
user test@test.com
+OK
pass testpass
+OK
stat
+OK 1 291
— Vi faar at vide vi har 1 mail der fylder 291 bytes.
list
+OK
1 291
.
— En liste over alle mails paa kontoen, mail nr 1 fylder 291 bytes
retr 1
+OK
Return-Path: <test@testbox.com>
Delivered-To: test@test.com
Received: (qmail 2839 invoked from network); 17 Jul 2004 11:35:41 -0000
Received: from unknown (HELO testbox.com) (192.168.10.121)
by 192.168.10.180 with SMTP; 17 Jul 2004 11:35:41 -0000
Dette er en SMTP test, du har nu en email

.
— Og saaledes fik vi indholdet af mail nr 1

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Change rsync server

Lets say the server has this ip: 192.168.0.1 , then add this to your /etc/make.conf :
SYNC=”rsync://192.168.0.1/gentoo-portage”

Then the clients will sync from that server when doing ’emerge sync’ .

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

How to setup a Gentoo Linux Portage Tree rsync daemon on slackware

How to setup a Gentoo Linux Portage Tree rsync daemon on slackware

First you install rsync by using swaret:
swaret –install rsync

Then we have to create a directory to store the portage mirror in, here we use: /mnt/cache/rsync/portage
After creating the directory we need to create a few scripts and config files.

Create the directory /etc/rsync and create these two files:

/etc/rsync/rsyncd.motd :
————————————— File start
Type your welcome message here, it will be displayed when people sync with your mirror.
————————————— File end

/etc/rsync/rsyncd.conf :
————————————— File start
uid = nobody
gid = nobody
use chroot = yes
max connections = 10
pid file = /var/run/rsyncd.pid
motd file = /etc/rsync/rsyncd.motd

[gentoo-portage]
path = /mnt/cache/rsync/portage
comment = Gentoo Linux Portage tree mirror
exclude = distfiles
————————————— File end

Change path if you are going to use another directory.

/etc/rc.d/rc.rsyncd :
————————————— File start
#!/bin/sh
/usr/bin/rsync –daemon –config=/etc/rsync/rsyncd.conf
————————————— File end

chmod +x the script, and add it to /etc/rc.d/rc.M
Then create this script to make it sync the tree against the master servers once a day:

/etc/cron.daily/irsyncd :
————————————— File start
#!/bin/sh
/usr/bin/rsync –recursive –links –safe-links –perms –times \
–compress –force –whole-file –delete –delete-after \
–stats –timeout=180 –exclude=distfiles/* –exclude=local/* \
–exclude=packages/* –progress rsync://rsync.gentoo.org/gentoo-portage/* \
/mnt/cache/rsync/portage
————————————— File end

chmod +x the script, and run it to do an initial sync to so you do not have till midnight.

If you are using a firewall on the server, you have to open port 873 TCP .

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

The Gentoo Framebuffer, Bootsplash & Grubsplash How-To

The Gentoo Framebuffer, Bootsplash & Grubsplash How-To
(now updated for 2.6.x kernel tree)

Note: This guide may only be translated or reproduced with the explicit permission of the author. Please PM me.

Post documentation, tips and tricks on this thread.
Post questions, problems and answers on the support thread.
Post topic related gentoo specific bugs on the bugs site.

Latest Screenshot

Self Portrait (Kernel 2.6.4)

Patches

Here are bootsplash patches for all available kernel versions.

* 2.4.20 | Origin
* 2.4.21 | Origin
* 2.4.22 | Origin
* 2.6.0 | Origin
* 2.6.3 | Origin
* 2.6.5 | Origin
* 2.6.6 | Origin
* 2.6.7 | Origin – New!

Objectives

* High resolution framebuffer (example)
* High resolution bootsplash image (example)
* Smaller fonts on framebuffer for greater area (example)
* Greater choice of fonts for varied appearance
* Personalising your bootsplash theme (example)
* Taking screenshots of your framebuffer and bootsplash
* Using multimedia apps and graphical browser on framebuffer
* Personalising your grub splash screen image
* Extending framebuffer and bootsplash to all 12 virtual terminals

Benefits

* Higher resolution
* Configurable and pretty appearance
* Multimedia and graphical browser capability on VTs
* Framebuffer will work on any kernel version

Drawbacks

* Slow scrolling of text output on VTs
* Reduced or zero scroll back buffer

High resolution framebuffer & bootsplash!

1. Update portage tree.
Code:
emerge sync

2. Emerge media-gfx/bootsplash (graphical backgrounds for frame buffer consoles).
Code:
emerge bootsplash

Overwrite your old bootsplash configuration files.
Code:
etc-update

3. Check that the symbolic link /usr/src/linux is pointing to the kernel of your choice.
Code:
ls -l /usr/src/

Some kernels such as gentoo-sources, gaming-sources and xfs-sources already have the bootsplash patch built in. Check whether your kernel supplies bootsplash and if it does not have it then patch the kernel as below.
Code:
ebuild /var/db/pkg/media-gfx/bootsplash-0.6-r2/bootsplash-0.6-r9.ebuild config

Or you can run the following command which takes an additional argument and executes the line above.
Code:
bootsplash_patch

4. Enter the kernel configuration.
Code:
cd /usr/src/linux
make menuconfig

For all kernel trees build these options directly into your kernel. Do NOT make them modules and do not enable nvidia or ATi specific options.

For 2.6.x kernel tree enable the following options.
Code:
Code maturity level options —>
[*] Prompt for development and/or incomplete code/drivers
Processor type and features —>
[*] MTRR (Memory Type Range Register) support
Device Drivers —>
Block devices —>
<*> Loopback device support
<*> RAM disk support
(4096) Default RAM disk size
[*] Initial RAM disk (initrd) support
Graphics support —>
[*] Support for frame buffer devices
[*] VESA VGA graphics support
Console display driver support —>
[*] Video mode selection support
<*> Framebuffer Console support
Bootsplash configuration —>
[*] Bootup splash screen

For 2.4.x kernel tree enable the following options.
Code:
Code maturity level options —>
[*] Prompt for development and/or incomplete code/drivers
Processor type and features —>
[*] MTRR (Memory Type Range Register) support
Block Devices ->
[*] Loopback device support
[*] RAM disk support
(4096) Default RAM disk size
[*] Initial RAM disk (initrd) support
Console Drivers ->
[*] VGA text console
[*] Video mode selection support
Console Drivers -> Frame-buffer support ->
[*] Support for frame buffer devices
[*] VESA VGA graphics console
[*] Use splash screen instead of boot logo

For any kernel do NOT enable the following options or else you risk bootsplash not working or framebuffer corruption when switching VTs.
Code:
Device Drivers —>
Graphics support —>
< > nVidia Riva support (do not enable!)
Logo configuration —>
[ ] Bootup logo (do not enable!)

If you have problems later disable the following option in kernel
Code:
Device Drivers —>
Character devices —>
< > /dev/agpgart (AGP Support)

And add the following line to your /etc/X11/XF86Config[-4] file.
Code:
Option “NvAGP” “1”

5. Compile your kernel as below for 2.6.x kernel.
Code:
make

Compile your kernel as below for 2.4.x kernel.
Code:
make dep && make clean bzImage modules modules_install

Install your kernel as below but do NOT unmount /boot and do NOT reboot until asked to later.
Code:

mount /boot
mv /boot/bzImage /boot/bzImage.old
cp /usr/src/linux/arch/i386/boot/bzImage /boot/

If you get errors during kernel compilation or missing options during configuration do as below.
Code:
cd /usr/src/linux/
mv .config ~/kernel.config
make mrproper
mv ~/kernel.config .config
make oldconfig
make menuconfig

6. Assuming /boot is mounted set an image to appear during the boot process.
Code:
/sbin/splash -s -f /etc/bootsplash/default/config/bootsplash-1280×1024.cfg > /boot/initrd-1280×1024

Or you can copy an already exisiting initrd image that is provided with the bootsplash package.
Code:
cp /usr/share/bootsplash/initrd-1280×1024 /boot/

7. Edit your /boot/grub/grub.conf file. The example below has been provided for your convenience. Here are the meanings of the various parameters.

* video= goes on kernel line and controls display options such as ywrap and mtrr which speed up framebuffer scrolling
* vga= goes on kernel line and controls the resolution and colour depth of framebuffer
* splash= goes on kernel line and takes either ‘silent’ or ‘verbose’ but silent boots may not work
* initrd= goes on a new line after kernel line and loads an image during the booting process.
Code:
default 0
timeout 10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

# With both framebuffer and bootsplash
title=Gentoo GNU/Linux 1.4 (+fb +splash)
root=(hd0,0)
kernel=(hd0,0)/boot/bzImage root=/dev/hda3 video=vesafb:ywrap,mtrr vga=0x31A
initrd=/boot/initrd-1280×1024

# With framebuffer but without bootsplash
title=Gentoo GNU/Linux 1.4 (+fb -splash)
root=(hd0,0)
kernel=(hd0,0)/boot/bzImage root=/dev/hda3 video=vesafb:ywrap,mtrr vga=0x31A

# Without both framebuffer and bootsplash
title=Gentoo GNU/Linux 1.4 (-fb -splash)
root=(hd0,0)
kernel=(hd0,0)/boot/bzImage root=/dev/hda3

Here is a lilo.conf example configuration courtesy of ophidia.
Code:
image=”/boot/bzImage”
vga=0x31A
root=”/dev/hdb2″
label=”2.4.20-r4″
read-only # read-only for checking
append=”hdc=ide-scsi video=vesafb:ywrap,mtrr”
initrd=/boot/initrd-1280×1024

Note that in the above grub and lilo configuration examples the keyword ‘vesafb’ is applicable to 2.6.x kernels. For 2.4.x kernels it should be changed to ‘vesa’.

Here is a chart of kernel mode numbers for the ‘vga=’ boot parameter.
Code:
| 640×480 800×600 1024×768 1280×1024
—-+————————————-
256 | 0x301 0x303 0x305 0x307
32k | 0x310 0x313 0x316 0x319
64k | 0x311 0x314 0x317 0x31A
16M | 0x312 0x315 0x318 0x31B

If you want to find ALL video modes for use with the framebuffer look at this forum post for further information on how to find it yourself.

Look at the following reference files if you need more detailed information.

Code:
/usr/share/bootsplash/grub.conf.sample
/usr/src/linux/Documentation/fb/vesafb.txt
/usr/src/linux/Documentation/svga.txt

8. Add bootsplash to the default run level so that it starts on every boot.
Code:
rc-update add bootsplash default

9. Reboot and bask in the glory of bootplash wonder. To remind yourself of what kernel parameters you booted with do as below.
Code:
cat /proc/cmdline

Setting framebuffer without bootsplash!

* To have a framebuffer only without bootsplash for greater area remove bootsplash from your default run level and reboot.
Code:
rc-update del bootsplash default

* Remove or comment out this line from your chosen menu entry in grub.conf.
Code:
initrd=/boot/initrd-1280×1024

Smaller fonts on framebuffer for greater area!

* Open /etc/rc.conf and change the following variable.
Code:
CONSOLEFONT=”default8x9″

* To see what other fonts are available for use look in the following location and add the name without the extension to /etc/rc.conf.
Code:
/usr/share/consolefonts

Extending consolefont, framebuffer and bootsplash to all 12 virtual terminals!

* Open /etc/init.d/consolefont and change all instances of
Code:
for x in 1 2 3 4 5 6 7 8 9 10
to
Code:
for x in `seq 1 12`

* Open /etc/conf.d/bootsplash.conf and change the following variable as below.
Code:
BOOTSPLASH_TTYS=”0 1 2 3 4 5 7 8 9 10 11″

* For the above changes to take effect you can either reboot or restart the above init.d scripts as below. Voila!
Code:
/etc/init.d/consolefont restart
/etc/init.d/bootsplash restart

Personalising your bootsplash theme!

* Create your own directory structure called ‘personal’.
Code:
mkdir -p /etc/bootsplash/personal/images/
cp -r /etc/bootsplash/default/config /etc/bootsplash/personal/

* Change the symbolic link for the default theme.
Code:
rm /etc/bootsplash/default
ln -s /etc/bootsplash/personal /etc/bootsplash/default

* Open /etc/conf.d/bootsplash.conf and change as below.
Code:
BOOTSPLASH_THEME=personal

* Copy images of your choice and of correct resolution and depth into /etc/bootsplash/personal/images/. Make sure images have a resolution of 96×96 and not 300×300. Note that this is not image size but rather ‘pixels per inch’. For more information look here.
* Open /etc/bootsplash/personal/config/bootsplash-1280×1024.cfg and change paths below to point to your images.
Code:
jpeg=/etc/bootsplash/gentoo/images/bootsplash-1280×1024.jpg
silentjpeg=/etc/bootsplash/gentoo/images/silent-1280×1024.jpg

* To have your image appear during boot add it to /boot otherwise omit this step.
Code:
mount /boot
/sbin/splash -s -f /etc/bootsplash/default/config/bootsplash-1280×1024.cfg > /boot/initrd-1280×1024

* Reboot, test and post feedback.

Taking screenshots!

* To use fbgrab emerge it as root and execute it as normal user on terminal 1.
Code:
emerge fbgrab
fbgrab ~/console.png

Personalising your grub splash image!

* To change your grub splash image create an image then move it to /boot/grub. As root do the following.
Code:
emerge gimp
wget http://dhruba.codewordt.co.uk/files/grub-image.scm -P ~
mv ~/grub-image.scm /usr/share/gimp/1.2/scripts/

* Start gimp and open an image of your choice. Right click on the image, select File, Grub Boot Image and save in your home directory. A sample image is provided in instructions below for you to try. Other images can be found here which is a very useful resource.
Code:
mount /boot
wget http://linux.tkdack.com/downloads/grub/powered-by.xpm.gz -P ~
mv ~powered-by.xpm.gz /boot/grub/

* Modify /boot/grub/grub.conf to point to the new image.
Code:
splashimage=(hd0,0)/boot/grub/gentoo-boot.xpm.gz

* To create images of the correct kind either follow the command line instructions at linux.tkdack.com duplicated below for convenience or use the gimp plugin.
Code:
convert -size 800×600 file.jpg -resize 640×480 -colors 15 -profile ‘*’ file.xpm
Code:
gzip file.xpm

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Dealing with bios password (untested, please report back)

drawfour says “Yes, you can reset the BIOS password, but it requires more than hitting the power button and plugging something in.”

yes, all you need is a command prompt (msdos boot disk) then type:
DEBUG

and hit Enter. You’ll see a dash (-) at the DEBUG prompt. Now type:

o 70 2e

which will show as -o 70 2e at the DEBUG prompt. Hit Enter. Then type:

o 71 ff

and hit Enter. Finally type:

Q

that is one of the ways, there are a few others. don’t work in all situations, but will work in most i’ve had to deal with.

* found on /.

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

How to setup a Gentoo Linux Portage Tree rsync daemon on slackware

How to setup a Gentoo Linux Portage Tree rsync daemon on slackware

First you install rsync by using swaret:
swaret –install rsync

Then we have to create a directory to store the portage mirror in, here we use: /mnt/cache/rsync/portage
After creating the directory we need to create a few scripts and config files.

Create the directory /etc/rsync and create these two files:

/etc/rsync/rsyncd.motd :
————————————— File start
Type your welcome message here, it will be displayed when people sync with your mirror.
————————————— File end

/etc/rsync/rsyncd.conf :
————————————— File start
uid = nobody
gid = nobody
use chroot = yes
max connections = 10
pid file = /var/run/rsyncd.pid
motd file = /etc/rsync/rsyncd.motd

[gentoo-portage]
path = /mnt/cache/rsync/portage
comment = Gentoo Linux Portage tree mirror
exclude = distfiles
————————————— File end

Change path if you are going to use another directory.

/etc/rc.d/rc.rsyncd :
————————————— File start
#!/bin/sh
/usr/bin/rsync –daemon –config=/etc/rsync/rsyncd.conf
————————————— File end

chmod +x the script, and add it to /etc/rc.d/rc.M
Then create this script to make it sync the tree against the master servers once a day:

/etc/cron.daily/irsyncd :
————————————— File start
#!/bin/sh
/usr/bin/rsync –recursive –links –safe-links –perms –times \
–compress –force –whole-file –delete –delete-after \
–stats –timeout=180 –exclude=distfiles/* –exclude=local/* \
–exclude=packages/* –progress rsync://rsync.gentoo.org/gentoo-portage/* \
/mnt/cache/rsync/portage
————————————— File end

chmod +x the script, and run it to do an initial sync to so you do not have till midnight.

If you are using a firewall on the server, you have to open port 873 TCP .

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

Tabel over cybercitys byforkortelser i hostnames

# Oversigt over danske byforkortelser brugt i hostnames hos Cybercity

Albertslund alb
Allerød aroe
Amagerbro amb
Bagsværd bav
Ballerup ba
Birkerød bi
Borups_Alle khk
Brøndbyøster boet
Brønshøj brh
Byen by
Esbjerg es
Farum fm
Fredericia fa
Frederikshavn fh
Frederikssund fs
Fredriksværk frv
Gentofte gj
Gjellerup gjp
Glostrup gl
Grenå gr
Haderslev had
Hasselager hc
Hedehusene hh
Hellerup hl
Helsingør hg
Herlev he
Herning hr
Hillerød hi
Hjørring hj
Hobro hb
Holbaek hk
Holstebro ho
Holte hot
Horsens hs
Hundige hdi
Hvidovre hvi
Hørshøolm hhl
Ikast ik
Kalundborg kb
Kastrup ksa
Kolding kd
Køege kj
Lyngby ly
Middelfart md
Nakskov nsk
Nivåaa nivaa
Nyborg ng
Nykøoebing-Falster nf
Næaerum naer
Næaestved nae
Nøoerrebro noe
Nøoerresundby ns
Odense od
Ordrup op
Randers rd
Ringsted rg
Risskov ris
Rosengaarden ron
Roskilde ro
Ryvang ry
Rødovre rdo
Rønne roen
Sanderum sam
Silkeborg sl
Skanderborg sd
Skejby sby
Skive sk
Skåde saa
Skærring aeg
Slagelse sg
Solrød sol
Storei.Magleby stm
Sundbyøoester suoe
Svendborg svg
Sædding saen
Søborg soeb
Sønderborg sdb
Thisted ti
Tranbjerg trg
Tåstrup taa
Valby vby
Vallensbæk vlb
Vanløse van
Vejlby vey
Vejle vj
Vesterbro vbr
Viborg vg
Virum vir2
Vordingborg vo
Værløse vaer
Ydre_Nørrebro ynoe
Åbenrå aaa
Ålborg.Centrum abc
Ålborg.Syd abs
Ålborg.Vest abv
Ålborg.Oest aboes
Århus.Centrum arc
Århus.Nord arno
Århus.Syd arsy
Århus.Vest arve
Østerbro oebr

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Creating iso image in freebsd

In order to write data to a CD, you first need to create an ISO image. This can be done with mkisofs. In my example, we’ll work from the /home/recording directory. In this directory, I created a subdirectory called files. Here is what it contains:

# ls -l files
total 5280
-rw-r–r– 1 root wheel 2174400 Dec 12 10:56 freebsddiary.tif
-rw-r–r– 1 root wheel 2239494 Dec 12 10:57 freshports.tgz
-rw-r–r– 1 root wheel 956533 Dec 12 10:56 mycvs.tgz

From these files, I will create an ISO image:

# mkisofs -J -L -R -o cdimage.raw files
Total translation table size: 0
Total rockridge attributes bytes: 471
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used a164
2649 extents written (5 Mb)

Thanks to mikem for helping me with the following options. I use these on each CD I write. Note: if you don’t use the -J option, you may have problems if you use the CD under Windows (I know, my first CDR didn’t use this option).

-J Generate Joliet directory records in addition to
regular iso9660 file names. This is primarily use-
ful when the discs are to be used on Windows-NT or
Windows-95 machines. The Joliet filenames are
specified in Unicode and each path component can be
up to 64 Unicode characters long.

-L Allow ISO9660 filenames to begin with a period.
Usually, a leading dot is replaced with an under-
score in order to maintain MS-DOS compatibility.
This violates the ISO9660 standard, but it happens
to work on many systems. Use with caution.

-P publisher_id
Specifies a text string that will be written into
the volume header. This should describe the pub-
lisher of the CDROM, usually with a mailing address
and phone number. There is space on the disc for
128 characters of information. This parameter can
also be set in the file .mkisofsrc with PUBL=. If
specified in both places, the command line version
is used.

-p preparer_id
Specifies a text string that will be written into
the volume header. This should describe the pre-
parer of the CDROM, usually with a mailing address
and phone number. There is space on the disc for
128 characters of information. This parameter can
also be set in the file .mkisofsrc with PREP=. If
specified in both places, the command line version
is used.

Udgivet i FreeBSD, Knowledge Base, Old Base | Skriv en kommentar

dansk locale setting i freebsd

for at sætte system standard til ISO-8859-1 og dk keyboard

i /etc/rc.conf:

keymap=”danish.iso”
font8x16=”iso-8×16″
font8x14=”iso-8×14″
font8x8=”iso-8×8″

i /etc/profile

LANG=da_DK.ISO8859-1
MM_CHARSET=ISO-8859-1
export LANG MM_CHARSET

for at sætte brugerklasse til dansk (ikke nødvendig hvis system standard er sat):
i /etc/login.conf

danish|Danish user accounts:\
:charset=ISO-8859-1:\
:lang=da_DK.ISO8859-1:

og sæt user class til ‘danish’

Udgivet i FreeBSD, Knowledge Base, Old Base | Skriv en kommentar