openbsd tips
Disabling the Scroll Lock key.
I have a couple of obsd systems on a crappy d-link KVM
switch that requires that you press the scroll-lock
key twice, then an arrow key to change which computer
it lets you view.
The problem is that sometimes you have to press it three
times before the KVM recognises it and lets you switch.
This can leave the obsd machine's screen unable to scroll.
I'm not sure if this is the best way to do it, but it
works well enough for me. Basically I remap the scroll-lock
key to another function that won't affect anything.
In my case, I remapped it to the left control key using
wsconsctl.
wsconsctl -w keyboard.map+="keysym Hold_Screen
= Control_L"
To see what other key mappings are available, look in
/usr/include/dev/wscons/wsksymdef.h
The wsconsctl command can be put in rc.local to automatically
the disable scroll lock.
Unknown terminal type in single
user mode
If you need to fire up OpenBSD in single user mode and
edit a file, vi won't work. You will get the error:
vi: unknown terminal type
This makes it hard to edit files, quite possible the
files you need to edit to get the system up in multi-user
mode.
Assuming you chose the default shell of sh when starting
single user mode, type:
export TERM=vt220
Backup data to DVD
To backup your data to a DVD, you need to install two
ports.
cdrtools
dvd+rw-tools
Just install dvd+rw-tools. It will install both as
it has a dependency on cdrtools
Once it's installed, the command you want it:
growisofs -speed=1 -Z /dev/rcd0c -R -J /usr/samba
This assumes my DVD Burner is cd0 and I want to backup
every thing under /usr/samba
You can use the command eject
/dev/cd0a when you have finished to
eject the disk
Setting a different outbound
SMTP port for sendmail.
If you sendmail to send all outbound email to
a smart host, but that host is listening on a non standard
port, do the following. eg, the smart host is listening
on port 97
define(`SMART_HOST',`hostname.com')
define(`SMTP_MAILER_ARGS',
`TCP $h 97')
X-Windows settings
Add in the following to xorg.conf to change the
way the server works
Section "ServerFlags"
Option "DontVTSwitch" #
Stop the user swapping consoles with Ctrl-Alt-Fx
DontZap #
Stop the user killing X-Windows with Ctrl-Alt-Backspace
DontZoom #
Stop the user changing resolutiosn with ctrl-alt-plus
or minus keys.
BlankTime xxx #
Number of minutes before the screen blanks
StandbyTime xxx #
Number of minutes before the screen goes into standby
SuspendTime xxx #
Number of minutes before the screen goes into suspend
mode
EndSection
Have OpenBSD automatically boot
into X-Windows without password login
In /etc/rc.local, add in the following at the
end
su user
-c "/usr/X11R6/bin/startx > /dev/console"
I have seen the following also suggested (both work
ok for me)
su user
-c "/usr/X11R6/bin/startx > /dev/console 2>&1"
&
To have a program start automatically once in X-Windows,
put it in the users ~/.xinitrc
|