#!/bin/sh
vi ~/bin/.sh/syntax
# http://www.berklix.com/~jhs/bin/.sh/syntax
exit
-------------------------------------------------------------------------------
.htaccess	httpuserfile
	~/httpuserfile		List of names : encrypted passwords
          Outside ~/public_html/ so httpd will not serve it public
	  but then not updated to servers, so upload manually.
	cd ~/public_html ; find -s . -type f -name .htaccess\*
	man 1 htpasswd
		htpasswd -n LOGIN		# Then append to ~/httpuserfile
		htpasswd ~/httpuserfile LOGIN	# Or add a password direct
        grep "cd "  `which passwords`
        passwords | grep berklix.org/jhs/
	http://httpd.apache.org/docs/2.2/howto/htaccess.html
	http://httpd.apache.org/docs/2.2/mod/core.html#accessfilename
	http://httpd.apache.org/docs/2.2/mod/mod_authn_file.html#authuserfile
	http://httpd.apache.org/docs/2.2/mod/mod_authz_groupfile.html#authgroupfile
	http://httpd.apache.org/docs/2.2/programs/htpasswd.html
-------------------------------------------------------------------------------
A4 http://en.wikipedia.org/wiki/ISO_216#A_series
	210 mm × 297 mm (8.27 in × 11.7 in)
	xsane uses 21.11 x 29.48
-------------------------------------------------------------------------------
See further below for alphabetic index of commands.
Odd notes to later sort into alphabetic:
	{
	xprop(1) and xwininfo(1)
	sysctl kern.geom.debugflags=16
		Turn off disk protection:
	-----------------------------------------------------------------------
	http://www.catb.org/jargon/html
	-----------------------------------------------------------------------
	All utilities should be named in upper case on left margin.
	Conversion utilities are being moved to
	 http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix.mk
	-----------------------------------------------------------------------
	Acronym LAMP=Linux, Apache, MySQL, Perl
	Master View CPU Switch CS-102/CS-122
		AltCtrlShift,2,Enter	or 1 for screen 1, or 0 to scan
	-----------------------------------------------------------------------
	Boot magic
	 hw.pci.allow_unsupported_io_range=1
	-----------------------------------------------------------------------
	www/apache13
		/usr/local/sbin/apachectl start
	-----------------------------------------------------------------------
	mime	to adjust handlers: /usr/local/etc/nmh/mhn.defaults
	-----------------------------------------------------------------------
	mfsroot floppy edit (from post):
		vnconfig vn0 mfsroot.flp
		mount /dev/vn0a /mnt
		cp /mnt/mfsroot.gz /tmp
		umount /mnt
		gunzip /tmp/mfsroot.gz
		vnconfig vn0 mfsroot
		mount vn0a /mnt
	 FreeBSD-5
		mdconfig -a -f 4.10-RELEASE-i386-disc1.iso
		mount -t cd9660 -r /dev/md0 /mnt
		mdconfig -d -u 0
	-----------------------------------------------------------------------
	Mount a cd image:
		vnconfig vn0 /pub/freebsd/ref/4.7-RELEASE/cd/ISO-IMAGES-i386/vsl/1/*1.iso
		mount -t cd9660 -r /dev/vn0c /mnt
		umount /mnt
		vnconfig -u vn0
	-----------------------------------------------------------------------
	Mount an SD ram chip on Cruzer USB under 5.1
		If inserting cruzer after boot:
			ls /dev/da0*			# just da0
			mount -t msdos /dev/da0 /sandisk
				# complains Invalid argument
			ls /dev/da0*			# da0 da0s1
		Or later just:
		 mount -t msdos /dev/da0s1 /sandisk
		USB1:  12 mbit/s
		USB2: 480 mbit/s
	-----------------------------------------------------------------------
		mount -t devfs dev /usb/luftjulian/dev
		chroot /usb/luftjulian
	-----------------------------------------------------------------------
		Debug of fvwm panelling window manager:
		SUMMARY: 8 kernel, 8 Display, 8 binaries : OK
			Native on host=fire, /ad4s2
			-------------------------------------------------------
		SUMMARY: 8 kernel, 8 Display, 9 binaries : OK
			hostname		# fire.my.domain
			uname -r		# 8.2-RELEASE
			rsh lapr uname -r	# 9.1-RELEASE
			mount -t devfs dev /host/lapr/dev		CHECK
			xauth.sh # or xhost + # exports access key to lapr
			cd /host/lapr
			chroot /host/lapr
			setenv DISPLAY fire:0
			fvwm
				# cannot open /dev/null:
				#	Operation not supported
				# Panel display OK
			- - - - - - - - - - - - - - - - - - - - - - - - - - - -
		SUMMARY: 8 kernel, 8 Display, 9 binaries : OK
			mount -t devfs dev /ad4s3/dev
				# my 9.1-RELEASE partition		CHECK
			xauth.sh # or xhost + # exports access key to lapr
			chroot /ad4s3
			fvwm
				# Panel manager OK
			-------------------------------------------------------
		SUMMARY: 8 kernel, 9 Display, 8 binaries : ?
			rlogin lapr
			vi /etc/ttys ... /xdm ; kill -HUP 1
			.....
			-------------------------------------------------------
		SUMMARY: 8 kernel, 9 Display, 9 binaries : ?
			rlogin lapr
			vi /etc/ttys ... /xdm ; kill -HUP 1
			.....
			-------------------------------------------------------
		SUMMARY: 9 kernel, 8 Display, 8 binaries : ?
			-------------------------------------------------------
		SUMMARY: 9 kernel, 8 Display, 9 binaries : Bad
			rlogin lapr
			printenv DISPLAY	# fire.my.domain:0
			fvwm
				# Panel manager bad, no icons, no clicking
			-------------------------------------------------------
		SUMMARY: 9 kernel, 9 Display, 8 binaries : ?
			rlogin lapr
			vi /etc/ttys ... /xdm ; kill -HUP 1
			.....
			-------------------------------------------------------
		SUMMARY: 9 kernel, 9 Display, 9 binaries : Bad
			Native on host=lapr	&
			Native on host=fire, /ad4s3
			-------------------------------------------------------
			rlogin lapr
			cd /host/fire
			mount -t devfs dev /host/fire/dev
	-----------------------------------------------------------------------
	Ports Build:
		cd /usr/ports
		/bin/pwd ; df
		tar zxf /pri/FreeBSD/releases/8.1-RELEASE/tars/ports.tgz
		customise `pwd`
		ls /var/db/pkg > ~/tmp/pkg_pre_make.`date -u +%Y-%m-%dT%H:%M:%SZ`
		setenv DUDS "`printenv DUDS` XX whatever other ports break"
		echo "Now multiple loops of component from"
		make -i \
		 BERKLIX_AMBITIOUS=YES \
		 BERKLIX_CLIENT=YES \
		 BERKLIX_GATE=YES \
		 BERKLIX_MINIMAL=YES \
		 BERKLIX_SERVER=YES \
		 TRYBROKEN=YES fetch-recursive
		make -i -f Makefile.rev \
		 BERKLIX_AMBITIOUS=YES \
		 BERKLIX_CLIENT=YES \
		 BERKLIX_GATE=YES \
		 BERKLIX_MINIMAL=YES \
		 BERKLIX_SERVER=YES \
		 TRYBROKEN=YES fetch-recursive
		make -k \
		 BATCH=YES	\
		 INTERACTIVE=YES \
		 BERKLIX_AMBITIOUS=YES	\
		 BERKLIX_CLIENT=YES	\
		 BERKLIX_GATE=YES	\
		 BERKLIX_MINIMAL=YES	\
		 BERKLIX_SERVER=YES	\
		 TRYBROKEN=YES	\
		all	\
		install \
		package \
		package-recursive
	portupgrade -a # ports/ports-mgmt/portupgrade
	pkgdb -F -a -v
	pkgdb --fix-lost
	 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	cd /usr/ports/..whatevere..
	mv pkg-plist pkg-plist.old
	make -DBATCH makeplist
	 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	cd /usr/ports
	find . -name \.install_done\.\*\._usr_local | xargs rm
	make install
	 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	makefile
	  If you're on 10+ you can use .info, otherwise .warning on older make.
	  .info your ${msg} goes ${here}
	  .if defined(whatever)
	  .info whatever is defined as: ${whatever}
	  .endif
	-----------------------------------------------------------------------
	cd /usr/ports ; make search key=mp3
		uses ports/INDEX*
	-----------------------------------------------------------------------
	 To derive names of tracks, one can use /usr/ports/audio/ripit
		which interogates a CDDB database on the net
	-----------------------------------------------------------------------
	Anagrams:
		ports/games/wordplay ports/games/an
	-----------------------------------------------------------------------
	Norbert''s 2025-12 rec. for upgrade to 15.0 (after he did 2 machines:
		touch /etc/rc.local
		echo "/usr/sbin/freebsd-update install" >> /etc/rc.local
		chmod +x /etc/rc.local
		portmaster -DB $(pkg info -aq)
	}
===============================================================================
acidrip # http://www.berklix.com/~jhs/txt/dvd/acidrip/
dvdrip	multimedia/ffmpeg
-------------------------------------------------------------------------------
aspell --lang=de check
-------------------------------------------------------------------------------
ffmpeg
	/host/lapr/data/av/video/pulse_of_europe_20190303_142605
	ls -l original.mp4					# 901770763
		ISO Media, MP4 v2 [ISO 14496-14]
	ffmpeg -i original.mp4 -s pal julian+bernie_pal.mp4			# 137671131
		ISO Media, MP4 Base Media v1 [IS0 14496-12:2003]
	ffmpeg -i original.mp4 -s film julian+bernie_film.mp4			#  38824385
		ISO Media, MP4 Base Media v1 [IS0 14496-12:2003]
	ffmpeg -i original.mp4 -c:v libx264 bla.avi		# 590474888
		RIFF (little-endian) data, AVI, 1920 x 1080, 30.00 fps, video: H.264 X.264 or H.264, audio: Dolby AC3 (stereo, 48000 Hz)
	ffmpeg -i original.mp4 -s pal -c:v libx264 bla3.avi	# 141233662
		RIFF (little-endian) data, AVI, 720 x 576, 30.00 fps, video: H.264 X.264 or H.264, audio: Dolby AC3 (stereo, 48000 Hz)
	ffmpeg -i original.mp4 -c:v libx264 -s pal bla2.avi	# 141118944
		RIFF (little-endian) data, AVI, 720 x 576, 30.00 fps, video: H.264 X.264 or H.264, audio: Dolby AC3 (stereo, 48000 Hz)
	ls -l				original_from_android.mp4 # 901770763
	ffmpeg		-i original.mp4 	 julian+bernie.mp4 # 586970186
	ffmpeg -t 4:10	-i original.mp4 	 julian_full.mp4 #
	ffmpeg -t 4:10	-i original.mp4 -s film  julian_film.mp4 #  22600013
	ffmpeg -t 4:10	-i original.mp4 -s pal	 julian_pal.mp4  #  77156417
	ffmpeg -ss 4:07 -i original.mp4 	 bernie_full.mp4 # 267449552
	ffmpeg -ss 4:07 -i original.mp4 -s film  bernie_film.mp4 #  16558220
	ffmpeg -ss 4:07 -i original.mp4 -s pal	 bernie_pal.mp4  #  61549489
-------------------------------------------------------------------------------
Android Debugger - See also: http://www.berklix.com/~jhs/android/#adb
adb
 adb -help
 vi /usr/local/share/doc/android-tools-adb/*
 adb shell
  ls -lR / > /mnt/shell/emulated/jhs
 cd ~/tmp ; adb pull /mnt/shell/emulated/jhs .
	Contacts app on galaxy note 3 offers with "export to device storage" )
	to export to /storage/emulated/0
	but actually export to /storage/emulated/legacy/
		Contacts.vcf Contacts_002.vcf

 du -s \
 /mnt/extSdCard/DCIM/Camera \
 /mnt/sdcard/DCIM/Camera \
 /mnt/sdcard/DCIM/OpenCamera \
 /mnt/shell/emulated/0/DCIM/Camera \
 /mnt/shell/emulated/0/DCIM/OpenCamera \
 /sdcard/DCIM/Camera \
 /sdcard/DCIM/OpenCamera \

 26015936	/mnt/extSdCard/DCIM/Camera
 40	/mnt/sdcard/DCIM/Camera
 21376	/mnt/sdcard/DCIM/OpenCamera
 40	/mnt/shell/emulated/0/DCIM/Camera
 21376	/mnt/shell/emulated/0/DCIM/OpenCamera
 40	/sdcard/DCIM/Camera
 21376	/sdcard/DCIM/OpenCamera

 cd /data/jhs/2019-04-11/26g ;
 adb pull -a /mnt/extSdCard/DCIM/Camera .
 cd /data/jhs/2019-04-11/21m ;
 adb pull -a /mnt/sdcard/DCIM/OpenCamera .
 mkdir /data/jhs/2019-04-11/21m2 ;
 cd    /data/jhs/2019-04-11/21m2 ;
 adb pull -a /mnt/sdcard/DCIM/OpenCamera .
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A Debugger - Old pre android generic Unix Tool
adb
 adb /gt/lft/etc/lfta [core]
 $c backtrace
 $r regs
 ^D
-------------------------------------------------------------------------------
atacontrol
 WDMA2 provides a maximum of 16MiB/s
 UDMA2 provides a maximum of 33MiB/s
-------------------------------------------------------------------------------
awk
 awk '{printf "rm -f %s ; ln -s ..%s %s\n",$1,$3,$1}' < /tmp/x
 awk -F = '{printf "%s\n",$1}' < /tmp/t
 mount -t ufs | awk '{printf "%s\n",$3}'
 awk --field-separator # '{printf "%s\n",$1}'
 awk -F # '{printf "%s\n",$1}'			# 5.0 has no --field-separator
 awk '{printf "%s\n",$1}' < distfiles.dump
 find /etc /var /usr -type l | sort | xargs ls -l | \
	 awk '{printf "%s -> %s\n",$9,$11}'	# List all links
 ifconfig rl0 | grep inet | sed -e s/inet// | awk '{printf "%s\n",$1}'
 ifconfig rl0 | grep inet | awk '{printf "%s\n",$2}'
-------------------------------------------------------------------------------
bad144
 See Also
	mail/pending/45
	mail/pending/53
	tech/PALLADIUM
 bad144 -a -c -v wd0 1290729 1291132 1291133 1291495 1291535 1291938 1292341
 # sector numbers above, as shown by
 /sbin/badsect BAD 881991 881629
 --------------
 To post:
 Time was when you could relate a unix bad block number to a
 file name so's you'd know which files were damaged, or to avoid
 even reading (while salvaging other data)
 fsck doesn't offer it, icheck & ncheck are not with us,
 any suggestions ?
 ------------------------------------------------------------------------------
 # from s375
	bad144 /dev/rwd0a
	bad144 /dev/rwd0b
	bad144 /dev/rwd0h
	bad144 -s /dev/rwd0a
	bad144 -s /dev/rwd0b
	bad144 -s /dev/rwd0h
-------------------------------------------------------------------------------
cdda2wav -B -device=/dev/acd0	# /usr/ports/sysutils/cdrtools
	# Produces .wav & .inf files.
	# Caution if you specify cd0 on an IDE interface, it will complain:
	#	'Sorry, this driver and/or drive does not support cdda reading.'
	# It will create .wav files, but they will be silent.
	# host=fire drive=dvd:
		cdda2wav -B -device=/dev/acd0
		cdrom device (/dev/acd0) is not of type generic
		SCSI. Setting interface to cooked_ioctl.
	The above fail on 8.2 & 9.1 & 10.0-BETA3,
	Because it needs dev= in numbers from cdda2wav -scanbus
	This runs on 10.0-BETA3 :
	cdda2wav -vall cddb=0 -paranoia -B

	echo ".include <berklix.mk>" > Makefile
	make mp3	# lame audio_01.wav audio_01.mp3
	-----
	cdda2wav -scanbus
	3,0,0	300) 'PIONEER ' 'DVD-ROM DVD-116 ' '1.09' Removable CD-ROM
	setenv CDR_DEVICE 3,0,0
	setenv CDDA_DEVICE 3,0,0
	cdda2wav -B
	echo ".include <berklix.mk>" > Makefile ; make mp3
	mkdir wav mp3 inf; mv *.inf inf/; mv *.wav wav/; mv *.mp3 mp3/
-------------------------------------------------------------------------------
chroot
	blak:
	cd / ; ln -s 0s4/jail/4.11-RELEASE ; ln -s 4.11-RELEASE jail
	cd /jail
	(cd /usr/backup/host/scan ; tar cf - . ) | tar xf -
	(cd /usr/backup/host/scan.more ; tar cf - . ) | tar xf -
		./usr/X11R6: Can't replace existing directory with non-directory
	(cd /usr/backup/host/scan.all ; tar cf - . ) | tar xf -
	cp /site/domain/my.domain/etc/make.conf.fetch etc/make.conf
	(cd usr/ports;tar zxf /pri/freebsd/releases/4.11-RELEASE/tars/ports.tgz)
	cd etc
		rm resolv.conf
		cat > resolv.conf	<< EOF
		domain		my.domain
		nameserver	xxx.xxxx.xxx.xxx
		nameserver	xxx.xxxx.xxx.xxx
		EOF
		cat > /etc/hosts << EOF
		xxx.xxxx.xxx.xxx gate.my.domain
		EOF
	source `which unsetenv.csh`
	chroot /jail
	cd /tmp;fetch ftp://ftp.my.domain/pub/FreeBSD/dists/4.11-RELEASE/PEAR/Archive_Tar-1.2.tgz
	cd /usr/ports ; make -i BATCH=YES checksum
		make -i INTERACTIVE=YES checksum
-------------------------------------------------------------------------------
sysutils/libcdio cd-info can tell you a lot about the media and contents
-------------------------------------------------------------------------------
skype, pidgin, linphone, twinkle kiax/asterisk
-------------------------------------------------------------------------------
date -u +%Y-%m-%dT%H:%M:%SZ
-------------------------------------------------------------------------------
dump 0 -f - /dev/wd0a | (cd /alt.root ; restore rvf - )
 Tested on symmetric BSD-4.2:
-------------------------------------------------------------------------------
flash
  thierry@@freebsd.org 2008.01:
   port www/xpi-unplug let you detach a .flv to watch it with vlc,
mplayer, etc.
   it's possible to use the port multimedia/miro (I have even added
StudyBSD as a Miro channel)
   there exists other solutions like graphics/gnash, and so on...
 ---------------
 garyj 11 Aug 2009  > emulation@
  Well, I'm running an 8-current AMD64 installation.
  I installed nspluginwrapper-1.2.2_4 and linux-f10-flashplugin-10.0r32
  today and now it's back to core dump city again.  Older versions of these
  ports worked.
  I have compat.linux32.maxssiz=4194304 in /etc/sysctl.conf, which used to
  be all that was required for flash to work :(
-------------------------------------------------------------------------------
fsck -b 32
	SCSI "REASsign Block" command ("reasb") to use any available
	spare sectors to replace the bad one.
	/usr/ports/sysutils/sformat
		sformat  -auto -repair 0 0 3
	/usr/ports/sysutils/smartmontools
		smartctl -i -T verypermissive  /dev/da0
 ------------------------------------------------------------------------------
 did an install of 2.2.6, specifying B block check,
 tried to boot, failed, switched to LBS worked
 dmesg
  wdc0: unit 0 (wd0): <JTS Corp. PALLADIUM Model P1000-2AF>
  wd0: 955MB (1957536 sectors), 1942 cyls, 16 heads, 63 S/T, 512 B/S
 fdisk wd0
  ******* Working on device /dev/rwd0 *******
  parameters extracted from in-core bsdlabel are:
  cylinders=143 heads=217 sectors/track=63 (13671 blks/cyl)
  parameters to be used for BIOS calculations are:
  cylinders=143 heads=217 sectors/track=63 (13671 blks/cyl)
  Media sector size is 512
  Warning: BIOS sector numbering starts with sector 1
  Information from DOS bootblock is:
  The data for partition 1 is:
  sysid 165,(FreeBSD/NetBSD/386BSD)
      start 63, size 1954890 (954 Meg), flag 80
	  beg: cyl 0/ sector 1/ head 1
	  end: cyl 142/ sector 63/ head 216
  The data for partition 2 is:
  <UNUSED>
  The data for partition 3 is:
  <UNUSED>
  The data for partition 4 is:
  <UNUSED>
 bad144 wd0
  bad block information at sector 1954827 in /dev/rwd0c:
  cartridge serial number: 1234(10)
  sn=1291132, cn=94, tn=96, sn=10
  sn=1291535, cn=94, tn=102, sn=35
  sn=1291938, cn=94, tn=108, sn=60
  sn=1292341, cn=94, tn=115, sn=22
 See also
	clri
	ports/sysutils/ffsrecov2
 sysctl kern.geom.debugflags=16
-------------------------------------------------------------------------------
bash_EXAMPLE
 ulimit -u 100; fvwm
 ---------
	^R	Reverse Search
	^S	Search Forward
	^P	Previous
	^N	Next
	^A	Beginning
	^E	End Of Line
	^D	Del. Char
	^F	Forward Char
	^B	Back Char
-------------------------------------------------------------------------------
bashrc_me@
 fahr() { calc -q "$1 * 1.8 + 32" ; }
 cels() { calc -q "x = config(\"display\", 2) ; ($1 - 32) / 1.8" ; }
 mille() {
	while true ; do
		/usr/games/X11/xmille ~/xmille.sa
	done &
 }
 weedout() {
	for i in * ; do
		echo $i
		xv -imap -igeom -0+0 $i
		echo "now what? remove, move ? "
		read a
		if [ -n "$a" ] ; then
			if [ $a = r ] ; then
				echo "removing $i"
				rm $i
			else
				mv $i /usr4/pics/tmp
			fi
		fi
	done
 }
 u() {
	for i in $@ ; do
		a=`uuconc -v $i`
		echo $a
		DISPLAY=:0.0 xv -imap -igeom -0+0 $a
		echo "Now what? move or remove (m/r) \c"
		read b
		if [ $b = r ] ; then
			rm $a
		else
			if [ -f pics/$a ] ; then
				echo "really overwrite existing file \"pics/$a\" ? \c"
				read b
				if [ $b = y ] ; then
					mv $a pics
				fi
			else
				mv $a pics
			fi
		fi
		echo $i
		rm $i
	done
 }
 mlist() { (
	builtin cd /usr/spool/smail/input
	ls | while read a ; do
		ll $a
		grep From: $a
		grep To: $a
	done | less
	) }
 mlog() { tail -f /usr/spool/smail/log/logfile ; }
 zoout() { find $1 -print | zoo aIh $1 ; }
 machine() {
	if [ -f /usr/local/nethosts ] ; then
		grep $* /usr/local/nethosts
	fi
	 grep $* /etc/hosts ; }
 tel() { grep -i $* $h/.telnos ; }
 cpout() { find $1 -print | cpio -ovmdDS >/dev/nris0 ; }
 mn() {
	ls $1 | while read name ; do
		echo $name:
		tbl $name | nroff -man -Tlp | col | less
	done ; }
 pm() { ps -fu $LOGNAME ; }
 px() { ps -ef | grep $1 | grep -v grep ; }
 killp() { px $1 | while read a1 a2 a3 a4 a5 a6 a7
	do	echo $a1 $a2 $a3 $a4 $a5 $a6 $a7
		echo "Killen ? (j/n) \c"
		read killekille </dev/tty
		if [ $killekille = j ]
			then kill -9 $a2
		fi
	done
	}
 killm() {	 trm=$(tty)
	pm | grep $1 | grep -v "grep $1" | while read a1 a2 a3 a4 a5 a6 a7
	do	echo $a1 $a2 $a3 $a4 $a5 $a6 $a7
		echo "Killen ? (j/n) \c"
		read killekille <$trm
		if [ $killekille = j ]
			then kill -9 $a2
		fi
	done
	}
 sterm() { TERM=$1; export TERM; clear; }
 alias ll='ls -al'
 alias psk='ps -ef | fgrep -v fgrep"
 getty
 ?"'
 alias lf='ls -aCF'
 alias pstat='urun /../pcsrcu lpstat -t'
 alias resize='eval $(/usr/bin/X11/resize)'
 alias term='echo $TERM'
 alias rtty='stty $TTY_SETS'
 alias ec='gnuclient -q'
 alias uupcs='/usr/lib/uucp/Uutry -r pcsbst'
 alias uusws4='urun /../sws4 /usr/lib/uucp/Uutry -r pcsbst'
 alias uusamsa='urun /../samsa /usr/lib/uucp/Uutry -r pcsbst'
 alias uupyramid='urun /../pcsbst /usr/lib/uucp/Uutry -r pyramid'
 alias uuunido='urun /../pcsbst /usr/lib/uucp/Uutry -r unido'
 alias nnstart='rm -f /usr/lib/nn/MPID ; /usr/lib/nn/nnmaster -l -r -C'
 ignoreeof=1
 command_oriented_history=1
 if [ "$PS1" != "" ]; then
	if [ "(" "$TERM" = "xterm" ")" -o \
		 "(" "$TERM" = "semu" ")" -o \
		 "(" "$TERM" = "emu" ")" -o \
		 "(" "$TERM" = "xterm+" ")" ] ; then
		set_headline() {
		case "$PWD" in
		${HOME}*) echo -n \
			"\033]0;${MACHINE}~$(expr $PWD : $HOME'\(.*\)')\007" ;;
		*) echo -n "\033]0;${MACHINE}${PWD}\007" ;;
		esac
		}
		cd()	{ builtin cd $*; set_headline; }
		pushd() { builtin pushd $*; set_headline; }
		popd()	{ builtin popd $*; set_headline; }
		pwd() { builtin pwd ; set_headline ; }
		set_headline
		unset MAILCHECK
	fi
	alias pu=pushd
	alias po=popd
	if [ "(" "$TERM" = "xterm" ")" -o \
		 "(" "$TERM" = "semu" ")" -o \
		 "(" "$TERM" = "emu" ")" -o \
		 "(" "$TERM" = "xterm+" ")" ] ; then
	#	PROMPT_COMMAND='echo "]0;$MACHINE$PWD\c"'
		case "$PS1" in
			\(*\)*) : ;;
			*) PS1="$PS1_SAVE ";;
		esac
	else
		if [ $SHLVL = 1 ] ; then
			PS1="\w $PS1 "
		else
			PS1="[$SHLVL] \w $PS1_SAVE "
		fi
	fi
 fi
 rtty
 umask 002
-------------------------------------------------------------------------------
binhex
 How I converted a Content-Type: application/mac-binhex40
 for Helmut Eichler Apr 96:
	cd /usr/ports/*/harvest ; make
	cd
	/usr3/ports/www/harvest/work/harvest-1.4.pl2/components/gatherer/\
		standard/unbinhex/hexbin/hexbin in out
-------------------------------------------------------------------------------
burncd -s max -f /dev/acd0 data 4.10-RELEASE-i386-disc1.iso fixate
burncd -e -f /dev/acd0 blank	# fast & eject
burncd -e -f /dev/acd0 erase	# thorough & eject
burncd -s max -f /dev/acd1    audio *.wav fixate # fire:Plextor cd-rw
burncd -s max -f /dev/acd1 -d audio *.wav fixate # fire:Plextor cd-rw
	not sure if this one is ok
burncd -s max -f /dev/acd0 audio *.wav fixate
# later: -d
	See Also cdda2wav
-------------------------------------------------------------------------------
dvd+rw-format /dev/cd2
	Date	Thu Oct 28 02:49:39 CEST 2010
	uname -a
		FreeBSD fire.my.domain 8.0-RELEASE FreeBSD
		8.0-RELEASE #0: Mon Jul 12 00:59:43 CEST 2010
		jhs@@fire.my.domain:/usr1/src/sys/amd64/compile/FIRE64.small
		amd64
	Running on media: Verbatim dvd-rw
-------------------------------------------------------------------------------
calibre
 /usr/local/lib/calibre/calibre/customize/profiles.py
-------------------------------------------------------------------------------
cdlabelgen
	cdlabelgen -c "Multimedia Notebook PC" -d "Mirage ACi" -s " " -o box.ps
	perldoc cdlabelgen
-------------------------------------------------------------------------------
Sound Music Playing: Notes for sticky intermittent breaking sound.
 ksmp3play *.mp3	/usr/ports/audio/ksmp3play
			- curses based. but no buf size
 mpg123 -b 2048 *.mp3	/usr/ports/audio/mpg123
 mpg123 -b 4096 *.mp3	/usr/ports/audio/mpg123
			no menu but has variable buffer size
 mplayer -cache 4096 -audiofile-cache 4096 -cache-min 80 *.mp3
			/etc/mplayer.conf
			/usr/local/share/mplayer
			~/.mplayer/config
 According to www.mpg123.org:
	> ---snip---
	Needed computing power

	A recent test (GNU/Linux OS) with 0.60-beta2 showed 3% to 4% CPU usage
	on decoding high quality VBR MP3 with a pentiumII laptop with 366MHz,
	while a pentium 100MHz can easily handle two mpg123 instances in
	realtime (plus the mixing daemon that works on decoded data).
	Michael said once upon a time

	Plays Layer 3 in stereo on an AMD-486-120Mhz or (of course) a faster machine.

	Just for info: mpg123 plays an average 128bps stream, with about 66%
	in full quality on an AMD 486-133MHz machine.
	---------
 Ian Smith <smithi@@nimnet.asn.au>
	Given that my ATA DMA works, my 5.5 vs your 7, my 300MHz
	laptop plays an (average) ~160kbps VBR .mp3 using about 20%
	CPU with xmms, or about 15% with mpg123 -v.  Doing little
	else, yours should just about make it, if you can get ATA
	DMA working.	Without DMA, hmm, it seems less likely,
 From: Thierry Herbelot <thierry@@herbelot.com>
 Date: Sun, 20 Jan 2008 14:42:02 +0100
 To: freebsd-hackers@@freebsd.org
 Subject: Re: FreeBSD on non-fpu device
	mad is a good (integer-only) candidate for MP3 rendering with a slow CPU
-------------------------------------------------------------------------------
claws-mail	# a succesor to sylpheed mailer user agent MUA
	To get GPG working:
	cd  /usr/ports/security/pinentry-curses; make install
	cd  /usr/ports/security/gnupg-devel; make install # for gpg-agent
	start gpg-agent:
		eval `gpg-agent --daemon`
		echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
	generate a PGP key
	enable the following plugins in claws-mail using
	Configuration -> Plugins
	PGP/Core
	PGP/inline
	PGP/MIME
	Turn on PGP in Configuration -> Preferences -> Privacy
	cd .claws-mail ; grep -l mail.my.domain * # accountrc menurc
-------------------------------------------------------------------------------
lagg	freebsd name - aggregation interfaces
	netbsd name agr
-------------------------------------------------------------------------------
local.sqlite
	From: Michel Talon <talon@@lpthe.jussieu.fr>
	Cc: freebsd-ports@@freebsd.org
	To: "Julian H. Stacey" <jhs@@berklix.com>

	So how to interact with local.sqlite?

	niobe% sqlite3 local.sqlite
	SQLite version 3.8.2 2013-12-06 14:53:30
	Enter ".help" for instructions
	Enter SQL statements terminated with a ";"
	sqlite> .tables
	annotation	     options		  pkg_script
	categories	     packages		  pkg_shlibs
	deps		     pkg_annotation	  pkg_shlibs_provided
	directories	     pkg_categories	  pkg_shlibs_required
	files		     pkg_directories	  pkg_users
	groups		     pkg_groups 	  script
	licenses	     pkg_licenses	  scripts
	mtree		     pkg_option 	  shlibs
	option		     pkg_option_default   users
	option_desc	     pkg_option_desc

	sqlite> .schema packages
	CREATE TABLE packages (id INTEGER PRIMARY KEY,origin TEXT
	UNIQUE NOT = NULL,name TEXT NOT NULL,version TEXT NOT
	NULL,comment TEXT NOT NULL,desc = TEXT NOT NULL,mtree_id
	INTEGER REFERENCES mtree(id) ON DELETE RESTRICT = ON UPDATE
	CASCADE,message TEXT,arch TEXT NOT NULL,maintainer TEXT NOT
	= NULL, www TEXT,prefix TEXT NOT NULL,flatsize INTEGER NOT
	NULL,automatic = INTEGER NOT NULL,locked INTEGER NOT NULL
	DEFAULT 0,licenselogic INTEGER = NOT NULL,time INTEGER,
	manifestdigest TEXT NULL, pkg_format_version = INTEGER);
	CREATE INDEX pkg_digest_id ON packages(origin, manifestdigest);

	sqlite> select name,version from packages limit 10;
	pkg|1.2.5
	xproto|7.0.25
	xextproto|7.2.1
	xbitmaps|1.1.1
	renderproto|0.11.1
	libXdmcp|1.1.1
	libXau|1.0.8
	libxml2|2.8.0_3
	libpthread-stubs|0.3_4
	kbproto|1.0.6

	and to replace grepping

	sqlite> select name,version from packages where name like
		'%kde%' limit = 10;
	kdehier4|1.1.1_1
	kde4-wallpapers-freebsd|1.0
	pam_kde|1.0
	kde4-xdg-env|1.0.1
	kde4-icons-oxygen|4.10.5
	kde4-shared-mime-info|1.2
	kdelibs|4.10.5_2
	kde-wallpapers|4.10.5
	kde-base-artwork|4.10.5
	polkit-kde|0.99.1

	sqlite> .quit
	niobe%

	=46rom this it is easy to experiment, and  the full sqlite
	documentation = is at:

	http://www.sqlite.org/lang.html
-------------------------------------------------------------------------------
linkcheck
	few options, none to turn off:
		ftp "by getting actual file via ftp"
		listing deliberately anti-spam-crippled email addresses
	No proxy from a quick grep of src/
	Silent, creates (after ^C) a log file linkcheck.report.berklix.com
	Run faster & with no net load by running local:
		rsh flat ; linkcheck -r http://www.berklix.com
	First use with -r to just list broken links on own site,
	only after that remove -r, run again & fix external links
	Complains "not found" on names browser accesses OK, like
		www.berklix.com/scanjet/data/COPYRIGHT/
	Outputs a load of timings that dont interest me
-------------------------------------------------------------------------------
linkchecker -r-1 http://www.berklix.com -oblacklist
	loops recursive
-------------------------------------------------------------------------------
lib
	Libraries have been installed in: /usr/local/lib
	If you want to link against installed libraries
	in a given directory, LIBDIR, you must
	either
		use libtool, and specify the full pathname of the library,
	or
		use the `-LLIBDIR' flag during linking and do at
		least one of the following:
	   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
	     during execution
	   - add LIBDIR to the `LD_RUN_PATH' environment variable
	     during linking
	   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
	man ld(1) and ld.so(8)
-------------------------------------------------------------------------------
realplay http://www.bbc.co.uk/worldservice/ram/live_infent.ram
	install the /usr/ports/multimedia/linux-realplayer
	Linux emulation enabled
-------------------------------------------------------------------------------
ripit is a graphic front end to lame,
	gary reccomends 192 kbs
-------------------------------------------------------------------------------
route add default gw 192.168.42.139 dev rndis0		# Android syntax
route add default    192.168.42.139			# FreeBSD syntax
-------------------------------------------------------------------------------
root kit detector
	 <http://sourceforge.net/projects/revealrk
-------------------------------------------------------------------------------
mgdiff
 try also meld from ports
-------------------------------------------------------------------------------
mp3 tools:
  audio/mp3splt 	splits
  audio/id3ed		An id3 tag editor for mp3 files
  audio/id3tool 	A utility for manipulating mp3 ID3 Tags
  audio/mp3butler	A program for renaming mp3 files
  audio/mp3info 	Tool to manipulate ID3 tags for MP3 files
  audio/mp3rename	A renaming program for mp3 files based on their id3tag
  audio/yamt		helps you to organize your mp3s
  audio/mp3ck		scanner for truncated, better than mpck
			various others via:
	cd /usr/ports/audio;grep -l -i mp3 */pkg-descr|xargs grep -i check
  audio/mp3splt-gtk
-------------------------------------------------------------------------------
chflags -R noschg /
	Turn off file protection:
	Linux similarity is chattr
-------------------------------------------------------------------------------
csh
 #!/bin/csh
 if ( "x`filetest -e thing`" == "x1" ) then
	echo "Exists."
 else
	echo "Does not exist."
 endif
 set autologout = 30 # if you leave the shell idle for more than seconds
-------------------------------------------------------------------------------
cshrc_FROM_USR_GUEST
 # limit maxproc 100; fvwm
 unset histchars
 set histchars=',;%'
 if ($?prompt) then
	set mail=/usr/spool/mail/$USER
	switch	($prompt:q)
		case '# ':
		set prompt=">`hostname`< "
		breaksw
		case '% ':
		set prompt="<`hostname`> "
		breaksw
		default:
		set    prompt="`hostname`!`whoami` "
	endsw
	set	cdpath=(/usr/src/sys /usr/src/cmd ~ ~/working)
	set history=60
	alias tset 'set xx=$histchars; set histchars=""; \
		unset history; /usr/ucb/tset -s -Q \,*	> /tmp/tset$$ ; \
		source /tmp/tset$$ ; rm /tmp/tset$$; set history=60; \
		set histchars=$xx; unset xx'
	alias a alias
	a	ls	'ls -F'
	alias	setup	'sccs admin -i \,:1 < \,:1'
	a pwd 'echo $cwd'
	a pv printenv
	a sv setenv
	a so source
	a d dirs
	a j jobs
	a h history
	a pd pushd
	a p popd
	a tag 'vi -ta \,*'
	a nd	'nm -nr \,* |grep " [DBdb] " |more'
	a reset 'reset ; stty -tabs'
	a RESET reset
	a notes 'cp ~/notes ~/oldnotes/notes.$$ ; date >> notes ; \
		vi ~/notes ; cp notes notes.bak'
	a c	'pushd \,* '
	a .stand	'c stand'
	a .sys	'c sys'
	a .src	'c src'
 endif
-------------------------------------------------------------------------------
cthumb # A themable web picture album generator
	For web first shrink size x 2 with xv & allow default Q factor 75%
	cthumb -c *.jpg > album.cthumb
	vi -c/"Undefined Title" album.cthumb
		n
		^Z
		pwd
		mouse copy directory name
		fg
		2cw
		:s/_/ /g
		ZZ
	cthumb album.cthumb ; ln -s index.shtml index.html
	vi -c/"This is the Title for Page 1" index.html
		n
		7cwClick Here. = Klik Hier.
		ZZ
	vi -c/"This is the Title for Page 1" page.html
		nn
		7cwClick a picture for larger. = Klik Fuer Grosser.
		ZZ
	------------------
	Deconstruct Before Rebuild:
	rm *-thumb.jpg *.html album.cthumb index.shtml
	rm -rf neat-round.theme
-------------------------------------------------------------------------------
conscontrol
	/boot/loader.conf: console="comconsole"
-------------------------------------------------------------------------------
timings:
 host=fire, 12.2-STABLE, 2021-09, no src.conf, no make.conf,
	 make -B -j 1 world # 17 hours 10 mins
-------------------------------------------------------------------------------
torrent
    ctorrent -h
	http://ctorrent.sourceforge.net/?action=faq&id=7
	Once CTorrent starts to download, all you will see is 1
	line of status. It's kind of hard to interpret what all the
	numbers mean, so here's an example:
		10, [0/334/331], 6070,9845, | 5004,3984 E:3
		10 - Number of connected peers (other people who
			have the file you are downloading)
		0/334/331 - Downloaded/Total/Available pieces of
			the file. All pieces may not be availabe at all
			times since peers go offline.
		6070,9845 - Average downloadspeed (in bytes/s),
			Average uploadspeed (in bytes/s)
		5004,3984 - Current downloadspeed (in bytes/s),
			Current uploadspeed (in bytes/s)
		E:3 - The tracker has refused connections 3 times.
	Hangs for me, I switrched to using
    btdownloadheadless.py from ports/net/py-bittorrent
	Other reccomended:
    -current/ports/net/azureus
	not in 5.3-release & "only for i386"
    torrentflux
	needs MySQL, PHP, and Apache to use it, but for me it works
	great since I can add/remove/manage my torrents from any
	machine on my network via browser, while actually running
	the bittorrent client on my big storage box.
	http://www.torrentflux.com/
	also, to get it working, I had to add this to my /etc/sysctl.conf:
	kern.ps_arg_cache_limit=1024
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Subject: Re: 9.0 base.txz ftp download time out
	From: Kevin Oberman <kob6558@@gmail.com>
	Date: Sun, 26 Feb 2012 15:58:43 -0800 (Mon 00:58 CET)
	Cc: FreeBSD Current <freebsd-current@@freebsd.org>

	http://torrents.freebsd.org:8080
	If you need a client, I can recommend azureas and deluge from ports.
	(Actually, it's been a while since I used deluge, but it worked last I
	tried. Both are in ports/net-p2p.
-------------------------------------------------------------------------------
	CVS was retired from freebsd.org use 2014-05-27
	(at which time 8.4 & 9.2 & 10.0 were already in svn, but not all in cvs)
cvs	Examples of syntax that works (except where noted otherwise)
	man cvs examples an ISO date of "1972-09-24  20:05"
	http://www.FreeBSD.org/releases/
		Tag			Module	# Notes
		  . (head) for 9.0-BETA1 at 2011-08-02
		  RELENG_6_0	Release 6.0
		  RELENG_6_1	RC release candidates, releases, & security
				fixes to RELENG_6_1_0_RELEASE.
		  RELENG_6	Moving Stable, passing through 6.*
				stable. security updates, fixes & enhancements
 cvs -Q -R export
 cvs -R export -r HEAD			doc

 cvs -R export -r RELENG_7		src	# du=485M,
	kensmith_ERASE@@cse.Buffalo.EDU confirms this tag OK
	to update from 7.0-BETA2 to newer.

 cvs -R export -r RELENG_9_1_0_RELEASE	src	# du=867 M tgz=149 M
 cvs -R export -r RELEASE_9_1_0 	ports	# 0
 cvs -R export -r RELEASE_9_1_0 	doc	# 0

 Not via cvs but from .iso		src	# du=569 M tgz=123 M
 Not via cvs				ports	# du=535 M tgz= 56 M
 Not via cvs				doc	# du= 55 M tgz= 30 M

 cvs -R export -r RELENG_8_3_0_RELEASE	src	# du=567 M tgz=120 M
 cvs -R export -r RELEASE_8_3_0 	ports	# du=488 M tgz= 50 M
 cvs -R export -r RELEASE_8_3_0 	doc	# du=102 M tgz= 28 M

 cvs -R export -r RELENG_9_0_0_RELEASE	src	# du=699 M tgz=145 M
 cvs -R export -r RELEASE_9_0_0 	ports	# du=476 M tgz= 48 M
 cvs -R export -r RELEASE_9_0_0 	doc	# du=101 M tgz= 28 M

 cvs -R export -r RELENG_8_2_0_RELEASE	src	# du=548 M tgz=115 M
 cvs -R export -r RELEASE_8_2_0 	ports	# du=475 M tgz= 49 M
 cvs -R export -r RELEASE_8_2_0 	doc	# du=100 M tgz= 27 M

 cvs -R export -r RELENG_8_1_0_RELEASE	src	# du=532 M tgz=113 M
 cvs -R export -r RELEASE_8_1_0 	ports	# du=462 M tgz= 48 M
 cvs -R export -r RELEASE_8_1_0 	doc	# du=100 M tgz= 27 M

 cvs -R export -r RELENG_8_0_0_RELEASE	src	# du=523 M tgz=111 M
 cvs -R export -r RELEASE_8_0_0 	ports	# du=441 M tgz= 46 M
 cvs -R export -r RELEASE_8_0_0 	doc	# du= 99 M tgz= 27 M

 cvs -R export -r RELENG_7_4_0_RELEASE	src	# du=517 M tgz=111 M
 cvs -R export -r RELEASE_7_4_0 	ports	# du=475 M tgz= 49 M
 cvs -R export -r RELEASE_7_4_0 	doc	# du=100 M tgz= 27 M

 cvs -R export -r RELENG_7_3_0_RELEASE	src	# du=510 M tgz=110 M
 cvs -R export -r RELEASE_7_3_0 	ports	# du=455 M tgz= 48 M
 cvs -R export -r RELEASE_7_3_0 	doc	# du= 99 M tgz= 27 M

 cvs -R export -r RELENG_7_2_0_RELEASE	src	# du=506 M tgz=109 M
 cvs -R export -r RELEASE_7_2_0 	ports	# du=428 M tgz= 44 M
 cvs -R export -r RELEASE_7_2_0 	doc	# du= 98 M tgz= 26 M

 cvs -R export -r RELENG_7_1_0_RELEASE	src	# du=501 M tgz=108 M
 cvs -R export -r RELEASE_7_1_0 	ports	# du=407 M tgz= 43 M
 cvs -R export -r RELEASE_7_1_0 	doc	# du= 96 M tgz= 26 M

 cvs -R export -r RELENG_7_0_0_RELEASE	src	# du=487 M tgz=106 M
 cvs -R export -r RELEASE_7_0_0 	ports	# du=372 M tgz= 39 M
 cvs -R export -r RELEASE_7_0_0 	doc	# du= 86 M tgz= 23 M

 cvs -R export -r RELENG_6_4_0_RELEASE	src	# du=451 M tgz= 98 M
 cvs -R export -r RELEASE_6_4_0 	ports	# du=407 M tgz= 43 M
 cvs -R export -r RELEASE_6_4_0 	doc	# du= 86 M tgz= 23 M

 cvs -R export -r RELENG_6_3_0_RELEASE	src	# du=445 M tgz= 97 M
 cvs -R export -r RELEASE_6_3_0 	ports	# du=371 M tgz= 39 M
 cvs -R export -r RELEASE_6_3_0 	doc	# du=85M M tgz= 23 M

 cvs -R export -r RELENG_6_2_0_RELEASE	src	# du=438 M tgz= 96 M
 cvs -R export -r RELEASE_6_2_0 	ports	# du=332 M tgz= 36 M
 cvs -R export -r RELEASE_6_2_0 	doc	# du=74M M tgz= 19 M

 cvs -R export -r RELENG_5_5_0_RELEASE	src	# du=413 M tgz= 96 M
 cvs -R export -r RELEASE_5_5_0 	ports	# du=292 M tgz= 31 M
 cvs -R export -r RELEASE_5_5_0 	doc	# du=75  M tgz= 23 M

 cvs -R export -r RELENG_5_0_0_RELEASE	src	# du=356 M tgz= 84 M
	no cpu I386_CPU in sys/i386/conf/GENERIC, but in ./NOTES

 cvs -R export -r RELENG_4_11_0_RELEASE src	# du=... M tgz=... M
 cvs -R export -r RELEASE_4_11_0	ports	# du=... M tgz=... M
 cvs -R export -r RELEASE_4_11_0	doc	# du=... M tgz=... M

 cvs -R export -r RELENG_4_6		src	# du=... M tgz=... M
 cvs -R export -r RELENG_5		src	# du=... M tgz=... M
 cvs -R export -r RELENG_4		src	# du=... M tgz=... M
 cvs -R export -r HEAD			ports	# du=... M tgz=... M
 cvs -R export -D"12-Jan-2004"		www	# du=... M tgz=... M
 cvs -R export -r v1_0			www	# du=... M tgz=... M
 cvs -R export -r HEAD			www	# du=... M tgz=... M
 cvs -R export	-D1-Oct 		vi
 cvs -R export -r RELENG_7		src/usr.bin/split
 cvs -R export -r RELENG_7_3		src/usr.bin/split
 cvs -R co		-D4-Aug 	sys
 cvs -R co		-D"9-Feb-97"	sys
 cvs -R export -r RELENG_2_2		mk
 cvs -R export -r RELEASE_2_0		src	# du=100 M tgz= 26 M
 cvs -R export -r RELEASE_2_0		ports
 cvs -R export -r bsd_44_lite	src	# du= 42 M tgz=  9 M
 cvs -R export -r CSRG		src	# du= 45 M tgz= 10 M
 cvs -R -d /usr/cvs co -P -r RELENG_4_2_0_RELEASE src # What release calls
			Tags (EG CSRG, bsd_44_lite, RELENG_4_1_0_RELEASE)
			/usr/cvs/{src.ports,doc}/Makefile,v (www/ has no tags)
 Modules (EG src ports mk sys chimera)	/usr/cvs/CVSROOT/modules
 cd /usr/cvs/src/release/texts/i386 ; vi -c/"FreeBSD Release" RELNOTES.TXT,v
 Number of commiters:
	cvs co -p CVSROOT-src/access CVSROOT-doc/access CVSROOT-ports/access \
		2>/dev/null | grep -v ^# | awk '{print $1}' | sort -u | wc -l
% cd /cvs/FreeBSD/CVSROOT-src/commitlogs # choose repository
% gzip -dcfq * | awk '
  /^[a-z][a-z]*/ { count[$1]++ } \
  END { for (c in count) { print count[c], c } } ' | \
  sort -nr | less
-------------------------------------------------------------------------------
sed
  Want to strip UTF-8 BOM(Byte Order Mark) from given files?
	sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile
-------------------------------------------------------------------------------
stty rows NN cols NN	# If your terminal window size isn't known to vi.
-------------------------------------------------------------------------------
svn subversion
 http://www.freebsd.org/doc/handbook/svn.html
 http://svnweb.freebsd.org/base/releng/		# list of tags
 file:///pub/www.freebsd.org/www1.fr.freebsd.org/doc/handbook/index.html
 svn checkout file:///usr/svn/base /usrb/tmp/svn-base
	{
	produces > 96G inc.:
	 ROADMAP.txt
	 cvs2svn
	 head
	 projects/
		GUIDELINES.txt arm_eabi arm_eabi_vfp armv6 bhyve
		bmake bpfjit cambria capabilities8 cider diffused_head
		enhanced_coredumps etc_ipv6 fuse geom_raid5 graid
		head_mfi hyperv jailconf l2filter llvm-ia64 multi-fibv6
		net80211_testsuite onewire pciehp portbuild
		random_number_generator release_6_3_xen uefi varsym vmxnet
		+more_ran_out_of_disk
	release/
		2.0 2.0.5 2.1.0 2.1.5 2.1.6 2.1.6.1 2.1.7 2.2.0
		2.2.1 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 3.0.0 3.1.0
		3.2.0 3.3.0 3.4.0 3.5.0 4.0.0 4.1.0 4.1.1 4.10.0
		4.11.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.6.1 4.6.2
		4.7.0 4.8.0 4.9.0 5.0.0 5.1.0 5.2.0 5.2.1 5.3.0
		5.4.0 5.5.0 6.0.0 6.1.0 6.2.0 6.3.0 6.4.0 7.0.0
		7.1.0 7.2.0 7.3.0 7.4.0 8.0.0 8.1.0 8.2.0 8.3.0
		8.4.0 9.0.0 9.1.0 9.2.0
	svnadmin
	}
 svn diff -c337328 --summarize svn://svn.freebsd.org/base
 svn export -q file:///usr/svn/base/release/7.4.0	 # du=_
 svn export -q file:///usr/svn/base/release/9.2.0	 # du=JJLATER
 svn export -q file:///usr/svn/base/release/9.3.0	 # du=_775M tgz=163M
 svn export -q file:///usr/svn/base/release/10.0.0	 # du=_843M tgz=177M
 svn export -q file:///usr/svn/base/release/10.1.0	 # du=_864M tgz=181M
 svn export -q file:///usr/svn/base/release/10.2.0	 # du=_940M tgz=195M
 svn export -q file:///usr/svn/base/release/10.3.0	 # du=_944M tgz=196M
 svn export -q file:///usr/svn/base/release/10.4.0	 # du=_968M tgz=204M
 svn export -q file:///usr/svn/base/release/11.0.0	 # du=1074M tgz=219M
 svn export -q file:///usr/svn/base/release/11.1.0	 # du=1123M tgz=230M
 svn export -q file:///usr/svn/base/release/11.2.0	 # du=1192M tgz=243M
 svn export -q file:///usr/svn/base/release/11.4.0	 # du=1241M tgz=250M
 svn export -q file:///usr/svn/base/release/12.0.0	 # du=1225M tgz=248M
 svn export -q file:///usr/svn/base/release/12.1.0	 # du=1265M tgz=260M
 svn export -q file:///usr/svn/base/release/12.2.0	 # du=1312M tgz=266M
 svn export -q file:///usr/svn/base/release/12.3.0	 # Use git  txz=?
 svn export -q file:///usr/svn/base/release/12.4.0	 # Use git  txz=178M
 svn export -q file:///usr/svn/base/release/13.0.0	 # Released. Use git
 svn export -q file:///usr/svn/base/release/13.1.0	 # Released. Use git
 svn export -q file:///usr/svn/base/releng/10.0 	 # du=_843M tgz=___M
 svn export -q file:///usr/svn/base/releng/12.0 	 # du=1260M tgz=___M
 svn export -q file:///usr/svn/base/releng/12.1 	 # du=1265M 2019-12-16
 svn export -q file:///usr/svn/base/releng/12.2 	 #
 svn export -q file:///usr/svn/base/releng/12.3 	 # 12.3-RC2 2021-11-19
 svn export -q file:///usr/svn/base/releng/5.5		 # du=____M tgz=___M
 svn export -q file:///usr/svn/base/stable/10		 # du=_845M tgz=___M
 svn export -q file:///usr/svn/doc/head 		 # du=_210M tgz=___M
 svn export -q file:///usr/svn/doc/release/9.3.0	 # du=_211M tgz=_64M
 svn export -q file:///usr/svn/doc/release/10.1.0	 # du=_212M tgz=_64M
 svn export -q file:///usr/svn/doc/release/10.2.0	 # du=_230M tgz=_69M
 svn export -q file:///usr/svn/doc/release/10.3.0	 # du=_241M tgz=_77M
 svn export -q file:///usr/svn/doc/release/10.4.0	 # du=_264M tgz=_87M
 svn export -q file:///usr/svn/doc/release/11.1.0	 # du=_262M tgz=_86M
 svn export -q file:///usr/svn/doc/release/11.2.0	 # du=_279M tgz=_89M
 svn export -q file:///usr/svn/doc/release/12.0.0	 # du=____M tgz=___M
 svn export -q file:///usr/svn/doc/release/12.1.0	 # du=_318M tgz=_98M
 svn export -q file:///usr/svn/doc/release/12.2.0	 # Released
 svn export -q file:///usr/svn/doc/release/12.3.0	 # Released
 svn export -q file:///usr/svn/doc/release/13.0.0	 # Released
 svn export -q file:///usr/svn/ports			 #  Very Big
 svn export -q file:///usr/svn/ports/branches/2019Q4	 # du=_579M tgz=_60M
 svn export -q file:///usr/svn/ports/branches/2020Q1	 # du=_570M tgz=___M
 svn export -q file:///usr/svn/ports/head		 # du=_525M tgz=___M
 svn export -q file:///usr/svn/ports/tags/RELEASE_7_4_0  # du=____M tgz=___M
 svn export -q file:///usr/svn/ports/tags/RELEASE_9_3_0  # du=_498M tgz=_52M
 svn export -q file:///usr/svn/ports/tags/RELEASE_10_0_0 # du=_509M tgz=_53M
 svn export -q file:///usr/svn/ports/tags/RELEASE_10_1_0 # du=_491M tgz=_52M
 svn export -q file:///usr/svn/ports/tags/RELEASE_10_2_0 # du=_526M tgz=_60M
 svn export -q file:///usr/svn/ports/tags/RELEASE_10_3_0 # du=_495M tgz=_52M
 svn export -q file:///usr/svn/ports/tags/RELEASE_10_4_0 # du=_523M tgz=_55M
 svn export -q file:///usr/svn/ports/tags/RELEASE_11_0_0 # du=_506M tgz=_52M
 svn export -q file:///usr/svn/ports/tags/RELEASE_11_1_0 # du=_523M tgz=_55M
 svn export -q file:///usr/svn/ports/tags/RELEASE_11_2_0 # du=_553M tgz=_58M
 svn export -q file:///usr/svn/ports/tags/RELEASE_12_0_0 # du=____M tgz=___M
 svn export -q file:///usr/svn/ports/tags/RELEASE_12_1_0 # du=_579M tgz=_60M
 svn export -q file:///usr/svn/ports/tags/RELEASE_12_2_0 # Released
 svn export -q file:///usr/svn/ports/tags/RELEASE_12_4_0 # Use git  txz=_46M
 svn export -q file:///usr/svn/ports/tags/RELEASE_13_0_0 # Released
 svn export -q file:///usr/svn/ports/head ; cd head ; svn up	# FAILS
 cd /usr/src ; svn up					 # Works
 svn co svn://svn0.eu.FreeBSD.org/ports/head /usr/ports;cd /usr/ports;svn up#<GJ
 svn co -q file:///usr/svn/base/head			 # du=2542M ./head/
 svn co -q file:///usr/svn/base/release/9.3.0		 # du=1568M
 svn co -q file:///usr/svn/base/stable/10		 # du=1892M
 svn co -q file:///usr/svn/ports/head ; cd head ; svn up # du=1079M
 cd cd /usr/src; svn co -q file:///usr/svn/base/head; mv head/* head/.[a-z]* .
 svn update				ports-cur-co	 # OK
 svn update				ports-cur-ex	 # OK
 svn co -q file:///usr/svn/ports/head@386834		 # RUNS
 svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base# files changed by rev
 svn help blame
 svn blame file:///usr/svn/base/head/share/mk/src.opts.mk | grep RCMDS
	320530	      jlh     RCMDS \
 svn log -c 320530 file:///usr/svn/base/
 svn co 'svn+ssh://svn.freebsd.org/ports/head/xyz/abc/@{YYYY-MM-DD}'

 To inspect changes, eg: http://svnweb.freebsd.org/changeset/base/365250
 .svn_revision is a file not from scn command bt from stephens ctm scripts
  -----------------------------------------------------------------------------
host=lapr	2015-05-23
	cd /data/release/11.0-CURRENT/usr/expt
	svn co -q file:///usr/svn/ports/head@386834
	mv head ports
	cd ports
	customise `pwd`
	setenv PORTSDIR `pwd` # /data/release/11.0-CURRENT/usr/expt/ports/ports
	cd archivers/zip
	du # 8M in ./work
	cd ../..
	svn up	# Updated to revision 387018.
	du archivers/zip	# still 8M in work :-)
	cd /usr/ports ; svn up \
		# Skipped '.' Summary of conflicts: Skipped paths: 1
			# I see no .svn directory.
	find . -type d -name work -print > /tmp/work
	pwd # /data/release/11.0-CURRENT/usr/ports
	cd ..
	mv ports ports.no_svn
	mv /data/release/11.0-CURRENT/usr/expt/ports/ports ports
	cd /usr/ports
	(cd /data/release/11.0-CURRENT/usr/ports.no_svn && \
		tar cf - `cat /tmp/work` ) | tar xf -
	cd /data/release/11.0-CURRENT/usr/ports.no_svn
	find `cat /tmp/work` -type f -exec cmpd -d -v {} /usr/ports \;
	cd /usr/ports ; svn up ; make
  -----------------------------------------------------------------------------
 svn export file:///usr/svn/ports	# > 17.4 G @ revision 342690 2014-02-05
	{
	branches/{
		2014Q1 RELEASE_8_4_0 RELENG_2_1_0 RELENG_2_2
		RELENG_9_1_0 RELENG_9_2_0
		}
	head
	svnadmin
	tags/{
		ALPHA_2_0 BETA_2_0 PRE_XORG_7 RELEASE_10_0_0
		RELEASE_2_0 RELEASE_2_2_1 RELEASE_2_2_2 RELEASE_2_2_5
		RELEASE_2_2_6 RELEASE_2_2_7 RELEASE_2_2_8 RELEASE_3_0_0
		RELEASE_3_1_0 RELEASE_3_2_0 RELEASE_3_3_0 RELEASE_3_4_0
		RELEASE_3_5_0 RELEASE_4_0_0 RELEASE_4_10_0
		RELEASE_4_11_0 RELEASE_4_1_0 RELEASE_4_1_1 RELEASE_4_2_0
		RELEASE_4_3_0 RELEASE_4_4_0 RELEASE_4_5_0 RELEASE_4_6_0
		RELEASE_4_6_1 RELEASE_4_6_2 RELEASE_4_7_0 RELEASE_4_8_0
		RELEASE_4_9_0 RELEASE_4_EOL RELEASE_5_0_0 RELEASE_5_0_DP1
		RELEASE_5_1_0 RELEASE_5_2_0 RELEASE_5_2_1 RELEASE_5_3_0
		RELEASE_5_4_0 RELEASE_5_5_0 RELEASE_5_EOL RELEASE_6_0_0
		RELEASE_6_1_0 RELEASE_6_2_0 RELEASE_6_3_0 RELEASE_6_4_0
		RELEASE_6_EOL RELEASE_7_0_0 RELEASE_7_1_0 RELEASE_7_2_0
		RELEASE_7_3_0 RELEASE_7_4_0 RELEASE_7_EOL RELEASE_8_0_0
		RELEASE_8_1_0 RELEASE_8_2_0 RELEASE_8_3_0 RELEASE_8_4_0
		RELEASE_9_0_0 RELEASE_9_1_0 RELEASE_9_2_0 RELENG_2_0_5
		RELENG_2_0_5_ALPHA RELENG_2_0_5_BP RELENG_2_0_5_RELEASE
		RELENG_2_1_0_BP RELENG_2_1_0_RELEASE RELENG_2_1_5_RELEASE
		RELENG_2_1_6_1_RELEASE RELENG_2_1_6_RELEASE
		RELENG_2_1_7_RELEASE RELENG_2_2_0_RELEASE
		RELENG_2_2_1_RELEASE RELENG_2_2_2_RELEASE
		RELENG_2_2_5_RELEASE RELENG_2_2_6_RELEASE
		RELENG_2_2_7_RELEASE RELENG_2_2_8_RELEASE RELENG_2_2_BP
		RELENG_3 RELENG_3_0_0_RELEASE RELENG_3_BP
		}

	}
 svn checkout -q file:///usr/svn/ports # 2014-12-28 in fire/usrb/tmp/svn
	{
	ran over half a week (inc ^Z) & produced 23.2 Gig,
	.svn/		 6   Gig
	tags/		16.4 Gig
		lots of RELEASE_* & RELENG_*
		ls -1 | wc -l	# 86
	head/		278 Meg
	svnadmin/	224 K
	X display died, & it seemed to keep running after that.
	}

 http://svn.freebsd.org/base/ROADMAP.txt
 http://svnweb.freebsd.org/ports/tags/RELEASE_9_2_0/
 http://svnweb.freebsd.org/doc/release/9.2.0/

 svn ... releng/9.2 # (announced with RC3)
 svn checkout svn+ssh://svn.freebsd.org/ports/head /usr/ports
 svn checkout svn+ssh://jarjar@@svn.freebsd.org/ports/head /usr/ports
 svnsync sync file:///local/vc/svn/base
 svn co http://svn0.us-west.FreeBSD.org/ports/head /usr/ports
 cd /usr/ports && svn update	# Update a checked out repository
 svn co http://ext2fsd.svn.sourceforge.net/svnroot/ext2fsd/trunk/ext2mgr Ext2Mgr
 svn co -r REVISION http://svn.freebsd.org/ports/head/CATEGORY/PORT
	releng/8.4	/usr/src
 svn diff -cXXXXXX --summarize svn://svn.freebsd.org/base
	replacing XXXXXX with the revision number
	To see which files were modified by a particular revision
 cd /usr/src ; svn switch http://svn.freebsd.org/base/releng/8.5
  -----------------------------------------------------------------------------
 SVN branch tag for head:
	svn://svn.freebsd.org/base/head/
 svn co http://scanbd.svn.sourceforge.net/svnroot/scanbd scanbd
 svn co http://trillian.chruetertee.ch/svn/ports/tags/xorg_7_5_2/
	for the more conservative tree or
 svn co http://trillian.chruetertee.ch/svn/ports/trunk/
	if you want the latest and greatest
 Sample from http://wiki.freebsd.org/PortsSubversionPrimer
	Host svn.freebsd.org
		Ssh User jarjar
  -----------------------------------------------------------------------------
 2014-12-28 Working Examples
  svn log -qv -r '{2011-12-28}':'{2011-12-29}' http://svn0.eu.freebsd.org/ports
  svn log -qv -r '{2011-12-28}':'{2011-12-29}' file:///usr/svn/ports
========================
 2015-06-01 search for tags
	cd /usr/svn ; Grep 9.3-RELEASE
	./base/db/revprops/268/268520:Tag 9.3-RELEASE.
	./base/db/revprops/268/268523:Tag 9.3-RELEASE from r268512
	./doc/db/revprops/45/45105:Tag FreeBSD docset for 9.3-RELEASE
	./ports/db/revprops/359/359467:Tag ports for 9.3-RELEASE
  -----------------------------------------------------------------------------
 Attic:
 -----------------------------------------------------------------------------
	-R still fails on 4.5 with
		cvs -R export -r RELENG_4_6_0_RELEASE src
		cvs [export aborted]: cannot write /public/freebsd/ref/cvs/cvs/CVSROOT/val-tags: Permission denied
	 /public/freebsd/ref/cvs/cvs/CVSROOT/
		drwxr-xr-x   6 daemon  daemon	 1536 Jun 17 17:55 ./
		drwxr-xr-x  10 daemon  daemon	  512 Apr 25 02:35 ../
		containing no val-tags
  -----------------------------------------------------------------------------
  RELENG_x_y_z_RELEASE	The tag (not branch) of the x.y.z release.
  RELENG_x_y_BP 	Branch point to the x.y release branch.
			Perhaps allows cvs diff -r RELENG_x_y_BP -r HEAD
  src RELENG_3_2_PAO commited by Warner Losh <imp@@harmony.village.org>
	= 3.2 Release + PAO3 patches to 3.2, not RELENG_3 + PAO.
  Most can be found, by doing a cvs log on /usr/src/Makefile
  -----------------------------------------------------------------------------
 Examples:
	cvs -R -q checkout contrib_ipfilter ipf ipfstat ipftest kld_ipfilter
	cvs -R -q log | grep '^date' | wc -l
	cvs -R -q log | grep '^date' | grep darrenr | wc -l
		#	cvs co module_name
		# see ${CVSROOT}/CVSROOT/modules for a map
		#	cd module_name
		#	vi foo bar zeek
		#	cvs commit
		#	cd ..
		#	cvs release -d module_name
  -----------------------------------------------------------------------------
 Other /usr/cvs/src/ files to check for EG "4.6-PRERELEASE"
	release/doc/share/sgml/release.ent,v
	sys/conf/newvers.sh,v
	sys/sys/param.h,v
  -----------------------------------------------------------------------------
 OPENBSD
	setenv CVSROOT /usr2/ftp/public/openbsd/work/cvs
	cvs export -r OPENBSD_2_6 src
		cvs export: /usr2/ftp/public/openbsd/work/cvs/CVSROOT/config:\
			unrecognized keyword 'tag'
	cvs export -r OPENBSD_2_5 src
		cvs export: /usr2/ftp/public/openbsd/work/cvs/CVSROOT/config:
			 unrecognized keyword 'tag'
	cvs export -r OPENBSD_2_5_BASE src
		cvs export: /usr2/ftp/public/openbsd/work/cvs/CVSROOT/config:
			 unrecognized keyword 'tag'
	2 commands above produce an identical list of files, & only
	the contents of these are different:
		src/gnu/usr.bin/cvs/doc/cvs.info-4
		src/gnu/usr.bin/cvs/doc/cvs.info-7
		src/gnu/usr.bin/cvs/doc/cvs.ps
		src/usr.sbin/afs/src/INSTALL
		src/usr.sbin/afs/src/README
		src/usr.sbin/dhcp/server/dhcpd.c
	for dhcpd.c, OPENBSD_2_5_BASE gives a more complete message []
	Looking at the sequential list in src/Makefile,v, I guess
	OPENBSD_2_5_BASE is the provisional, & OPENBSD_2_5 is the final.

	cvs export -r OPENBSD_2_5 ports # & cvs export -r OPENBSD_2_4 ports
		cvs [export aborted]: no such tag OPENBSD_2_5
		nothing useful produced
	cvs export -r HEAD www			6.4 Meg.
  -----------------------------------------------------------------------------
  NETBSD Tags
	1.4		netbsd-1-4-RELEASE
	1.4.1		netbsd-1-4-PATCH001
	1.4-willbe-2	netbsd-1-4
		The latter is the "1.4 release branch tag".  When 1.4.2 is
		released, it will be tagged with netbsd-1-4-PATCH002.
 cvs -r netbsd-1-5
-------------------------------------------------------------------------------
cvsup	long replaced by src/usr.bin/csup
if you cvsup to RELENG_4
	/usr/src/sys/conf/newvers.sh
		REVISION="4.10"
		BRANCH="RC"
		BRANCH="BETA" -> "PRERELEASE"
	you'll get BRANCH="RC" if you cvsup to RELENG_4_10
  --
 I use to run small redirector (plug) on server with public IP address and
 then on client cvsup -g -L 2 -P m /etc/cvsupfile.
 It is a little tricky (IMHO) to set up, but you can use m3socks to allow
 cvsup to use a SOCKS proxy, if you have one of those. I'm also behind a
 firewall so that is what I did.
 --
 gj 2002.10 recs. cvsup5.de.freebsd.org = ecrc
 gj@2004.12:
	If you already have a populated /usr/obj from a previous
	``nice make -j 1 buildworld'', then this (bash) alias can speed up generating new
	binaries after a cvsup:
	alias mwq='cd /usr/src;make -s _obj _includes _libraries _depend \
		everything'
	If it fails then just do a full ``nice make -j 1 buildworld''.
 2005.09 cebulon
	cd /root ; cvsup -g stable-supfile
 ----
 ew 2009:
	"RELENG=." that will give you then CURRENT and what5 is the
	latest source of it.
-------------------------------------------------------------------------------
dbx
 where
-------------------------------------------------------------------------------
dd
 Equivalent of "dd if=bootimg.bin of=/dev/fd0.1440" on DOS, OS/2, MS-Win*:
 cd to	_sys\bootdisk, then type: loaddskf  boot-cd.dsk a:
 before dd'ing a dvd (bs=2k) one needs to first run eg mplayer probably
 to convince driver to ignore CRC errors or something like that.
 ---
 to allow to write a ram stick:
	sysctl kern.geom.debugflags=16
 dd if=8.0-RELEASE-i386-memstick.img of=/dev/da1 bs=64k conv=sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	From: Christer Solskogen <christer.solskogen@@gmail.com>
	Date: Sun, 19 Jun 2011 08:43:50 +0200
	Cc: freebsd-stable@@freebsd.org

	> Is the procedure for creating new FreeBSD memstick images documented
	> anywhere?

	I'm not sure if its documented but this is how I do it:
	(edit /etc/make.conf and /etc/src.conf if necessary)
	nice make -j 1 buildworld && nice make -j 1 buildkernel

	Insert usb stick
	fdisk -BI /dev/da0
	bsdlabel -B -w da0s1
	newfs -U /dev/da0s1a
	mount /dev/ad0s1a /mnt
	Make installworld installkernel distribution DESTDIR=/mnt

	Edit /mnt/etc/fstab
	/dev/da0s1a /	   ufs	     rw    1 1

	Edit /mnt/etc/rc.conf for your needs
	unmount /mnt
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 http://mfsbsd.vx.sk/
-------------------------------------------------------------------------------
dd_rescue	# /usr/ports/sysutils/dd_rescue
/sbin/recoverdisk
badblocks	sysutils/e2fsprogs
ports/sysutils/smartmontools
-------------------------------------------------------------------------------
recoverdisk
	not a good tool to recover blocks off eg a copy protected commercial DVD,
	it can run for 36 hours & not be finished
-------------------------------------------------------------------------------
ports/
	cd /pri/freebsd/releases
	grep FBSD_CC_VER */src/gnu/usr.bin/cc/cc_tools/freebsd-native.h
	cd /pri/freebsd/releases/9.3-RELEASE/ports
	setenv PORTSDIR `pwd`
	make OSVERSION=900001 fetchindex
	cd /pri/freebsd/releases/10.1-RELEASE/ports
	make OSVERSION=1000001 fetchindex
	/pri/FreeBSD/branches/amd64/-current/ports
	make OSVERSION=1100001 fetchindex
-------------------------------------------------------------------------------
{
	To strip this section:

	Sample history of a disk recovery 2012-11:
	____________________
	 Disk Geometry & Log Of Bad Sectors:
	  uname -a
	   FreeBSD towr.my.domain 6.3-RELEASE FreeBSD 6.3-RELEASE #0:
	   Fri Feb 15 20:16:36 CET 2008
	   jhs@@tower.berklix.org:/usr/src/sys/i386/compile/TOWER.small	i386
	  dmesg:
		ad0: 39266MB <IBM DTLA-305040 TW4OA60A> at ata0-master UDMA66
		  ad0 LBA= 2668207 2668375 2795327 2795423 2795551 2798655
			2814535 2826811 2995103 4902687 4902688 4902689
		  kernel: g_vfs_done():
			  ad0s1f[READ(offset=65536, length=8192)]error = 5
			  ad0s1d[READ(offset=652230656, length=131072)]error = 5
			  ad0s1d[READ(offset=652279808, length=131072)]error = 5
			  ad0s1d[READ(offset=652345344, length=131072)]error = 5
			  ad0s1d[READ(offset=652345344, length=65536)]error = 5
			  ad0s1d[READ(offset=654000128, length=2048)]error = 5
			  ad0s1d[READ(offset=662130688, length=2048)]error = 5
			  ad0s1d[READ(offset=668416000, length=2048)]error = 5
			  ad0s1d[READ(offset=754581504, length=16384)]error = 5
	  fdisk /dev/ad0
		cylinders=79780 heads=16 sectors/track=63 (1008 blks/cyl)
		Media sector size is 512
		Warning: BIOS sector numbering starts with sector 1
		Information from DOS bootblock is:
		The data for partition 1 is:
		sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
		    start 63, size 80405262 (39260 Meg), flag 80 (active)
			beg: cyl 0/ head 1/ sector 1
			end: cyl 1023/ head 254/ sector 63
	  disklabel /dev/ad0s1
		#	 size	offset	  fstype   [fsize bsize bps/cpg]
		  a:  1048576	     0	  4.2BSD     2048 16384     8
		  b:   472672  1048576	    swap
		  c: 80405262	     0	  unused	0     0
		  d:  2332672  1521248	  4.2BSD     2048 16384 28552
		  e:  1048576  3853920	  4.2BSD     2048 16384     8
		  f: 75502766  4902496	  4.2BSD     2048 16384 28552
	  Check (with dc) that partitions do not go beyond end of disk:
		39266 1024 2 * * p		# 80416768	\
					Total 512 bytes sectors in disk < dmesg
		63 4902496 75502766 + + p	# 80405325	f:
		63 80405262 + p 		# 80405325	c:
	  mount
		/dev/ad0s1a on / (ufs, NFS exported, local)
		devfs on /dev (devfs, local)
		/dev/ad0s1e on /tmp (ufs, NFS exported, local, soft-updates)
		/dev/da0a on /U (ufs, local)
		/dev/ad0s1d on /var (ufs, NFS exported, local, soft-updates)
	____________________
	 Data Recovery
	  mount -t ufs /dev/da0s1 /mnt ; cd /mnt
	  dd_rescue -l log -o bbfile -A -v /dev/ad0s1f image
	  cat bbfile # 130 160 9785408 9785409 71591611 71784469
	  mdconfig -a -t vnode -f image
	  (cd /usr/ports/sysutils/ffs2recov; make install)
	  ffs2recov -s /dev/md0
		superblock: 81920(byte), 160(block)
		superblock: 6160384(byte), 12032(block)
		superblock: 73351168(byte), 143264(block)
		superblock: 192774144(byte), 376512(block), \
			cg: 192790528(byte), 376544(block), 1(nth), \
			fs begin: 0(block), primary sb at: 128(block)
		superblock: 385466368(byte), 752864(block), \
			cg: 385482752(byte), 752896(block), 2(nth), \
			fs begin: 0(block), primary sb at: 128(block)
		superblock: 578158592(byte), 1129216(block), \
			cg: 578174976(byte), 1129248(block), 3(nth), \
			fs begin: 0(block), primary sb at: 128(block)
		superblock: 770850816(byte), 1505568(block), \
			cg: 770867200(byte), 1505600(block), 4(nth), \
			fs begin: 0(block), primary sb at: 128(block)
		superblock: 963543040(byte), 1881920(block), \
			cg: 963559424(byte), 1881952(block), 5(nth), \
			fs begin: 0(block), primary sb at: 128(block)
		superblock: 1156235264(byte), 2258272(block), \
			cg: 1156251648(byte), 2258304(block), 6(nth), \
			fs begin: 0(block), primary sb at: 128(block)
		superblock: 1348927488(byte), 2634624(block), \
			cg: 1348943872(byte), 2634656(block), 7(nth), \
			fs begin: 0(block), primary sb at: 128(block)
	  ffs2recov -o 160 /dev/md0	# Failed, presumably cos of data corruption.
	  echo The first few superblocks dont work, so I used first one showing cg:
	  fsck_ffs -y -b 376512 /dev/md0	# Succeeded
	  mdconfig -d -u 0
	--------------------
	 Media Recovery
	  ( Force Writes To Blocks To Get Disc Bios To Remap Bad Blocks \
		 To Fix Itself.)
	  --------------------------- 1a /root
	  These 2 failed from single use with root mounted read only:
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D -m 20000k \
		 /dev/ad0 /dev/ad0
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D -m 20000k \
		 /dev/ad0s1 /dev/ad0s1
	  --------------------------- 1a /root
	  cd /U/save/ad0s1a
		started from single user:
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D \
		  /dev/ad0s1a /dev/ad0s1a
		dd_rescue: (fatal): open "/dev/ad0s1a" \
			 failed: Operation not permitted
		even after reboot read only, it still wont run
		so need to boot off a stick ? JJLATER
	  --------------------------- 1b Swap
	  cd /U/save/ad0s1b	# new directory to keep seperate log and bbfile
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D /dev/ad0s1b \
		 /dev/ad0s1b
		No errors
	  --------------------------- 1d /var
	  cd /U/save/ad0s1d	; umount /var
		dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D \
			/dev/ad0s1d /dev/ad0s1d
		No errors
	  --------------------------- 1e /tmp
	  cd /U/save/ad0s1e
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D /dev/ad0s1e \
		/dev/ad0s1e
		No errors
	  --------------------------- 1f /usr
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D /dev/ad0s1f \
		/dev/ad0s1f
		# ^C break ; halt -p # resume next day
	  - - - - - - - - - - - - - -
	  cd /U/save/ad0s1f.offset=0.size=13854300
		dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D -m 13854300k \
			 /dev/ad0s1f /dev/ad0s1f
		(info): ipos:	7240832.0k, opos: 7240832.0k, xferd: 7240832.0k
			* errs: 0, errxfer: 0.0k, succxfer: 7240832.0k
	  - - - - - - - - - - - - - -
	  cd /U/save/ad0s1f.offset=7240800k.size=6613500
		dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D -m 6613500k \
			-s 7240800k -S 7240800k  /dev/ad0s1f /dev/ad0s1f
		No errors
	  - - - - - - - - - - - - - -
	  cd /U/save/ad0s1f.offset=13854300
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D -s 13854300k \
		 -S 13854300k \
		/dev/ad0s1f  /dev/ad0s1f
		# ^C break at  ipos:  26486044.0k, opos:  26486044.0k
		No errors
	  - - - - - - - - - - - - - -
	  cd /U/save/ad0s1f.offset=26486000
	  dd_rescue -l log -o bbfile -A -v -b4k -B4k -d -D -s 26486000k \
		 -S 26486000k \
		/dev/ad0s1f  /dev/ad0s1f
		Errors Occured.
	  dd_rescue: (info): ipos:  56984860.0k,
	  Bad block: 14246215
	  head bbfile
		8948951 8973058 \
		9437845 9437846 9437847 9437848 9437849 9437850 9437851 9437852
	  dc 9437845 4 * 2 * p		# 75502760
	  disklabel says partition is	  75502766
	  Deduction:
		list of bad blocks upward from 9437845 (4 million lines!)
		show dd_rescue does not recognise end of partition /dev/ad0s1f.
		(Strange, as dd_rescue did recognise end of ad0s1b).
	}
-------------------------------------------------------------------------------
ddb
 to activate ddb (eg on a usb hang):	ctl alt esc
 DDB_UNATTENDED
 trace
 ps
 panic
-------------------------------------------------------------------------------
Next USB panic post rseult of this:
	bt; show pcpu; show alllocks; show locks; p
-------------------------------------------------------------------------------
dig
	dig @ip-of-nameserver mydomain.com mx
	dig -x IP_address
-------------------------------------------------------------------------------
DOC FORMAT
 Proprietary Microsoft .doc format files:,
 FreeBSD offers you the following (incomplete) list of /usr/ports/ ways
 of accesing that file:
	textproc/antiword
 And monster packages:
	editors/staroffice70
	editors/openofficea.org-2.0
	editors/koffice-kde3
 + Commercial packages: ApplixWare
-------------------------------------------------------------------------------
bsdlabel
 bsdlabel -w -r wd0 c_wd0
 bsdlabel -w -r da4 DNES-309170W

 label rescue:
	http://lists.freebsd.org/pipermail/freebsd-questions/2007-December/165187.html
	http://www.42.org/~sec/resources/disklabel.html
	http://www.leidinger.net/FreeBSD/ffsrescue.tar.gz
diskinfo da0
-------------------------------------------------------------------------------
gpart show da0
gpart & USB, a thread:
	{
	From: Steve Kargl <sgk@@troutmask.apl.washington.edu>
	Date: Mon, 22 May 2023 20:44:53 -0700 (Tue 05:44 CEST)
	To: freebsd-hackers@@freebsd.org

	Is there a secret incantation for destroying an EFI
	partition on a USB memstick?  After installing FreeBSD,
	I would like to re-use a memstick, but

	% gpart destroy da0
	gpart: geom 'da0': Read-only file system
	% gpart destroy -F da0
	gpart: geom 'da0': Read-only file system
	% gpart show da0
	=>	40  60063664  da0  GPT	(29G)
		40  60063664	1  ms-basic-data  (29G)
	% gpart delete -i 1 da0
	gpart: geom 'da0': Read-only file system
	% dd if=/dev/zero of=/dev/da0 bs=1m
	dd: /dev/da0: Read-only file system
	gpart list da0
	sysctl -a | grep da01
	kern.geom.disk.da0.flags: 1a8<CANFLUSHCACHE,DIRECTCOMPLETION,CANZONE,WRITEPROTECT>
	I suppose the question is how to clear WRITEPROTECT.

	From: Warner Losh <imp@@bsdimp.com>
	WRITEPROTECT gets set when we do a MODE SENSE of the disk when we're
	probing it. That returns a status that indicates that the device is
	indicating it is write protected. So we set the write_protect flags in the
	disk structure which is what's reported above and used to generate the read
	only errors.

	if you are lucky, this is a software write protect. That's on mode page
	0xa. camcontrol can read that:
	# camcontrol modepage da0 -m 0xa
	will report it. if SWP is 1, then it's a software lock. Add -e to the
	above to edit it and change the line with  SWP on it from  1->0 and save.
	this will set the current value, turning it off temporarily. You can then
	proceed to write to the device, with luck.

	Without  luck the drive encountered a condition that made it decide to lock
	you out forever from  writing again.

	From: "Julian H. Stacey" <jhs@@berklix.com>
	I dont use efi & gpart but some ideas:

	Why da01 not da0 ? What is da01 ?
	a typo, or pulling in some gpart kernel stuff ?

	Is an escalated security level catching you ? I stick to default,
	on 12.4-rel multi user thats: sysctl -a | grep level # kern.securelevel: -1

	Try a fresh reboot, even staying single user,
	& before you touch it with any gpart invoking command,
	whack it with multiple dd if=/dev/zero of=/dev/zero count=5000

	(multiple as sometimes Ive seen first attempt doesnt seem to clear
	my sticks, a 2nd reboot after dd will clear any false cached memories)

	If that doesnt work:
	  Try an older BSD that does know about EFI & gpart ?
	  Put it a Microsoft PC, or a USB to Go adapter on an android,
	  that probbly will complain unknown & offer to bash it back to MBR ?
	  Rumage around or ask friends, eg I have a tiny old match box size thing
	  that clones sticks. Clone your stick from some other small stick,
	  then repair the wrong sized MBR

	From: Steve Kargl <sgk@@troutmask.apl.washington.edu>

	Thanks for the advice, Warner.	I thought about camcontrol
	last night, but it's been a long long time since I've had
	a need for it.

	% camcontrol modepage da0 -l
	0x08	Caching
	0x1c	Informational Exceptions Control
	0x05	Flexible Disk
	% camcontrol modepage da0 -m 0xa
	camcontrol: mode sense command returned error

	I suppose this is the end for that memstick.

	From: Steve Kargl <sgk@@troutmask.apl.washington.edu>

	Yes, a typo.  I used da0.
	securelevel is -1.
	Thanks for the suggestions.  I spent sometime on a Windows 10
	system trying yo convince windows to format/destory/read/write
	do whatever to the memstick.  FreeBSD tools are so much easier
	to use!
	From what Warner has written, I think I'll write off this
	memstick.  It was the right size for what I needed to do,
	but it's now past diminishing returns to play with some
	more.

	From: "Peter 'PMc' Much" <pmc@@citylink.dinoex.sub.org>

	There are apparently problems with (some?) newer such memsticks:
	My old ones work fine with partitions of UFS or even ZFS. But
	my newer ones have horribly bad performance with UFS filesystems
	(and these are not the cheapest chinese pieces).
	It seems to me like they might have internal intelligence that
	optimizes for typical microsoft filesystems.

	So I once tried what would happen when I continue writing
	into an UFS filesystem on the stick no matter how long it takes -
	and what happened was exactly what Warner describes: after some
	time the thing switched itself to read-only.

	In fact I have a problem with this, because I need a means to
	store single files of 20+ GB on a stick.
	}
-------------------------------------------------------------------------------
ed
	export EDITOR=ed
	export VISUAL=ed
	export TERM=cons25
-------------------------------------------------------------------------------
exif --list-tags --no-fixup 
	After using some tools inc. xv to rotate a jpg image (eg
	from a camera held in portrait not usual landscape mode)
	xv rotates the bitmap, but fails to edit the "Orientation"
	EXIF information in JPEG files in , so browsers firefox &
	chromium display an incorrectly rotated image, so:
exif --output=rotated.jpg --ifd=0 --tag=Orientation --set-value=1 \
		original.jpg	# rotates 90 anti clockwise
	Exif only changes first occurence of "Orientation|Right-top"
	Second occurence remains unchanged at "Orientation|Right-top"
	However its sufficient to keep happy firefox & chromium
	Values:
		0=Unknown value 0
		1=Top-left
		2=Top-right
		3=Bottom-right
		4=Bottom-left
-------------------------------------------------------------------------------
exmh
  Screwed graphics of all rectangular buttons:
     Sample "Encrypt-only outgoing messages" & "Log: View Tail"
	Thick top left edges + thin base right edges = On
	Thin top left edges + Thick base right edges = Off
     Diamond 1 of N selectors:
	Thick top left & right + thin base left & right = Selected.
	Thin top left & right + thick base left & right = Not Selected.
  Warning exmh breaks any symbolic links created by such as
	ln -s exmh-defaults exmh-defaults.`hostname -s`
		so I need to manually copy over whichever host I'm running on.
 To send gpg keys
	more
	sedit
	more
	attachment
	pgp keys
 Start exmh with an agent so it has passphrase to decrpt:
	eval `q-agent -c -q -g &` ; exmh
 To ensure gpg talks in English to EXMH,
	even if default (login) language is other
	by "Klaus Elsbernd" <elsbernd@@dfki.uni-kl.de>
		#!/bin/sh
		volcheck
		LANG=de
		LANGUAGE=en
		LC_ALL=de_DE.ISO8859-1
		PATH=/usr/dt/bin:$PATH
		MM_CHARSET=iso-8859-1
		export LANG LANGUAGE LC_ALL PATH MM_CHARSET
		umask 7
		/opt/dfki/bin/exmh $*
  To fetch passphrase for GPG, install security/quintuple-agent
	{Harv
	I've been using exmh with pgp/gpg for many years.  I'm currently
	using exmh 2.7.2 with gpg 1.4.9 on RedHat (Linux 2.6.9).  Comparing
	your exmh default with mine, I see the following gpg differences:

		gpgCacheIds:	persistent		DONE
		gpgKeyQueryMethod:	hkp		DONE
		gpgShortMessages:	0		DONE
		gpgShowInline:	none			was all

	I suspect the use of "gpgShowInline: all" and/or
	"gpgKeyQueryMethod: email" may be relevant to explaining
	the behavior you're seeing.
	Harv
	}
	{Klaus
	setting
		"show pgp messages inline" to all	DONE
		"short gnupg reports" to off		DONE
	will deliver more info.
	}
  My notes
	Keep PGP passphrase	I leave it OFF.
		If on
			cant decrypt
			q-agent -d complains
  On sending crypted,
	 if error box:
		couldn't open "/home/jhs/tmp/0.pgp.4464.exmh": \
		 no such file or directory
	& error log:
		gpg --batch --status-fd 2 --no-greeting
			 --comment Exmh version 2.7.2 01/07/2005
			 --force-v3-sigs --cipher-algo 3des
			 --digest-algo sha1 --compress-algo 1 -eat
			 -o /home/jhs/tmp/0.pgp.4464.exmh
			 -r 0xABCDEF12 -r 0xABCDEF13
			 /home/jhs/tmp/1.msg.4464.exmh |& cat
		{<Pgp_Exec_Batch>: Exit status: 1 NONE}
		{Pgp_Exec_CheckSuccess gpg /home/jhs/tmp/0.pgp.4464.exmh
		gpg: 21DE9751: There is no assurance this key belongs \
			 to the named user
		[GNUPG:] INV_RECP 10 0xABCDEF13
		gpg: /home/jhs/tmp/1.msg.4464.exmh:
			 encryption failed: unusable public key
	Then
		gpg --sign-key friend@@his.domain	# see gpg

	See Also ~/bin/.sh/demime+emil+delatt
	--------
	To move gpg keys to a new machine
	Old PC: cd ~; umask 077; tar cf gnupg.tar .gnupg
	New PC: cd ~; rm -rf .gnupg; umask 077; tar xf ./gnupg.tar
		rm -f .gnupg/random_seed;gpg --list-secret-keys;gpg --list-keys
	-----------
	I have discovered that if with exmh-2.8.0 I send a mail with body:
		Beginning of some line in body of mail

		From jhs@@somewhere
		Date: Mon, 28 Aug 2017 09:13:31 +0200
		Subject: test of amputated forward
	Then exmh prepends a '>' before it sends it, so recipient sees:
		Beginning of some line in body of mail

		>From jhs@@somewhere
		Date: Mon, 28 Aug 2017 09:13:31 +0200
	& whole mail is received & displayed intact by a recipient exmh.

	But, if sent mail looks like this:
		X------- Forwarded Message
		From jhs@@somewhere Mon Aug 28 12:40:35 2017
		Date: Mon, 28 Aug 2017 09:13:31 +0200
		Subject: test of amputated forward layer=inner
	Or
		X
		------- Forwarded Message
		From jhs@
	Then although exmh send the whole mail intact, (proven by
	using as recipient a mailman archive), then also my localhost
	receives a seperate copy of that forwarded mail.
	-----------
 It is not a problem if ~/.exmh is accessed by AMD+NFS, but
 if ~/mail/ is accessed via AMD+NFS to 300 Meg, it starts Very slow.
 http://rand-mh.sourceforge.io/book/
-------------------------------------------------------------------------------
gbde
	/site/etc/devd/berklix.conf
	~/private/bin/.sh/gbde_build.sh
	~/public_html/bin/.sh/gbde.sh
	~/public_html/bin/.sh/gbde2.sh
	~/public_html/bin/.sh/mdconfig_tst
	~/public_html/bin/.sh/rc.shutint
	~/public_html/bin/.sh/rc.shutmedia
	~/public_html/bin/.sh/rc.shutusb

	a good thread on gbde V. geli starts here:
	http://lists.freebsd.org/pipermail/freebsd-current/2015-October/057844.html
	much of info in that thread would be worthy of inclusion on handbook.
-------------------------------------------------------------------------------
get_iplayer http://www.bbc.co.uk/sounds/play/m0001g9v
	fetches
	70M Dead_Ringers_Christmas_Specials_2018_-_2018-12-07_m0001g9v_original.audio.ts
	10K Dead_Ringers_Christmas_Specials_2018_-_2018-12-07_m0001g9v_original.audio.txt
	At end removing both above & creating
	67M Dead_Ringers_Christmas_Specials_2018_-_2018-12-07_m0001g9v_original.m4a
	(If you want the .ts & .txt, create hard links while get_iplayer is running.)
	It then wants /usr/local/bin/AtomicParsley
	file: De*
		Dead_Ringers_Christmas_Specials_2018_-_2018-12-07_m0001g9v_original.audio.ts:  MPEG transport stream data
		Dead_Ringers_Christmas_Specials_2018_-_2018-12-07_m0001g9v_original.audio.txt: ASCII text
		Dead_Ringers_Christmas_Specials_2018_-_2018-12-07_m0001g9v_original.m4a:       ISO Media, Apple iTunes ALAC/AAC-LC (.M4A) Audio
	Install:
		pkg install get_iplayer; pkg install AtomicParsley;
		cd /usr/ports/net/get_iplayer; make install
		cd multimedia/atomicparsley;   make install
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
l /usr/local/www/get_iplayer/get_iplayer
-r-xr-xr-x  1 root  wheel  355276 Jul 13  2023 /usr/local/www/get_iplayer/get_iplayer*

> ljk:
> http://www.squarepenguin.co.uk/
> Open source downloader for BBC iPlayer progs, runs on almost everything.
> You can download complete series in one go with a single command line
> instruction pointed to the BBC iPlayer site with the list of progs
> available for that series. 
> You can download BBC audio in De without a VPN but videos need a VPN.

-------------------------------------------------------------------------------
GPG Ex PGP
 gpg --gen-key
 gpg --list-keys
 gpg --list-public-keys
 gpg --list-secret-keys
 gpg --delete-key "Julian H. Stacey"
 gpg --delete-secret-keys "Julian H. Stacey"
 gpg -a --export "Julian H. Stacey" > Julian_H._Stacey.asc
 gpg -a --fingerprint
 from_backup_host:	gpg -a --export "Julian H. Stacey" > x.pub
 to_main_host:		gpg --import x.pub
 from_backup_host:	gpg -a --export-secret-keys "Julian H. Stacey" > x.pri
 to_main_host:		gpg --keyring ~/.gnupg/secring.gpg --import x.pri
 gpg -a -e enclosure_to_encrypt > out
 gpg --list-keys "Julian H. Stacey"	# shows 2
 gpg --list-keys "Julian H. Stacey (20080604103910)"	# shows 1
 gpg -a --export "Julian H. Stacey (20080604103910)"
 gpg -a --fingerprint "Julian H. Stacey (20080604103910)"
 gpg -a --import < gj_public_key
 gpg --edit-key
 gpg --sign-key friend@@his.domain	# see exmh
	Until you do this the key is not trusted & a mailer might
	spring an interactive window, but if like exmh it uses batch
	mode, then you cant send to that person.
	The difference is not visible with gpg --list-keys
	but is visible with gpg --sign-key friend@@his.domain
    ------ Before
    pub  1024D/56D81332  created: 2008-06-03  expires: never	   usage: SC
			 trust: unknown       validity: unknown
    sub  2048g/F61A79A1  created: 2008-06-03  expires: never	   usage: E
    [ unknown] (1). First Last (Middle name) <friend@@his.domain>
    ------ After
    pub  1024D/56D81332  created: 2008-06-03  expires: never	   usage: SC
			 trust: unknown       validity: full
    sub  2048g/F61A79A1  created: 2008-06-03  expires: never	   usage: E
    [  full  ] (1). First Last (Middle name) <friend@@his.domain>
    ------

 GnuPG keyring file locations:
	Unix MacOSX, Cygwin ~/.gnupg
 Windows XP and older \Documents and Settings\<username>\Application Data\Gnupg
 Windows Vista and newer \Users\<username>\AppData\Roaming\gnupg
-------------------------------------------------------------------------------
gnomelogalyzer.sh
	cd /usr/ports/ports-mgmt/portupgrade ; make install
	portupgrade -f intltool
	If portupgrade does not work, and you recently updated Perl:
		portupgrade -f p5-\*
-------------------------------------------------------------------------------
gnupg-users@@gnupg.org 26 Dec 2014
 "TrueCrypt ... if you need free software disk encryption for Windows
 then it's your only real choice, and it doesn't appear to be an
 obviously stupid one." rjh@@sixdemonbag.org
-------------------------------------------------------------------------------
gpg-agent
 cd /usr/ports/security/gnupg-devel/work/gnupg-1.9.22/doc ; make
 chimera gpg-agent.html
 gpg-agent --verbose
-------------------------------------------------------------------------------
CAMERA=technika: /dev/ugen0 /dev/ugen0.0 /dev/ugen0.1 /dev/ugen0.2
	see notes in devd.conf
	su
gphoto2 --auto-detect
	mk@'s Technika: 			Che-Ez Snap SNAP-U     usb:
	7.1 Odys (power on or off) Technika:	Nothing
gphoto2 --list-cameras | grep -i Che-Ez
	"Che-ez Snap" (EXPERIMENTAL)
	"Che-Ez Snap SNAP-U" (EXPERIMENTAL)
	"Che-ez! Babe"
	"Che-ez! Splash" (EXPERIMENTAL)
	"Che-ez! SPYZ"
gphoto2 --version
	gphoto2 2.4.0
	libgphoto2	2.4.0	       cc, no ltdl, EXIF
	libgphoto2_port 0.8.0	       cc, no ltdl, USB, serial without locking
gphoto2 --port usb: --camera "Che-Ez Snap SNAP-U"  --abilities
   7.1:
	Abilities for camera		 : Che-Ez Snap SNAP-U
	Serial port support		 : no
	USB support			 : yes
	Capture choices 		 :
				 : Capture not supported by the driver
	Configuration support		 : no
	Delete selected files on camera  : no
	Delete all files on camera	 : yes
	File preview (thumbnail) support : yes
	File upload support		 : no

gphoto2 --port usb: --camera "Che-Ez Snap SNAP-U" --get-all-files
	-rw-------   1 root  staff  304178 Oct	7 09:38 pict001.ppm
	-rw-------   1 root  staff	48 Oct	7 09:38 pict002.ppm
	-rw-------   1 root  staff	48 Oct	7 09:38 pict003.ppm
gphoto2 --port usb: --camera "Che-Ez Snap SNAP-U" --summary
	Your USB camera seems to have an SQ905C chipset.
	The total number of pictures in it is 3
		(I jhs know this is wrong. Theres 18 pictures)
gphoto2 --port usb: --camera "Che-Ez Snap SNAP-U" --about
	sq905C generic driver Theodore Kilgore <kilgota@@auburn.edu>
gphoto2 --port usb: --camera "Che-Ez Snap SNAP-U" --shell
	ls	# shows nothing
	list-config
		This camera does not offer any configuration options.
	capture-image
		This camera can not capture
CAMERA=Odys /dev/pass1 (only if camera powered up before plug in)
CAMERA=Canon IXUS 2	No dev changes
-------------------------------------------------------------------------------
gs -help
ghostscript
	/usr/local/share/doc/ghostscript/9.56.1/index.html
	http://www.ghostscript.com/
	http://ghostscript.readthedocs.io/en/latest/
-------------------------------------------------------------------------------
handbrake	another DVD ripper /usr/ports/multimedia/handbrake
-------------------------------------------------------------------------------
hw-probe -probe ; hw-probe -show # ports/sysutils/hw-probe
-------------------------------------------------------------------------------
emacs
 ESC = 8 bit prefix ALT = Assert bit 8 End: C-x C-c View Forward
 Screen C-v View backward Screen M-v Redraw & Centre C-c
	C-p
 C-b		C-f
	C-n
-------------------------------------------------------------------------------
mke2fs - create an ext2/ext3/ext4 filesystem
-------------------------------------------------------------------------------
ctm:	ftp.vmunix.org Erding. Stephen M says tends to be very up to date.

 From: Gary Jennejohn <garyj@
 #!/bin/sh
 set -e
 # change the next 4 to suit
 TARGDIR="/usr/src/"
 TMPDIR="/tmp"
 CTMDIR="/sc/"
 # this could be e.g. ports-cur or cvs-cur
 WHAT="src-cur"
 # SRC="ftp.de.freebsd.org"
 # SRC="ftp.freebsd.org"
 SRC="ftp.uni-trier.de"
 #
 cd ${TARGDIR}
 set `cat .ctm_status`
 old=foo
 this=$2
 while [ $old != $2 ]
 do
	next=`expr $this + 1`
	( cd ${TMPDIR} &&
		fetch -q ftp://${SRC}/pub/FreeBSD/CTM/${WHAT}/${WHAT}.${next}.gz
 )
	if [ -f ${TMPDIR}/${WHAT}.*${next}.gz ] ; then
		ctm -v ${TMPDIR}/${WHAT}.*${next}.gz
		mv ${TMPDIR}/${WHAT}.*${next}.gz ${CTMDIR}
		old=$this
		set `cat .ctm_status`
		this=$2
	else
		break
	fi
 done

+ # Force over-ride of any user environment	FETCH_CMD=ncftp
+ # To avoid:					ncftp: illegal option -- h
+ # Jean-Marc Zucconi <jmz@@cabri.obs-besancon.fr>:
+ #   I wrote fetch because it was not possible tu use ncftp with some of
+ #   the ports/print files :-)
+ #   The problem arise when the server runs wu-ftpd and when you fetch a
+ #   directory, adding  .tar.gz to the name of the directory. Ncftp can't
+ #   do that cleanly (try it!), and we need to:
+ #   1- login
+ #   2- change the directory (the -c flag of fetch)
+ #   3- get the directory (.tar.gz).

 In order to make fetch (the FreeBSD downloading tool) ask for
 username/password when it encounter a password-protected web page, you can set
 the environment variable HTTP_AUTH to 'basic:*'.
-------------------------------------------------------------------------------
freebsd-upgrade -r 8.0-RELEASE upgrade
-------------------------------------------------------------------------------
find
 find . -type f \! -perm -1 | xargs file | grep "shell script"
	To look for all shell files that have missing execute bit,
	ie after
		cvs export -r OPENBSD_2_6 src
	nice make build fails at
		usr.sbin/httpd/src/helpers/PrintPath
 find . -type f -perm +04000
 cd /usr/ports/packages/All ; ls -lt | tail
 cd /usr/local ; find . -type f \! -newerat "May 15" | xargs ls -l
 find . -type f \! -newerat "2 months ago" | xargs ls -l | more
 find . -type f -cmin +`echo "60 24 7 3 * * * p" | dc` | xargs ls -l
	# find files created more than 3 weeks ago.  Inspect with statv

 find . -type f -newermt 2022-07-10
 find . -type f -newerBt
	man cvs section -D date_spec
	      ...
	      A wide variety of date formats are supported,  in
	      particular  ISO ("1972-09-24  20:05")  or  Internet
	      ("24 Sep 1972 20:05").  The date_spec is interpreted
	      as being in the local timezone,  unless a   specific
	      timezone	is  specified.	 The  specification  is
	      ``sticky'' when you use it to make a private copy  of
	      a  source file; that is, when you get a working file
	      using -D, cvs records the date you specified, so that
	      further  updates	in  the  same directory will use
	      the same date (unless you explicitly override it; see
	      the description of the update command).  -D is available
	      with  the  checkout,  diff,  history,  export,  rdiff,
	      rtag, and update commands.  Examples of valid date
	      specifications include:

			1 month ago
			2 hours ago
			400000 seconds ago
			last year
			last Monday
			yesterday
			a fortnight ago
			3/31/92 10:00:07 PST
			January 23, 1987 10:05pm
			22:00 GMT



-------------------------------------------------------------------------------
 To try:

dir
http://www.mirrorservice.org/pub/pcbsd/9.0-RC1/amd64/PCBSD9.0-RC1-x64-DVD.iso
lftp ftp://ftp2.de.freebsd.org/pub/FreeBSD/distfiles
lftp hftp://ftp2.de.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/9.0
lftp hftp://mirror.hs-esslingen.de/pub/Mirrors/pcbsd/9.0-RC1/amd64/PCBSD9.0-RC1-x64-DVD.iso
open hftp://ftp2.de.freebsd.org
setenv ftp:proxy http://gate

-------------------------------------------------------------------------------
gcc
 for FreeBSD-current
 __FreeBSD_version >= 400011
-------------------------------------------------------------------------------
xlsfonts
 exmh has a graphical font selector, imports xlsfonts
 -foundry-family-weight-slant-swidth-adstyle-pixels-points-res-space-registry-encoding
  Foundry:
   adobe, b&h, bitstream, dec, ibm, isas, misc, mutt, schumacher, sony, sun
  Family:
   clean, clearlyu devanagari, clearlyu ligature, courier, fixed,
   helvetica, lucida, luxi mono, new century schoolbook, times,
   open look glyph, utopia
  Weight:
   bold, medium
  Slant:
    r=rectinlear, o=oblique, i=italic
  Swidth:
   normal,
  Adstyle:
   Unused. shown by adjacent delimeters "--"
  Pixels:
   0, 6, 8, 10, 14, 17, 20, 25, 34
  Points:
   60, 100, 140, 200, 240, 180, 80
  Res: (Resolution,	dots per inch)
   75-75, 100-100
  Space:
   m (=?), c (=constant), p (=proportional)
  Registry:
   100  
	0,40,50,60,80,96,100 What meaning ?
  Encoding:
   iso8859-1. iso8859-9
   	0, is08859, iso10646, iso10646
   	1-16, irv. 1=ascii
 A default to sample for a high res screen:
	xterm -fn \
  -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
 OK with exmh:
  -adobe-times-medium-r=normal
  grep -i font ~/.exmh/exmh-defaults
*Message.font:  -misc-fixed-medium-r-normal--14-110-100-100-c-70-iso8859-1
*Msg*Text.font: -adobe-times-medium-r-normal--14-140-75-75-p-74-iso8859-1
*Text.font:     -adobe-times-medium-r-normal--18-180-75-75-p-94-iso8859-1
*fl_font:       -adobe-courier-medium-r-normal--14-100-100-100-m-90-iso10646-1
*fl_font:       -adobe-times-medium-r-normal--25-180-100-100-p-125-iso10646-1
*font:  -adobe-courier-medium-r-normal--14-100-100-100-m-90-iso10646-1
*font:  -adobe-times-medium-r-normal--25-180-100-100-p-125-iso10646-1

 xlsfonts | grep fixed-medium-r-normal--20
	-misc-fixed-medium-r-normal--20-140-100-100-c-100-iso8859-1
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-10
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-11
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-13
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-14
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-15
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-16
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-2
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-3
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-4
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-5
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-7
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-8
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-9
	-misc-fixed-medium-r-normal--20-200-75-75-c-100-koi8-r
 I  suspect iso8859-8 might be OK for german umlauts
-------------------------------------------------------------------------------
xinit
 From: Daniel Braniss <danny@@cs.huji.ac.il>
 Date: Sun, 3 Mar 2024 16:46:46 +0200 (15:46 CET)
 To: freebsd-hackers <hackers@@freebsd.org>
 In the past Xorg  listen on port 6000 was the default, now it's disabled.
 --------
 Date: Sun, 3 Mar 2024 
 From: Gary Jennejohn <garyj@@gmx.de>
 Cc: freebsd-hackers <hackers@@freebsd.org>
 I use xinit with this command line:
 /usr/local/bin/xinit -- -listen tcp
 Of course, you'll need to have a .xinitrc for that to work.
 --------
 From: Daniel Braniss <danny@@cs.huji.ac.il>
 Date: Sun, 3 Mar 2024 19:29:14 +0200 (18:29 CET)
 To: garyj@@gmx.de
 Cc: freebsd-hackers <hackers@@freebsd.org>
 
 This is the trick that has worked for me since time immemorial:
 In /etc/ttys:
 	ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   on secure
  --------
  man xdm has a LISTEN section
 From: Gary Jennejohn <garyj@@gmx.de>
 Date: Sun, 3 Mar 2024 19:08:52 +0000 (20:08 CET)
 To: Tommy Johnson <tjohnson@@bobdbob.com>
 Cc: Daniel Braniss <danny@@cs.huji.ac.il>, freebsd-hackers <hackers@@freebsd.org>
 
 Tommy Johnson <tjohnson@@bobdbob.com> wrote:
 > On Sun, 3 Mar 2024 18:05:51 +0000
 > Gary Jennejohn <garyj@@gmx.de> wrote:
 > > On Sun, 3 Mar 2024 19:29:14 +0200
 > > Daniel Braniss <danny@@cs.huji.ac.il> wrote:
 > > > This is the trick that has worked for me since time immemorial:
 > > > In /etc/ttys:
 > > > 	ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   on secure
 > > Well, it doesn't work now.
 > > I've never used xdm and have no idea what options it supports.
 > I fixed the problem by editing the file Xservers in /usr/local/etc/X11/xdm
 > to look like:
 > :0 local /usr/local/bin/X :0  -listen tcp
 > I am using xdm from .../ports/x11/xdm , as opposed to any of the
 > newer reimplementations.
 That's great!  I was hoping that a solution like this could work, since
 it's similar to xinit passing -listen tcp to the Xserver.
-------------------------------------------------------------------------------
xrandr	# multi screen - Primitive command line interface to the RandR extension
 cd /usr/ports/x11/xrandr; make install ; man xrandr
 cd /usr/ports/x11/lxrandr; make install ; man lxrandr
 http://wiki.x.org/wiki/Projects/XRandR
 cd /var/log ; vi xdm.log Xorg.0.log
 http://www.berklix.com/~jhs/dots/.xsession
 ~/.DOTS/.xinitrc
 ~/tech/xrandr/
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
 xdm-dual:
	#!/usr/local/bin/bash
	xdm -config /usr/local/lib/X11/xdm/xdm-config-dual
	xrandr --output DVI-0 --pos 1400x0
	xrandr --output LVDS --preferred
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
 xrandr_home:
	xrandr --output DVI-0 --mode 1280x1024 --pos 1400x0; xrandr --output LVDS --preferred
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
 /usr/local/lib/X11/xdm/Xservers-dual:
	# XTerminalName:0 foreign
	:0 local /usr/X11R6/bin/X -layout dualhead
	# This might be obsolete ? on FreeBSD-9.2 man X no longer lists -layout
	# 12.4-RELEASE /usr/local/bin/Xorg
-------------------------------------------------------------------------------
xxgdb
 file ~/public_html/src/bsd/jhs/bin/public/mailname/mailname
 set args -N *
-------------------------------------------------------------------------------
xconfig
	cd /usr/ports/x11/xorg
	make config-recursive
	make install
	echo 'dbus_enable="YES"' >> /etc/rc.conf
	echo 'hald_enable="YES"' >> /etc/rc.conf
	service dbus start
	service hald start
	startx
-------------------------------------------------------------------------------
Xorg	gary uses with -listen  see man Xserver
-------------------------------------------------------------------------------
GDB
 cd /usr/src/usr.bin/make
 setenv CFLAGS "-g"
 make clean ; make cleandir ; make clean ; make ; make install
 limit coredumpsize unlimited
 cd /home/jhs/job/handout.crash
 make clean
 make
 gdb
   directory /usr/src/usr.bin/make
   core-file /home/jhs/job/handout.crash/make.core
   exec-file /usr/src/usr.bin/make/make
   symbol-file /usr/src/usr.bin/make/make
   run
   bt
 ----------
gdb
 gdb /path/to/Mosaic /path/to/core
 gdb cc1 core
 disasm
 gdb X386
 break exit /stop/abort
 run
 ========
 # gdb tab core.tab
 # set args -e data
 # exec-file tab
 # core-file tab.core
 # break exit /stop/abort
 # run
 <P><B>Generated Wed Dec 11 19:29:52 MET 1996 by
 <a href=Makefile>Makefile</a></B><P>
 <MENU>
 <li><a href=./Makefile>./Makefile</a><PRE>
 # ~jhs/public_html/syntax/Makefile by Julian H. Stacey
 </PRE>
 <li><a href=./adb>./adb</a><PRE>
 adb /gt/lft/etc/lfta [core]
 $c backtrace
 </PRE>
 <li><a href=./bash_example>./bash_example</a><PRE>
 ulimit -u 100; fvwm
 ---------
 </PRE>
 <li><a href=./bashrc_me>./bashrc_me</a><PRE>
 fahr() { calc -q "$1 * 1.8 + 32" ; }
 cels() { calc -q "x = config(\"display\", 2) ; ($1 - 32) / 1.8" ; }
 </PRE>
 <li><a href=./binhex>./binhex</a><PRE>
 echo How jhs converted a Content-Type: application/mac-binhex40
 echo for Helmut Eichler Apr 96
 </PRE>
 <li><a href=./csh>./csh</a><PRE>
 #!/bin/csh
 </PRE>
 <li><a href=./cshrc_from_usr_guest>./cshrc_from_usr_guest</a><PRE>
 # limit maxproc 100; fvwm
 </PRE>
 <li><a href=./cvs>./cvs</a><PRE>
 cd tmp
 cvs co -D4-Aug sys
 </PRE>
 <li><a href=./emacs>./emacs</a><PRE>
 ESC = 8 bit prefix
 ALT = Assert bit 8
 </PRE>
 <li><a href=./gdb>./gdb</a><PRE>
 gdb cc1 core
 disasm
 </PRE>
 <li><a href=./kgdb>./kgdb</a><PRE>
 > Rich's question about pointers for debugging the kernel made me try the
 > following, which works quite well if you have the kernel sources and enough
 </PRE>
 <li><a href=./netscape>./netscape</a><PRE>
 netscape -display tartufo:0.0 -remote 'openURL(www.company.com)'
 </PRE>
 <li><a href=./perl.showLinks.jkh>./perl.showLinks.jkh</a><PRE>
 #!/opt/gnu/bin/perl
 require 'find.pl';
 </PRE>
 <li><a href=./rz>./rz</a><PRE>
 rz -b < /dev/tty1 > /dev/tty1
 </PRE>
 <li><a href=./scsi>./scsi</a><PRE>
 Syntax example from joerg_wunsch@@uriah.heep.sax.de :
	scsi -f /dev/rsd0.ctl -r -t 5
 </PRE>
 <li><a href=./shar>./shar</a><PRE>
 echo run this script by saying sh this_file_name
 echo x - dtree.1
 </PRE>
 <li><a href=./sort>./sort</a><PRE>
 sort -n -t: +3 -4 /etc/passwd
	sort /etc/passwd by group no.
 </PRE>
 <li><a href=./sysctl>./sysctl</a><PRE>
 Syntax example from rgrimes@@gndrsh.aac.dev.com:
	sysctl -w net.inet.ip.forwarding=1
 </PRE>
 <li><a href=./vi>./vi</a><PRE>
 !}sort 	sort paragraph
 !)rev		reverse sentence
 </PRE>
 </MENU><HR></BODY></HTML>
-------------------------------------------------------------------------------
ifconfig rl0 alias 194.221.32.28 netmask 0xffffffff
-------------------------------------------------------------------------------
k3b
	ew @ 2004.06: app for kde but as a GUI it puts some of the WINdum
	stuff on the run. it is easier to make a image of a DVD
	first and then burn it, much faster.
-------------------------------------------------------------------------------
KDE: isn't like fvwm, there isn't just one configuration file. The configs
 are scattered around in various locations. What I do to start kde is call
 /usr/local/bin/startkde in my .xinitrc. startkde is a shell script and starts
 the most commonly needed elements. I suggest that you edit startkde to set
 the KDEDIR (/usr/local) variable and comment out kaudioserver (which is buggy
 and core dumps). Another thing which I did was to get rid o klock by making a
 symbolic from /usr/bin/false to /usr/local/bin/klock. klock doesn't understand
 our shadow password file and, if you accidentally invoke it, you can't log back
 in.
 Look in ~/.kde/share/config for some of the user-modifiable config files.
 These can also be managed using some KDE utitlity, but I don't know which
 one. I just edited them by hand. Ernst would probably know.
 Once the control panel is running (the bar at the bottom) you can click
 on the big "K" on the left, go up to applink and invoke kdehelp for an
 overview.
 Gary
	See also multimedia/k9copy-kde4/
-------------------------------------------------------------------------------
kermit
 PC kermit3.01:
	TERM=tset - vt102
	alt x or ctrl shift backslash goes to control mode
	alt h
-------------------------------------------------------------------------------
kgdb
 > Rich's question about pointers for debugging the kernel made me try the
 > following, which works quite well if you have the kernel sources and enough
 > swap space for a proper crash dump:
 >
 > Config you're kernel using config -g
 >
 > Remove ${STRIP} -x $@; from the Makefile for the kernel so it doesn't
 > get stripped.
 >
 > When the kernel's been built make a copy of it, say 386BSD.debug, and
 > then run strip -x on the original. Install the original as normal.
 >
 > Now, after a crash dump, go to /sys/compile/WHATEVER and run kgdb. From kgdb
 > do:
 >
 > symbol-file 386BSD.debug
 > exec-file /var/crash/system.0
 > core-file /var/crash/ram.0
 From freebsd.org!owner-freebsd-current Tue Jun 14 06:00:41 1994
 Date: Tue, 14 Jun 1994 05:51:42 +0200
 From: rich@@id.slip.bcm.tmc.edu (Rich Murphey)
 To: FreeBSD-current@@freebsd.org
 Reply-To: rich@@freebsd.org
 OK, thanks to Paul Richards and Garrett Wollman for all the info on
 debugging crash dumps.  Here's a rehash of their info from a novice
 perspective.
 To find out what is crashing your kernel, first install a kernel
 compiled with -g.  Make sure you have 'dump on ...'  as part of the
 configuration file (e.g. FOO) in order to enable crash dumps.
   cd /sys/i386/conf
   config -g FOO
   cd /sys/compile/FOO
   vi Makefile
 Change 'STRIP= strip' to 'STRIP= echo' at the head of the Makefile.
   make depend
   make
   mv /386bsd /386bsd~
   cp 386bsd /
   shutdown -r now
 Next, make sure you have as much free disk space in /var/crash as you
 have ram.  For example, if you have 16Mb of RAM in your PC, make sure
 the root partition has 16Mb free.  If it doesn't, but /usr does, then:
   cd /var
   rmdir crash
   mkdir /usr/crash
   ln -s /usr/crash .
 If you include 'pseudo-device ddb' (the kernel debugger) in your
 config file then upon a panic the kernel will drop into the debugger
 and print a prompt.  To get a core dump type:
   ddb> call boot(0x104)
 This will cause the the kernel to skip syncing the disk, save the
 crash dump and then reboot
   dumping to dev ..., offset ...
 If it doesn't, make sure your kenrel config file for 'dump on ...' as
 in the GENERICAH config file.
 When it reboots after panicing, the system saves the crash dump:
   checking for core dump...
   System went down at ...
 If it doesn't, then make sure that you don't have a /var/crash/minfree
 file, or if you do that this file doesn't specify more memory than you
 have in /var/crash.  See 'man savecore' for specifics.
 Now, after saving a crash dump, look in /var/crash for the most recent
 ram.* and system.* files.  Each time it saves a crash dump it will
 create another ram.* and system.* file starting with ram.0 and
 system.0.  To debug the crash dump type:
   cd /sys/compile/FOO
   kgdb
   symbol-file 386BSD.debug
   exec-file /var/crash/system.0
   core-file /var/crash/ram.0
 and it will respond with something similar to:
   IdlePTD 1b8000
   panic:
   current pcb at 1a7a54
   (kgdb)
 You can then use all the usual gdb commands to examine the kernel data.
 --  Rich
-------------------------------------------------------------------------------
kldload procfs
	mount_procfs /dev/procfs /proc
-------------------------------------------------------------------------------
# http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sound-setup.html
# man sound	# music
kldload snd_driver;	cat /dev/sndstat
kldstat
-------------------------------------------------------------------------------
ksh
 Find number of duplicate usernames in password file:
	#!/usr/local/bin/ksh
	VAR1=`awk -F: '{print $1}' /etc/passwd|grep -cx $1`
	print "Number of occurences of $1 in /etc/passwd: $VAR1"
-------------------------------------------------------------------------------
magicpoint
 mgp /usr/local/share/doc/mgp/sample/sample.mgp
 cd ~jhs/public_html/free/talk/faraday/presentations/source/1_intro_julian/\
  ; mgp newer/talk.mgp
-------------------------------------------------------------------------------
make world
	NO_CLEAN=yes build, don't relink binaries just because crt*.o changed
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
 My Procedure:
	echo "Backup"; cd / && xs make
	echo "Purging immutable flags in case upgrade fails,"
	echo "and we need to revert new content to old."
	xs chflags -R noschg /libexec /lib
	more /usr/src/UPDATING
	echo "Ensure host customisations are commented out,"
	echo "as they can disrupt make -j 1 buildworld."
	echo "Ensure these are files. not symbolic links:"
	ls -l /etc/src.conf /etc/make.conf
	echo "Ensure inclusion of host specific files is temporarily hashed out"
	grep "/site/domain/this/host/this/etc/src.conf"  /etc/src.conf
	grep "/site/domain/this/host/this/etc/make.conf" /etc/make.conf
	echo "These host specifics cause trouble to generic -j 1 buildworld:"
	grep SENDMAIL /site/domain/this/host/this/etc/src.conf \
		| grep -v ':#'
	grep KERNCONF /site/domain/this/host/this/etc/src.conf \
		| grep -v ':#'
	echo "Swap space may overflow on small machines if using CFLAGS+= -pipe"
	grep CFLAGS /etc/make.conf /etc/src.conf \
		/site/domain/this/host/this/etc/make.conf \
		/site/domain/this/host/this/etc/src.conf \
		| grep pipe | grep -v :#
	mv /etc/make.conf /etc/make.conf.MV; mv /etc/src.conf /etc/src.conf.MV
	echo "Purging environment variables that might disrupt"
	source `which unsetenv.csh` && printenv
	cd /usr/src
	ls -l *script*
	script
	  {
	  echo "make obj  I think probably un-necessary, makeworld does it."
	  date;touch buildworld.start;\
		xs nice make -B -j 1 buildworld;date;
		touch buildworld.stop		# 11h 42m @ Dec. 2020
	  date;touch buildkernel.start;\
		xs nice make	     -j 1 buildkernel;date;
		touch buildkernel.stop; 	#  1h 55m @ Dec. 2020
	  xs make installkernel
	  }
	xs reboot
	echo "Compare essentials for installworld"
	cd /usr/src
	xs mergemaster -p
	echo "Checking if /usr/obj may be a dangling symbolic link"
	( cd /usr/obj )
	echo "If above fails: cd / ; ls -l data/release/this"
	xs make installworld
	echo "If above fails, try xs make -B -j 1 installworld"
	xs reboot
	xs chflags -R noschg /*bin /boot /etc /lib* /rescue /usr/*bin \
		/usr/include /usr/lib* /usr/obj/* /usr/share /usr/src /var
	xs chown -R jhs:staff /usr/src /usr/src/* /usr/obj /usr/obj/*
	cd /usr/src
	echo "Looking for patched breakage"
	cd /usr/src ; find . -name Makefile.pre_jhs -o -name Makefile.orig
	grep '^WITHOUT_' /etc/src.conf /site/domain/this/host/this/etc/src.conf
	echo "Modules often break as not checked by make world"
	 (cd /usr/src/sys/modules ; make)
	mv typescript typescript.`date "+%Y-%m-%dT%H:%M:%S"`
	cd /usr/src
	xs chown -R jhs:staff /usr/src /usr/obj/*
	script
	  {
	  echo "http://www.berklix.com/~jhs/bin/.csh/customise"
	  customise `pwd`
		^D
	  }
	vi typescript
	mv typescript typescript.`date "+%Y-%m-%dT%H:%M:%S"`
	echo "Import my customisations"
	echo "Checking if generic will hang on src/lib/libgcc_s/"
	echo "At 2020-05-04 this is necessary (maybe now obsolete): \
	make all
	xs make install
	echo "Automaticaly install"
	echo -n "mergemaster -iF would have tried to rm /etc/rc.d/ "
	echo	"amd nsswitch so dont run till after customise & install"
	xs mergemaster -iF
	xs reboot
	cd /usr/src
	xs make delete-old
	echo "Customise must have been done before delete-old"
	xs ln -s -f ../../usr/local/bin/rlogin	/usr/bin/rlogin
	xs ln -s -f ../../usr/local/bin/rsh	/usr/bin/rsh
	xs ln -s -f ../../usr/local/sbin/rlogind	/usr/libexec/rlogind
	xs ln -s -f ../../usr/local/sbin/rshd	/usr/libexec/rshd
	echo "See if an old ctm that may not create sym links"
	ls -l /usr/sbin/ctm
	echo "Groff not tested"
	echo "/etc/namedb /var/named fixed I think by /site/domain/init"
	(cd /usr/src/libexec/ftpd && xs make install )
	(cd /usr/src/libexec/telnetd && xs make install)	# Not in src-14
	xs make delete-old-libs
	rsh main
	  cd /site ; xs make 2loc_all
	echo "Assert `hostname`.mc"
	xs vi -c/SENDMAIL_MC /site/domain/this/host/this/etc/src.conf
	echo "Assert `hostname -s| dd conv=ucase`.small"
	xs vi -c/KERNCONF /site/domain/this/host/this/etc/src.conf
	cd /sys/amd64/conf
	make links
	make
	config `hostname -s | dd conv=ucase`.small
	cd ../compile/`hostname -s | dd conv=ucase`.small
	make obj
	xs make cleandepend
	xs make depend
	xs make all
	xs make install
	xs reboot
	cd /usr/src
	echo "Avoid a break in /usr/src/lib/libgcc_s"
	ls -l /usr/lib/libc.a \
		/usr/obj/usr/src/amd64.amd64/lib/libc/libc.a*
	echo "Might need: \
		mv /usr/obj/usr/src/amd64.amd64/lib/libc/libc.a \
		/usr/obj/usr/src/amd64.amd64/lib/libc/libc.a.MV ; \
		cd /usr/src/lib/libc ; make \
		"
	echo "A make depend may also fix failing makes above"
	xs chown -R jhs:staff /usr/src /usr/obj/*
	echo backup
	make all
	cd /usr/src
	xs make install
	cd /etc/mail
	xs make restart
	date|mail -s "Updated: `uname -a`" root
	cd ~/public_html/src/bsd/fixes/FreeBSD/packages
		nice ./to_pkg_install.sh
	cd /usr/ports
	nice xs make -i BERKLIX_CLIENT=YES BERKLIX_SERVER=YES \
		BERKLIX_AMBITIOUS=YES fetch-recursive
	echo "Consider xargs for a quicker pkg install"
	(cd /var/cache/pkg && echo "Checked upgrade wont hang" ; du -s )
	xs pkg upgrade; xs pkg autoremove ; xs pkg check --dependencies
	echo "Dependencies"
	echo "Checksums (slow)"
	time xs pkg check -s -a # 36.155u 6.263s 25:24.92 2.7%	  2666+224k 69721+44io 284pf+0w
	echo "Consider cd / && make"
	echo "Listing missing packages:"
	pkg info -q | awk -F "-[0-9]" '{ print $1 }' > /tmp/pkg-info-q && \
	 diff -c ~/public_html/src/bsd/fixes/FreeBSD/packages/to_pkg_install \
	 /tmp/pkg-info-q | grep "^- "
	pkg info -q | wc -l	# 285
	more ~/public_html/src/bsd/fixes/FreeBSD/package/to_pkg_install.sh
	cd /usr/ports
	(cd ~/git/lapr/ports-cur/ports ; tar cf - . ) | tar xf -
	ln -s ../distfiles
	ln -s ../packages
	customise `pwd` CURRENT
 ------------------------------------------------------------------------------
 Below is a section of working Make syntax kept in case
 I want to paste something similar into an older make,
 but on bsd make of FreeBSD-12.3-Stable 2022-05-03
 It is replaceable with the short snippet from: /sys/modules/Makefile
 that uses the sophistication of a modern extended make:
  -----------------------------------------------------------------------------
  OLD
	.for reject in ${WITHOUT_MODULES}
	SUBDIR:= ${SUBDIR:N${reject}}
	.endfor
  -----------------------------------------------------------------------------
  NEW
	# To skip broken modules, list them in /etc/src.conf with eg:
	#	DUD_MODULES=random_fortuna random_other
	.if defined(DUD_MODULES)
	SUBDIR_DUD_TMP=
	SUBDIR != echo ${SUBDIR} | \
		( for s in `cat`; do \
			SUBADD=$$s ; \
			for d in ${DUD_MODULES} ; do \
				if [ $$s == $$d ] ; \
				then SUBADD="" ;  \
				fi; \
			done ; \
			SUBDIR_DUD_TMP="$${SUBDIR_DUD_TMP} $${SUBADD}" ; \
		done ; \
		echo "$${SUBDIR_DUD_TMP}" )
	.endif
  -----------------------------------------------------------------------------
-------------------------------------------------------------------------------
mformat
 fdformat -y /dev/fd0 ; mformat -s 80 -t 18 -h 2 a:
-------------------------------------------------------------------------------
mkisofs # http://www.berklix.com/~jhs/txt/dvd/mkisofs/
-------------------------------------------------------------------------------
mount Examples from SCO leaflet:
	DEC Unix 3.0	mount -t cdfs -o ro,noversion /dev/cddev cddir
	HP-UX 9.01	mount /dev/dsk/cddev cddir -r -t cdfs
	HP-UX 10.01	mount /dev/dsk/cddev cddir -r -F cdfs
	IBM AIX 3.2.5	mount -v cdfs -r /dev/cddev cddir
	SCO OpenServer5 mount -f HS -o ro,lower /dev/cddev cddir
	SCO UnixWare2.1 mount -F cdfs -r /dev/cdrom/cddev cddir
	SCO UnixWare2.1 mount -r -F cdfs `devattr cdrom|bdevice` /mnt
	SparcSolaris2.3 mount -F hsfs -o ro,nrr /dev/cddev cddir
	SparcSunOS4.1.2 mount -t hsfs -o ro,nrr /dev/cddev cddir
-------------------------------------------------------------------------------
mtree
  setenv DESTDIR /host/bla/usr/tmp/dist ; cd /usr/src/etc
  make distrib-dirs
  make distribution
  cd ~/public_html/src/bsd/jhs/etc ; make install
-------------------------------------------------------------------------------
ncftp
 This syntax (run on host=wind)
     ncftp ftp://ftp/public/FreeBSD/distfiles/bash-1.14.7.tar.gz
 will sometimes shorten or truncate bash-1.14.7.tar.gz
 the data is not delivered to CWD but is instead written back to /public,
 which is NFS mounted, to flip, hence race conditions determine if a file is
 truncated
-------------------------------------------------------------------------------
wget -r ftp://ftp.funet.fi/pub/misc/pc532
wget -r --no-check-certificates # for recursion
	# gj@ 2017-06:	wget (newer versions) always want to verify the
	# security certificate on the target host.  It does have the
	# --no-check-certificates option to get around that.
 Example of recursive tree fetch:
  http://stackoverflow.com/questions/113886/how-to-recursively-download-a-folder-via-ftp-on-linux
  wget --ask-password -rl 99 ftp://NAME@@HOST
-------------------------------------------------------------------------------
wpa_gui ports/net/wpa_supplicant_gui
-------------------------------------------------------------------------------
nmap -sS -sU -O     another_FreeBSD-4.n_server
nmap -sS -sU -O -P0 another_FreeBSD-4.n_server
-------------------------------------------------------------------------------
ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid -f /var/db/ntpd.drift
-------------------------------------------------------------------------------
nslookup
	set type=mx
	www.berklix.com

	dig has gone from src/usr.bin/dig in FreeBSD-10
	src/usr.bin/drill/ in FreeBSD-10
	nslookup & dig & host are all 3 installed by either of
	ports/dns/bind99 or ports/dns/bind-tools at 2013-10-12

	ill advised people removed bind from freebsd-10 src/ (use ports/)
	bind contains nslookup
	now look for: dig host drill
 http://www.tcpiputils.com/browse/ip-address/
-------------------------------------------------------------------------------
oo OpenOffice
oo
	.odp
		Click on F5 to start slide show.
		Click on slide for next slide or effect.
		Right click show little menu to go to previous slide or end show.
	An OO file is nothing but a zip archive of several XML files
		(which is what Unix "file" shows it as.
	oo even accepts if invoked as "oo slides.zip",
	but oo fails on "mkdir x; cd x;unzip ../slide.zip;oo"
-------------------------------------------------------------------------------
OCR
	ports/editors/AbiWord/
	ports/graphics/clara # ports/graphics/claraocr/ packages/claraocr-0.9.9_1.tgz	I gave up it
	ports/graphics/tesseract ive used it OK, even has German
	ports/graphics/gocr
-------------------------------------------------------------------------------
	use.perl
PERL.SHOWLINKS.JKH
 #!/opt/gnu/bin/perl
 require 'find.pl';
 # Usage: showLinks
 # This program displays all the existing soft-links in a directory tree,
 # in the form:
 #	file	link
 # (tab-separated)
 # This can be used in conjunction with makeLinks to change existing links
 # in a tree to point to a new location.
 # See makeLinks for details.
 # This program is generic.
 sub wanted {
    local($dev) = lstat($_);
    $prune = ($dev != $topdev);
    return unless (-l $_);
    print "$name\t", readlink($_), "\n";
 }
 if ($#ARGV < 0) {
    $dir = '.';
 } else {
    $dir = shift;
 }
 &find($dir);
 --------
 2017-07-23:
	/usr/ports/lang/perl5.24
	Installing perl5-5.24.2...
	The /usr/bin/perl symlink has been removed starting with Perl 5.20.
	For shebangs, you should either use:
	#!/usr/local/bin/perl
	or
	#!/usr/bin/env perl
cd /usr/ports/lang/perl5.20 ; make install
       The /usr/bin/perl symlink has been removed starting with Perl 5.20.
       For shebangs, you should either use:
       #!/usr/local/bin/perl
       or
       #!/usr/bin/env perl
       The first one will only work if you have a /usr/local/bin/perl,
       the second will work as long as perl is in PATH.
-------------------------------------------------------------------------------
pib	# /usr/ports/ports-mgmt/pib
	psearch
-------------------------------------------------------------------------------
pkg which /usr/local/lib/libX11.so.6
 pkg info libX11-1.6.2_2,1 | grep Origin
 cd /usr/ports/x11/libX11; make clean ; make install
 pkg check -a
 You can adjust pkg to use the quarterly ports by changing the pkg repo URL
 from pkg.FreeBSD.org/${ABI}/latest to pkg.FreeBSD.org/${ABI}/quarterly
 ----
 pkg search thing
 pkg fetch thing-53.0.3_1,1
 pkg install thing-53.0.3_1,1
 pkg install xorg-server
 pkg install xinit
 pkg install xorg
 pkg install fvwm2
 To ensure nothing lost in crashes & from fsck:
	pkg info -a | awk '{ print $1 }' > /tmp/paks
	foreach i ( `cat /tmp/paks` )
		pkg install -f -y $i
		end
 pkgsave
	Date: Tue, 04 May 2021 22:01:46 +0200
	To: TÄ³l## Coosemans <tijl @ freebsd.org>
	Cc: freebsd-ports @ freebsd.org
	-
	> Delete all those .pkgsave files.  These are backups created
	> by pkg when it has to install a file over an existing file.
	> It means a previous version of ghostscript wasn't deleted properly.
 pkg info -o /usr/local/bin/djpeg	OR
 cd /pub/FreeBSD/branches/12.2-RELEASE/ports && \
	find . -name pkg-plist	| xargs grep bin/djpeg
------------------------------------------------------------------------------
portupgrade -a --batch --keep-going
	# /usr/ports/ports-mgmt/portupgrade
-------------------------------------------------------------------------------
poudriere	/usr/ports/ports-mgmt/poudriere
	man poudriere
	TO TRY: cd /data/jail ; \
	poudriere jail -c -v head  -a amd64 -j 1amd64 -m file:///usr/svn/base/head
		Unknown method to create the jail

	poudriere jail -c -v head  -a amd64 -j 1amd64
		Failed to fetch from http://download.FreeBSD.org/ftp/releases/amd64/amd64/head/MANIFEST

	poudriere ports -c				# hangs on no net
		Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
		Fetching public key from ec2-eu-west-1.portsnap.freebsd.org... done.
		Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
		Fetching snapshot metadata... done.
		Fetching snapshot generated at Wed Jul 26 00:05:58 UTC 2017:
		1dc704757b14e2aaac4d3ca3b4cdd9ce8ce984ae0e4912 71% of	76 MB  669 kBps 00m31s

		Maybe created 1049592 K in /usr/local/poudriere/ports/default
-------------------------------------------------------------------------------
powerd	# sysctl -n dev.cpu.0.freq_levels
-------------------------------------------------------------------------------
ps
	see also lsof to list open files
-------------------------------------------------------------------------------
psearch
-------------------------------------------------------------------------------
Postfix
	From: "Ben C.O.Grimm" <Ben.Grimm@@wirehub.net>
	To: freebsd-isp@@FreeBSD.ORG
	Subject: Re: VIRUS WARNING
	Date: Thu, 04 May 2000 18:46:14 +0200

	For anyone using Postfix:
	in /etc/postfix/main.cf
		header_checks = regexp:/etc/postfix/love_access
	in /etc/postfix/love_access:
		/^Subject:.*ILOVEYOU/	REJECT
	Resulting message:
		May  4 18:12:15 smtp postfix/cleanup[36586]: warning: 2A645C1CB8:
		reject: header Subject: ILOVEYOU
-------------------------------------------------------------------------------
PPP Notes
 netgraph ppp modules  --used by mpd
 kernel async ppp --used by pppd
 kernel sync ppp (sppp) used by isdn and other sync stuff.
 USERLAND ppp (/usr/sbin/ppp) -- does it all outside the kernel.
-------------------------------------------------------------------------------
QMAIL
 Next line is an exact copy of .qmail-jhs-default on colin
 |preline -d /usr/bin/uux - -gC -a"${SENDER:-mailer-daemon@@muc.de}" jhs!rmail "($EXT2)"
-------------------------------------------------------------------------------
rdist
 See also rdist6 & rsync & ports/sysutils/cpdup & ports/net/unison (2 way)
 Notes 2006.05 from Symmetric-BSD-4.2 rdist:
	# Warning: if rdist reports:
	#	"no name for group 34" or "no password entry for uid 218"
	# the file does not get copied.
	# So create a dummy record in /etc/group or /etc/passwd
	# Warning: if rdist reports:
	#	/usr.external/src/genix/usr/nsc/sact: No such file or directory
	# the file does not get copied. Same for /usr//ucb/w
	# All seem to fail as link count > 1
	#    Retry with -i on command line & install line still doesnt fix it.
	# (On 2006 modern FreeBSD, it's still not ideal: there it does install,
	# but breaks hard links )
	# Warning: rdist does not install /dev/devices.
-------------------------------------------------------------------------------
rz
 rz -b < /dev/tty1 > /dev/tty1
-------------------------------------------------------------------------------
restore (example from Symmetric BSD-4.2)
 restore xf /home/jhs/tape/root_fs.dump
 Specify next volume #: 1
-------------------------------------------------------------------------------
rsync
 rsync rsync://ftp.freebsd.org/
 rsync -avrclHpt -v ftp.wherever.org::Docs .
 rsync -avrclHpt -v \
	--exclude=magazine \
	--exclude=historic \
	--exclude=standards/internet-drafts \
	--exclude=techreports \
	--delete-excluded \
	ftp.wherever.org::Docs .
 # internet-drafts valid for max 6 months, inappropriate to cite them other \
	than as "work in progress". http://www.ietf.org
 # equivalent of ~ftp/pub/comp/doc/
 # My Docs/standards/rfc has just 38M - why ?
 # http://www.rfc-editor.org/
 # http://tools.ietf.org/html/
 # ----
 rsync -avrclHpt ftp.wherever.org::DOS .
 # See Also ~/bin/.csh/netbsdrsync
 # See Also ~/bin/.csh/freebsdrsync
 rsync -avrclHpt ftp.wherever.org::Docs .
 rsync://bit0.us-west.freebsd.org/FreeBSD-bit/gnats/	#2012-12-23
 rsync -nHaxi bit0.us-west.freebsd.org::FreeBSD-mailarchive/	#2022-04-19 ultimate raw history archive of all freebsd mail since forever
-------------------------------------------------------------------------------
SCSI
 Syntax example from joerg_wunsch@@uriah.heep.sax.de :
	scsi -f /dev/rsd0.ctl -r -t 5
	probe SCSI target 5 when there's only sd0 already online
 scsi -f /dev/st1ctl.3 -r -t 3
 camcontrol stop da1
 To make sure you've got auto read and write reallocation turned on.
	camcontrol modepage -n da -u 0 -m 1 -P 3
 If AWRE and/or ARRE are set to 0, type this:
	camcontrol modepage -n da -u 0 -m 1 -P 3 -e
 And change the values to 1.  That will make sure that if possible,
 any future bad blocks will be automatically remapped.
-------------------------------------------------------------------------------
sendmail
	/etc/mail/access file, which you can set up your relay hosts in.
	It is simply a matter of adding your subnet(s) to the file.
		eg.
			127.0.0.1	RELAY
			203.54.200	RELAY
		Then:
			makmap hash access.db < access
			killall -1 sendmail
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Date: Thu, 04 May 2000 11:06:35 -0500
	From: Chris Cook <ccook@@tcworks.net>
	Cc: freebsd-isp@@FreeBSD.ORG
	Subject: Re: VIRUS WARNING

	Yes, and it will screw up a winblows system... here is a
	filter for your sendmail.cf file:

	## VIRUS CRAP ##

	HSubject:	$>Check_Subject
	D{MPat}ILOVEYOU
	D{MMsg}This message may contain the ILOVEYOU virus.

	SCheck_Subject
	R${MPat} $*	$#error $: 553 ${MMsg}
	RRe: ${MPat} $* $#error $: 553 ${MMsg}

	** MAKE SURE YOU PUT A TAB AFTER THE $* SIGNS **
	-----------------------------------
	How do I find sendmail's version number?
	telnet that.host 25
	or	echo \$Z | /usr/sbin/sendmail -bt -d0
-------------------------------------------------------------------------------
sh
	supports command-line editing.	``set -o emacs'' or ``set -o vi''
	#!/bin/sh			# ensure correct shell
	if [ ! $HOME ]; then
		echo "HOME Undefined"
	else
		echo "HOME Defined"
	fi
 set -ex			# shows each line executing
 set -e 			# ?
 _RELTARGET=${1:-doRELEASE}	# conditional assignment $1 or doRELEASE
 . script_name		# run that tfile And inherit set variables from it
 export TERM; TERM=`tset - $term`
 see /also /etc/rc
 if [ \( "X${ether_pccard}" != X"YES" \) -o \
	\( "X$1" != "X"ether_pccard \) ]; then
 fi
 if [ ! -f /tmp/.world_done ]; then
	echo yes it exists
 fi
 : examples of bourne shell syntax by jhs
 if  [ $OP_SYS_TYPE = "msdos" ] ;
 then echo "msdos" ;
 elif  [ $OP_SYS_TYPE = "unix" ] ;
 then echo "unix" ;
 else echo "unknown" ;
 fi
 for i in /etc/*
	do
	ls -l $i
	done
 : ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp"} # unwanted directories
 >/dev/null 2>&1	# from /etc/rc

 man sh: command1 2>&1 | command2
 so I guess to dump all output: 2>&1 > /dev/null
 ---------
 example of a shell function
 echo-en()
	{
	x="$*"
	echo -e "$x" | dd bs=$((${#x}-1)) count=1 2>/dev/null
	}
 {-------------------
 Hyphens in variables, Samples:
  /etc/defaults/rc.conf
	named_auto_forward=${named_auto_forward:-"NO"}
	named_chroot_autoupdate=${named_chroot_autoupdate:-"YES"}
  /usr/local/share/examples/dovecot/mkcert.sh
	OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}

 Hyphens In Variables
	In man sh, look after:
		Parameter Expansion
	at:
		${parameter:-word}
		Conditional operator
	Samples:	
	  /etc/root/.profile
		TERM=${TERM:-xterm}

	  /usr/local/etc/rc.d/shutmedia
		saslauthd_enable=${saslauthd_enable:-"NO"}
	
	  /home/jhs/public_html/scanjet/sjrun.sh/sjrun_till_2020-05-12.sh
		density=$(( $density + 1 ))
		density=${density#-} ;;
		density=${density%?}$key ;;
		density=-${density#-} ;;

	  /home/jhs/public_html/std/named.txt
		DISTNAME= ${PORTNAME}-${PORTVERSION:S/.a/a/}	# is this missing a : before - ?

	  /home/jhs/src/bsdboot/bsdboot.patch
		u=${USER-root}			# is this missing a : before - ?

	  /site/domain/berklix/host/slim/usr/local/share/examples/dovecot/mkcert.sh
		OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}	# is this missing a : before - ?
		SSLDIR=${SSLDIR-/etc/ssl}	# is this missing a : before - ?

	  /usr/local/lib/X11/xdm/Xsession
		for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"	# is this missing a : before - ?
-------------------------------------------------------------------------------
shar
 echo run this script by saying sh this_file_name
 echo x - dtree.1
 sed 's/^	//' > "dtree.1" << '//E*O*F dtree.1//'
	.TH DTREE l
	.SH NAME
	Originally written at St. Olaf College, Northfield, MN.
 //E*O*F dtree.1//
 echo x - dtree.c
 sed 's/^	//' > "dtree.c" << '//E*O*F dtree.c//'
	/*
	 *	DTREE - Print the tree structure of a directory
		return(ptr);
	}
 //E*O*F dtree.c//
 echo Possible errors detected by \'wc\' [hopefully none]:
 temp=/tmp/shar$$
 trap "rm -f $temp; exit" 0 1 2 3 15
 cat > $temp <<\!!!
      87     455    2507 dtree.1
     831    3183   21040 dtree.c
     918    3638   23547 total
 !!!
 wc  dtree.1 dtree.c | sed 's=[^ ]*/==' | diff -b $temp -
 exit 0
-------------------------------------------------------------------------------
slrn
 slrnpull -d /var/spool/slrnpull -h news.muc. de
 slrn -f /var/spool/slrn/newsgroups -d # gets descriptions
-------------------------------------------------------------------------------
sockstat -4l
	see which daemons are listening for connection requests on IPv4
-------------------------------------------------------------------------------
sort
 sort -n -t: +3 -4 /etc/passwd
	sort /etc/passwd by group no.
 sort -t : -k 3,1 -n /etc/master.passwd
-------------------------------------------------------------------------------
sftp
 sftp -o User=myname myhost.mydomain
-------------------------------------------------------------------------------
fetch of large files:
	mk@ 2019-03 used google drive to upload 900M .mp4 from android,
	((I couldnt use adb fetch from mk@ android over usb, though
	I can from jhs@ android)
	---
	lk@
	for presumably insecure large data transfers, this is useful:
	http://wetransfer.com/
	--
	drive & dropbox and MS onedrive.
	All work fine. I just like the simplicity of wetransfer. Send 2 GB of
	files to anyone with an email address.
 fortune prompt:
  Having trouble using fetch through a firewall? Try setting the environment
  variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details.

        In order to make fetch (the FreeBSD downloading tool) ask 
        for username/password when it encounters a password-protected
        web page, you can set the environment variable HTTP_AUTH
        to 'basic:*'.
-------------------------------------------------------------------------------
ssh
 For non Unix: http://the.earth.li/~sgtatham/putty/0.54/puttydoc.txt
 http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
 PuTTY is a free SSH, Telnet and Rlogin client for 32-bit Windows systems.
 ssh -t someone@@localhost /bin/sh
-------------------------------------------------------------------------------
ssh-keygen
 After changing domain name string in RSA1 ssh_host_key
	sshd failed to start, complaining:
		cipher_encrypt: bad plaintext length 339
	This *** line fixed it:
 Done by system install, presumably:
	ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key	***
	ssh-keygen -t rsa  -N "" -f /etc/ssh/ssh_host_rsa_key
	ssh-keygen -t dsa  -N "" -f /etc/ssh/ssh_host_dsa_key
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 cd ~/.ssh
 ssh-keygen -t dsa
 ssh-keygen -t ecdsa
 ssh-keygen -t ed25519
 ssh-keygen -t rsa
 ssh-keygen -t rsa1
 chmod 400 id_rsa id_dsa	# Secret, keep local
 cat ~/.ssh/id_dsa.pub | ssh remote_host "cat >> .ssh/authorized_keys"
	cat id_dsa.pub >> authorized_keys
	cat id_rsa.pub >> authorized_keys
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 On 8.2-RELEASE, if ~/.ssh is sym linked to an AMD host server, if AMD host
	/usr/sbin/sshd -d -d -d -D
 errors with eg:
	debug1: trying public key file /home/username/.ssh/authorized_keys
	debug1: fd 4 clearing O_NONBLOCK
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1/home/username/._dir/.DOTS/.ssh'
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1/home/username/._dir/.DOTS'
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1/home/username/._dir'
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1/home/username'
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1/home'
	Authentication refused: bad ownership or modes for directory /.amd_mnt/sshd_host/ad4s1/usr1/home
 ls -la /host/sshd_host/ad4s1/usr1/home
	drwxr-xr-x  18 bin     bin	512 Mar  6 11:56 ./
 chown root:wheel /ad4s1/usr1/home
 ssh host_using_symbolic_linked_dot_ssh
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1/home'
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1/usr1'
	debug3: secure_filename: checking \
	 '/.amd_mnt/sshd_host/ad4s1'
	Authentication refused: bad ownership or modes for directory \
		/.amd_mnt/sshd_host/ad4s1
 ls -la /host/sshd_host/ad4s1
	drwxr-xr-x   9 bin   bin    1024 Mar  7  2011 ./

If you see from sshd /var/log/auth.log on target hosts:
	sshd[1348]: Authentication refused: \
		bad ownership or modes for directory /
& ssh as a user fails but as root succeeds, then do this on target host:
	chown root:wheel /
-------------------------------------------------------------------------------
sysctl
	sysctl -a -d
	sysctl -w net.inet.ip.forwarding=1
	sysctl hw.acpi.battery.life		# percent remaining
	sysctl hw.acpi.battery.time		# remaining minutes
	sysctl hw.acpi.battery.state		# status
	sysctl hw.acpi.battery.info_expire	# seconds refreshed
	sysctl -a | grep battery
		# not on lapd as too old to have acpi I suppose
-------------------------------------------------------------------------------
swapon
 Host mini with 4.11 & swapinfo
	Device		1K-blocks     Used    Avail Capacity  Type
	/dev/ad0s1b	    32640     6340    26300    19%    Interleaved
 fails on
	cd /usr/src/lib/libc_r ; make
 with
	swap_pager: out of swap space
	swap_pager_getswapspace: failed
	/kernel: pid 94059 (ld), uid 0, was killed: out of swap space
 so
	cd /tmp ; dd if=/dev/zero count=200000 bs=10k of=SWAP ; chmod 600 SWAP
	if [ "$rel" = "4" ]; then
		vnconfig /dev/vn0c SWAP; swapon /dev/vn0c
	else	# }{ 5 or 6
		mdconfig -a -t vnode -f /var/SWAP; swapon /dev/md0
	fi	# }
 openoffice.org-2.0-devel Makefile says 2G to build so: bs=100k count=20000
 swapoff /dev/md0
 mdconfig -d -u 0
-------------------------------------------------------------------------------
tail
	tail for MS http://www.baremetalsoft.com/baretail/
-------------------------------------------------------------------------------
tar
	To produce a list of things to write onto succesive full 650M CDROMs:
	script
	cd big
	find . -type f | sort > ../list
	tar -c -f /dev/null -v -L 630000 -T ../list
	# note cannot use "-T -" as tar reads prompt for next media from pipe.
	cd .. ; vi typescript
	-------
	'".tar.gz" files ... can be unarchived by WinZip and Stuffit Expander.'
-------------------------------------------------------------------------------
tcpdump
 *before* you connect to MUC the next time start tcpdump like this
	tcpdump -vv -i isp<no> -w [filename]
 this will log the PPP negotiation stuff to [filename].
 After you're connected you can kill the tcpdump (I don't want to see all the
 traffic, just the PPP negotiation stuff).
 Then do ``tcpdump -r [filename] > [someotherfilename]''
 tcpdump -nA -s 0 port 25	# Monitor network for SMTP traffic:
-------------------------------------------------------------------------------
tiffrotate
 Only does a single sheet, truncates multi page files,
 so use tiffsplit before, & tiffcp after.
-------------------------------------------------------------------------------
Tethering a phone's 3G/4G as an ethernet connection
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-usb-tethering.html
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/userppp.html
 http://www.freebsd.org
	kldload if_urndis
	kldload cdce
 http://lists.freebsd.org/pipermail/freebsd-questions/2014-April/257731.html
	Urndis is not in Any FreeBSD release, including 9.2 or 10.0.
	Urndis is just in 9-stable & current.
	/pub/FreeBSD/branches/-current/src/
	/pub/FreeBSD/branches/9.0-stable/src/
		share/man/man4/urndis.4
		sys/dev/usb/net/if_urndis.c
		sys/dev/usb/net/if_urndisreg.h
		sys/modules/usb/urndis
-------------------------------------------------------------------------------
truss
	truss -p <pid> | grep "Resource temp"
-------------------------------------------------------------------------------
distfile tzupdater	(for openoffice)
	http://download.oracle.com/otn-pub/java/tzupdater/1.3.38/tzupdater-1_3_38-2011e.zip
	Click on the link to download the latest version and change the URL a little to download the version you want.
	Or remove TZ from  java/diablo-jdk16 make config
-------------------------------------------------------------------------------
unrm	see http://www.porcupine.org/forensics/tct.html
	The Coroner's Toolkit (TCT)
	/usr4/ftp/public/sites/www.porcupine.org/forensics/
-------------------------------------------------------------------------------
/usr/local/bin/ungoogled-chromium
	chrome://ungoogled-first-run
	chrome://flags 
-------------------------------------------------------------------------------
UTF
	Want to strip UTF-8 BOM(Byte Order Mark) from given files?
	sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile
-------------------------------------------------------------------------------
Versions
	OSVERSION is calculated by using awk to get the value of
	__FreeBSD_version from /usr/src/sys/sys/param.h
	UNAME_r is gotten by running "uname -r".
		./etc/csh.cshrc.master
		./lib/libc/gen/__xuname.c
		./lib/libc/gen/uname.3
		./release/release.sh
		./usr.sbin/freebsd-update/freebsd-update.sh
  Grep 13.0-CURRENT | sort
  vi Makefile.inc1				#
  vi sys/kern/uipc_ktls.c			# Not in 12-stable, just 13
  vi usr.sbin/freebsd-update/freebsd-update.8	#
  vi lib/libc/Versions.def			# all the same in 12-stable & 13:
  vi lib/libsbuf/Version.def			# all the same in 12-stable & 13:
-------------------------------------------------------------------------------
VirtualBox
VMWare
-------------------------------------------------------------------------------
vi
 !}sort 	sort paragraph
 !)rev		reverse sentence
nvi
 You can open up a new split-screen window in (n)vi with :N or :E and then
 use ^w to switch between the two.
-------------------------------------------------------------------------------
vidcontrol
	vidcontrol -f 8x8 iso-8x8.fnt VGA_80x60 < /dev/ttyv3
-------------------------------------------------------------------------------
vmstat -i Report on the number of interrupts taken by each device since
	 system startup.
	handy for isa card analysis
vmstat -o | awk '$7 == "sw" { print $0 }'
-------------------------------------------------------------------------------
vnconfig
	vnconfig - s labels /dev/vn...
	before mounting a file that has no FreeBSD label on that partition
-------------------------------------------------------------------------------
vobcopy 	# http://www.berklix.com/~jhs/txt/dvd/vobcopy/
-------------------------------------------------------------------------------
whois
  whois -r np17 	# but not	whois np17
  whois berklix.com
  whois -h whois.networksolutions.com \!BSD108-HST
  whois forcefive.de
  whois -h whois.totalregistrations.com  berklix.com
  http://whois.arin.net/rest/net/NET-162-144-0-0-1 # testing 162.144.42.220
		Class A 0-127, B 128-191 C 192-223
		slim 94.185.90.68
		land 144.76.10.75
  http://whois.arin.net/rest/net/NET-94-0-0-0-1
  http://whois.arin.net/rest/net/NET-144-76-0-0-1
  http://apps.db.ripe.net/search/query.html
-------------------------------------------------------------------------------
webcams
	/usr/ports/devel/linux-kmod-compat
-------------------------------------------------------------------------------
WORD
	editors/
	textproc/catdoc
	textproc/word2x  # from MS Word to text, HTML or LaTeX
-------------------------------------------------------------------------------
latex
	gary used lyx
	see also xdvi
-------------------------------------------------------------------------------
lxdvdrip
	Some DVDs have 10 or 20 entries which look like a film,
	based on size.	But only one is correct.  Generally, vlc
	will find the correct one and one can then rip it using
	lxdvdrip. Sometimes that fails.  Then record it with vlc.
	its not in 12.3 ports/multimedia/lxdvdrip
	is in /9-RELEASE/usr/local/bin/lxdvdrip
	runs ok on 12.3 from /9
-------------------------------------------------------------------------------
 Re. /usr/ports/print/latex by Andreas Klemm:
	Wesentlich umfassender und bedienungsfreundlicher ist teTeX
	von Thomas Esser.
-------------------------------------------------------------------------------
xfig:
  http://lists.freebsd.org/pipermail/freebsd-ports/2018-April/113127.html
    Reccomendation for a building architecture schematic diagram
    editor, please ? .. Only port I can think of is xfig
  http://lists.freebsd.org/pipermail/freebsd-ports/2018-May/113267.html

	Thanks to all respondents. Summary since:

	Probably best for my purpose
	 /usr/ports/cad/sweethome3d
		make package builds on 12.0-CURRENT & 9.2-RELEASE,
		make package-recursive breaks, ** To be retried later.
		Supports MS users & use live on web too.
		http://www.sweethome3d.com
		Mouse clicks can set to metric.

	Possibly:
	  /usr/ports/cad/librecad
	    make install OK on 12.0-CURRENT & 9.2-RELEASE
	    make package failed on 12.0-CURRENT,
	    RUNNING unsetenv NOCLEANDEPENDS make clean make package-recursive
	    Mouse:
	      Failed from 9.2-RELEASE X display host to remote
	      12.0-CURRENT librecad host.  Mouse OK on 9.2-RELEASE
	      with local screen & librecad.
	    http://librecad.org/
		a free Open Source CAD application for Windows, Apple and Linux.
	    Supports MS users too

	Other Like Xfig, useable but perhaps not ideal for requirement :
	  /usr/ports/graphics/xfig

	  /usr/ports/graphics/dia
	    make package OK on 12.0-CURRENT
	    No units to set to metric or imperial.

	  /usr/ports/graphics/tgif
	    make package OK
	    Like xfig.
	    Mouse switch to metric grid.

	Broken on my 12.0-CURRENT & 9.2-RELEASE hosts
	  /usr/ports/cad/brlcad
	    http://www.brlcad.org/
	    On 9.2-RELEASE Running unsetenv NOCLEANDEPENDS; make clean; make
		patched Makefile from Owen

	/usr/ports/cad/freecad	# lj@ rec.
		ABANDONED-BY-JHS 2018-05-03:
		breaks on dep. math/vtk6
		 even  unsetenv NOCLEANDEPENDS fails to make clean; make

	pkg search cad
-------------------------------------------------------------------------------
xmbmon -A -clvc darkgreen -cltcs purple
	# the colours are cos the defaults are unreadable.
-------------------------------------------------------------------------------
CPU temperatures
	kldstat -v | grep temp #  cpu/coretemp hostb/amdtemp
 sysctl -a | grep temp | grep dev.cpu | grep C | sort | grep tjmax;\
 sysctl -a | grep temp | grep dev.cpu | grep C | sort | grep -v tjmax
 ps -laxww | grep powerd
	blak:
		/usr/sbin/powerd
		dev.cpu.0.coretemp.tjmax: 85.0C
		dev.cpu.1.coretemp.tjmax: 85.0C
		dev.cpu.0.temperature: 33.0C
		dev.cpu.1.temperature: 32.0C
		2019-06-12 Ambient office 25.5, no load, powerd on no params:
		 dev.cpu.0.coretemp.tjmax: 85.0C
		 dev.cpu.1.coretemp.tjmax: 85.0C
		 dev.cpu.0.temperature: 32.0C
		 dev.cpu.1.temperature: 32.0C
	fire:
		powerd not runnning
		dev.cpu.0.temperature: 60.0C
		Hoovered inside, cpu fins improved, ideally should
		have unsrewed CPU fan, but couldnt be bothered to
		hold box upside down to avoid aluminium burrs droping
		on PCB, so did not unscrew
		dev.cpu.0.temperature: 56.0C
		2019-06-12 Ambient office 25.5, no load, no powerd:
		 dev.cpu.0.temperature: 63.0C
	laph 8.2:
		dev.cpu.0.temperature: 57.0C
		dev.cpu.1.temperature: 57.0C
		/usr/sbin/powerd -a minimum -b minimum -n minimum
		Hoovered outside, all air holes, measured few mins after boot:
		 dev.cpu.0.temperature: 57.0C
		 dev.cpu.1.temperature: 57.0C
		No cooler !
		sysctl hw.acpi.thermal.tz0.temperature
		hw.acpi.thermal.tz0.temperature: 67.0C
		sysctl -a | grep temper
		 hw.acpi.thermal.tz0.temperature: 67.0C
		 dev.cpu.0.temperature: 56.0C
		 dev.cpu.1.temperature: 57.0C
		 dev.acpi_hp.0.hdd_temperature: 4
	lapr s1=13.0-CURRENT:? s2=12.0-stable:No s3=9.3-RELEASE:? \
			s4=11.2-RELEASE:?
		dev.cpu.0.coretemp.tjmax: 90.0C
		dev.cpu.1.coretemp.tjmax: 90.0C
		dev.cpu.2.coretemp.tjmax: 90.0C
		dev.cpu.3.coretemp.tjmax: 90.0C
		dev.cpu.0.temperature: 60.0C
		dev.cpu.1.temperature: 60.0C
		dev.cpu.2.temperature: 60.0C
		dev.cpu.3.temperature: 59.0C
		Hoovered outside, all air holes, measured few mins after boot:
		dev.cpu.0.temperature: 46.0C
		dev.cpu.1.temperature: 46.0C
		dev.cpu.2.temperature: 47.0C
		dev.cpu.3.temperature: 47.0C
		2019-06-12 Ambient office 24.7, no load, powerd -a \
			 hiadaptive -b minimum -n minimum:
		 dev.cpu.0.temperature: 58.0C
		 dev.cpu.1.temperature: 58.0C
		 dev.cpu.2.temperature: 56.0C
		 dev.cpu.3.temperature: 56.0C
-------------------------------------------------------------------------------
xmms	Play List Editor icons are too small in 1600x1200 so here:
 Use also: audacious
		Misc
 URL		All		Inv Sel 	Sort List	New List
 Dir		Crop		Sel Zero	File Inf	Save List
 File + 	File -		Sel All 	Misc Opt	Load List
 cd ~/av/music/xtra/speach/bbc/httrack/bbc/downloads.bbc.co.uk/podcasts ; \
	find . -newermt '2 days ago' -name \*.mp3 \
		-exec filesize -i -p 1000000 -= {} \; \
		| sort | xargs ls -l > ~/av/music/listen
-------------------------------------------------------------------------------
xset b off
	turns bell off in X (useful for vi)
	similar to
		kbdcontrol -b off
		-b visual
	or Hack the sysbeep() function in sys/i386/isa/clock.c
	xset fp+ /usr/local/lib/X11/fonts/mozilla ; xset fp rehash
	xset dpms force standby # turn off the backlight
-------------------------------------------------------------------------------
X -query 10.250.1.15
-------------------------------------------------------------------------------
xauth
  For xterm or browser running on a remote host using local display,
  assume 2nd login name is `whoami`-hv :
   echo "Listing display keys:"
     xauth list | grep `hostname`
   echo "Extracting display keys:"
     xauth extract /tmp/.xauth.keys.`whoami`.tmp `hostname`:0
   echo "Saving display name:"
     echo "`hostname``printenv DISPLAY`" > /tmp/.xauth.name.`whoami`.tmp
   echo "Making keys & name remote accesibles"
     chmod a+r	   /tmp/.xauth.*.`whoami`.tmp
     ln /tmp/.xauth.keys.`whoami`.tmp /tmp/.xauth.keys.`whoami`-hv.tmp
     ln /tmp/.xauth.name.`whoami`.tmp /tmp/.xauth.name.`whoami`-hv.tmp
     (sleep 180; rm /tmp/.xauth.*.`whoami`.tmp /tmp/.xauth.*.`whoami`-hv.tmp)&
   echo "Within an xterm, Going remote, with one of:"
     rlogin localhost -l `whoami`
     rlogin localhost -l `whoami`-hv
     rlogin user      -l `whoami`
     rlogin user      -l `whoami`-hv
     ssh	      -l `whoami`    localhost
     ssh	      -l `whoami`-hv localhost
     ssh	      -l `whoami`    user
     ssh	      -l `whoami`-hv user
   Select One Of:
   echo "Importing keys If same host as display, just a new *-hv login:"
     xauth merge	   /tmp/.xauth.keys.`whoami | sed -e s/-hv//`.tmp
     # printenv DISPLAY # localhost:0
     setenv DISPLAY `hostname`:0
   echo "Importing keys If remote host, same non *-hv login name:"
     xauth merge /host/user/tmp/.xauth.keys.jhs.tmp; \
     setenv WHO `whoami`
     setenv DISPLAY `cat /host/user/tmp/.xauth.name.$WHO.tmp`
     unsetenv WHO
   echo "Importing keys If remote host, login name `whoami`-hv:"
     xauth merge /host/user/tmp/.xauth.keys.`whoami`.tmp
     setenv WHO `whoami`
     setenv DISPLAY `cat /host/user/tmp/.xauth.name.$WHO.tmp`
     unsetenv WHO
   firefox-clean &
   chrome &
-------------------------------------------------------------------------------
firefox about:config
firefox about:memory
	## sftp://
	Only sftp access using public key authentication works. To easily
	setup public key authentication to `remote_host`:
	 $ ssh-keygen
	 $ cat ~/.ssh/id_rsa.pub | ssh remote_host "cat >> .ssh/authorized_keys"
-------------------------------------------------------------------------------
xine	ports/multimedia/xine
	64K sound saves 200M, better used on video quality
	rip 20 mins, transcode 3 hrs
	----------
	* Make sure you've enough shared memory, the xine FAQ  *
	* advises to have the following sysctl settings:       *
	* kern.ipc.shmmax=67108864			       *
	* kern.ipc.shmall=32768 			       *
	* To suppress many xitk warnings, please put following *
	* setting in ~/.xitkrc. 			       *
	* feature.shm = 0				       *
-------------------------------------------------------------------------------
xsetroot -bg default
-------------------------------------------------------------------------------
 root is needed
sane-find-scanner -q
 See also usbconfig show_ifdrv 
-------------------------------------------------------------------------------
scanimage:
  sh SANE_DEBUG_PLUSTEK=127 scanimage -x200 -y 5  > out.pnm 2> log
	creates a lot of debug files in cwd.
  scanimage -T --device-name=plustek:libusb:001:005
  cd public_html/tmp/epson_perfection_1260/scanimage/2-small/files
  sh SANE_DEBUG_PLUSTEK=127 scanimage --depth 8 -x200 -y 5  > out.pnm 2> log
  cd public_html/tmp/epson_perfection_1260/scanimage/3-small/files
  sh SANE_DEBUG_PLUSTEK=127 scanimage --depth 8 --buffer-size=8
	-x200 -y 5  > out.pnm 2> log
  cd public_html/tmp/epson_perfection_1260/scanimage/4-small/files
  SANE_DEBUG_PLUSTEK=127 scanimage --depth 8 --buffer-size=8 -x200 -y 5 \
	--mode Lineart > out.pnm 2> log
  cd public_html/tmp/epson_perfection_1260/scanimage/5-small/files
  SANE_DEBUG_PLUSTEK=127 scanimage --depth 8 --buffer-size=8 -x250 -y150 \
	--mode Lineart > out.pnm 2> log
  cd public_html/tmp/epson_perfection_1260/scanimage/6-small/files
  SANE_DEBUG_PLUSTEK=127 scanimage --depth 8 --buffer-size=8 -x250 -y150 \
	--mode Lineart --resolution 300 > out.pnm 2> log
-------------------------------------------------------------------------------
xv	See also exif
 make a picture your X background with
	xv -root -max -quit bsdback.jpg
 Problem: Heavy Memory usage on large pictures.:
	Scanning with xsane, (but without xsaned)
	with an Epson Perfection 1260 at max resolution
	(of ... X ... )
	xv seems to want as much swap as input file, ie 1.7G,
	I added more swap:
		if=/dev/null of=/usr1/SWAP bs=1m seek=3999 count=1
		mdconfig -a -t vnode -f /usr1/SWAP; swapon /dev/md0
 Problem
	very slow, if scanner has just a USB1 interface,
 Problem
	xsane crashed frequently (probably ran out of swap),
	which produced numerous 1.7 G images in /usr1/tmp, often truncated,
	which soon used all disk,
	(& the massive swap usage & disk IO disrupted devd adding
	other external usb disks.)
 Rotate & Crop of a .ppm both lose masses of quality.
	After rotate, storing reduces from 1.7G to 3M though I
	didn't tell it to reduce quality
	File command shows no difference before or after though,
	always reports: 'Netpbm PPM "rawbits" image data'
	Before rotating 1,7G
		Format: 	PPM raw format (1.7G)
		Resolution:		20312 x 28056
		Expansion:		4.2783 x 4.2772 ( 869 x 1200)
	After rotating:
		Format: 	PPM raw format (2.5M)
		Resolution:		1114 x 757
		Expansion:		100% x 100% (1114 x 757)
 Rotate (180 = 2 x 90) of .jpg loses more size than left/right flip + \
	up/down flip
  With an X screen with xdpyinfo dimensions 1280x960
	3049086 Orig/20150331_174317.jpg 4128 x 2322, \
		expansion 31% (1280 x 720)
	 656885 flip/20150331_174317.jpg 1280x720
	 451023 rota/20150331_174317.jpg  960x540
  With an X screen with xdpyinfo dimensions 1680x1050
	1093149 flip/20150331_174317.jpg  1680x945
	 525076 rota/20150331_174317.jpg  1050x591
-------------------------------------------------------------------------------
xsane: /usr/ports/graphics/xsane
  - If you scan text & want it crisp, better & less bytes,
    click Lineart, not Gray
  - If you have a sheet with embedded text & graphs/ diagrams,
    you will need Gray
  - If you scan for use with OCR, use lineart for better quality OCR
  - If you set an initial file name of eg 0000.tiff it will autoincrement,
    convenient for a doc.
  - The viewer starts on Fullsize, normally set it to DIN A4 port.
	The portrait/landscape selector is Not to do with the image on paper
	to be scanned !  I believe it's to do with if physical scanner runs
	along length of paper, or across width of paper.  I've come to grief
	with landscape, it chopped images.
	Even my landscape images I scan as Portrait, then rotate.
  - http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix.mk
    http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk
	a raft of graphics conversion make macro tools allowing one to eg
	scan a .tiff then type eg
		make p-eye_inside_300dpi_monochrome.txt
		make p-eye_inside_300dpi_monochrome.txt_g	# for umlauts
	support for landscape is incomplete in some rules, diffs welcome
	caution the file contain some evil 8 bit.
  - put a weight on scanner lid if you have a rumpled / folded sheet
  - if double sided printing, & especially with thin paper,
    best use a backing sheet of uniform black so the reverse image
    doesnt pollute. Especially if the tiff will then be used for OCR.
  - Beware (seperate) /usr/ports/graphics/xv editor
	will always trash resolution down to screen resolution,
	(I sometimes have low res, like now with laptop connected to big
	external. screen via vga cable:  xdpyinfo | grep -i dimens
		dimensions:    1024x768 pixels (271x203 millimeters)
	so beter to use some other graphics tool, or if someone
	mails you some upside down jpg image, if you use XV, better
	click left-right & up-down arrows rather than than two
	clicks of rotate 90.
-------------------------------------------------------------------------------
Setup two graphic boards on the same computer, running 2 displays:
	X :0.0 & ; fvwm -display 0:0.0 & ; X :1.0 & ; fvwm -display 0:1.0 &
-------------------------------------------------------------------------------
 cd /usr/ports; make search key=netboot
-------------------------------------------------------------------------------
To build /usr/libexec/ld.so for netscape:
	cd /usr/src/lib/compat ; make -DRELEASEDIR install
	netscape
		/usr/libexec/ld.so: warning: /usr/lib/libg++.so.4: \
		minor version -1 older than expected 0, using it anyway
		ld.so failed: bad magic number in "/usr/lib/libg++.so.4"
	echo ldconfig as per /etc/rc or simply reboot to reindex the libraries
-------------------------------------------------------------------------------
6.4 ports/emulators/linux_base-fc4:
Running linux ldconfig...
To make use of NIS you have to adjust yp.conf and nsswitch.conf in
/compat/linux/etc/ accordingly. For example:
Set your yp-server and yp-domainname in yp.conf:
	domainname	my.yp.domainname
	ypserver	my.yp.server
Let your lists for hosts, passwd and group be resolved via nsswitch.conf:
	passwd: files nis
	shadow: files nis
	group:	files nis
	hosts:	files dns nis
-------------------------------------------------------------------------------
ptys number open:
	fstat | awk '{print $8}' | egrep 'tty[pqrsPQRS]' | sort -u | wc -l
-------------------------------------------------------------------------------
boot0cfg(8) to repair Master Boot Record
-------------------------------------------------------------------------------
galactic build:
	mergemaster -p
	nice make -j 1 buildworld
	make kernel KERNCONF=your_kernel_conf_name
	reboot new kernel in single-user mode
	fsck -p
	mount -a -t ufs
	cd /usr/src
	make installworld
	mergemaster -i
	exit (to multi-user mode)
-------------------------------------------------------------------------------
alias zappar='vlc http://zappateers.oblivion-software.de:8000/listen.pls&'
-------------------------------------------------------------------------------
ZIP Drive
	http://www.freebsd.org/doc/en_US.ISO8859-1/articles/zip-drive/x88.html
	mount_msdos /dev/afd0s4 /mnt
-------------------------------------------------------------------------------
git
	http://www.berklix.com/~jhs/bin/.sh/git-pull.sh
	cd /usr/git/src-cur/src ; git log a67b925ff3e5 
	http://docs.freebsd.org/en/articles/committers-guide/#git-primer
-------------------------------------------------------------------------------
gmplayer
 cd ~/.mplayer && \
 ln -s	/usr/local/lib/X11/fonts/bitstream-vera/Vera.ttf subfont.ttf
 # to avoid an error box
-------------------------------------------------------------------------------
gnats on freebsd.org:
	Use a subject like:	Re: 50736: ports/mail/something
	Or			Re: ports/50736: ports/mail/something
	Not like		Re: ports/mail/something
else it creates a new PR.
-------------------------------------------------------------------------------
pdf doc viewing notes,
	Canon Digital camera IXUS II sold in UK is known as PowerShot SD100
	in USA. Their web says:
		"Please use Adobe Reader 6.0 or later to browse
		this PDF file. If you use Adobe Acrobat Reader
		5.x, a digital watermark "COPY" will appear behind
		the text on your monitor. Or if you use Adobe
		Acrobat Reader 4.x or earlier, it will be impossible
		to open the PDF file.  - When printing this file,
		the digital watermark "COPY" will be printed on
		each page."
	FreeBSD-5.3-release on amd64
	/usr/ports/graphics/kdegraphics3
		kpdf		wants dcopserver, then doesnt display properly
	/usr/ports/graphics/gpdf
		Does Not display properly.
	/usr/ports/print/acrobatviewer
		On amd64, build reports: jre-1.1.8 is only for i386
	/usr/ports/print/ghostview
		Does Not display properly.
	/usr/ports/print/gv
		DISPLAYS OK (albeit with "Copy" faintly behind.
	/usr/ports/print/mgv
		Cant even open file
	/usr/ports/print/p5-Text-PDF	A PDF manipulation module
		pdfbklt.plx Fails reading.
	/usr/ports/textproc/pdftohtml
		Error: PDF version 1.5 -- xpdf supports version 1.4
			(continuing anyway)
		Error: Copying of text from this document is not allowed.
	/usr/ports/print/pdftk
		A simple tool for doing everyday things with PDF document
		Bus errors in stage2
	/usr/ports/graphics/zathura
		PDF viewer based on the poppler rendering library
	/usr/ports/www/firefox	(FreeBSD-9.2)
		fails on what file shows as
			"ct600-original.pdf PDF document, version 1.7"
		renders OK on what file shows as:
			"statutoryaccounts-1_5.pdf PDF document, version 1.5"
	graphics/xpdf	(FreeBSD-9.2)
		fails (showing Please Wait..) on what file shows as
			"ct600-original.pdf PDF document, version 1.7"
		renders OK on what file shows as
			"statutoryaccounts-1_5.pdf PDF document, version 1.5"
	editors/libreoffice also fails on ct600-original.pdf version 1.7
			showing Please Wait
	mupdf gj@ 20232-12 can display both EPUB and PDF!
	It's now my default for reading these formats. it can't print
-------------------------------------------------------------------------------
camera file names ( maybe should be upper case):
	"Canon Digital Ixus II" generates names such as img_0007.jpg
	"Fuji Finepix 2800 Zoom" generates names such as dscf0024.jpg
-----
USB Stick partitioning:
fdisk -u da0
	******* Working on device /dev/da0 *******
	parameters extracted from in-core bsdlabel are:
	cylinders=488 heads=32 sectors/track=32 (1024 blks/cyl)

	parameters to be used for BIOS calculations are:
	cylinders=488 heads=32 sectors/track=32 (1024 blks/cyl)

	Do you want to change our idea of what BIOS thinks ? [n]
	Media sector size is 512
	Warning: BIOS sector numbering starts with sector 1
	Information from DOS bootblock is:
	The data for partition 1 is:
	sysid 6,(Primary 'big' DOS (> 32MB))
	    start 32, size 499680 (243 Meg), flag 80 (active)
		beg: cyl 0/ head 1/ sector 1
		end: cyl 487/ head 31/ sector 32
	Do you want to change it? [n] y
	Supply a decimal value for "sysid (165=FreeBSD)" [6] 6
	Supply a decimal value for "start" [32]
	Supply a decimal value for "size" [499680] 262144
	Explicitly specify beg/end address ? [n]
	sysid 6,(Primary 'big' DOS (> 32MB))
	    start 32, size 262144 (128 Meg), flag 80 (active)
		beg: cyl 0/ head 1/ sector 1
		end: cyl 256/ head 0/ sector 32
	Are we happy with this entry? [n]
	Supply a decimal value for "sysid (165=FreeBSD)" [6] 6
	Supply a decimal value for "start" [32]
	Supply a decimal value for "size" [262144] 262143
	fdisk: WARNING: partition does not end on a cylinder boundary
	fdisk: WARNING: this may confuse the BIOS or some operating systems
	Correct this automatically? [n]
	Explicitly specify beg/end address ? [n]
	sysid 6,(Primary 'big' DOS (> 32MB))
	    start 32, size 262143 (127 Meg), flag 80 (active)
		beg: cyl 0/ head 1/ sector 1
		end: cyl 256/ head 0/ sector 31
	Are we happy with this entry? [n]
	Supply a decimal value for "sysid (165=FreeBSD)" [6]
	Supply a decimal value for "start" [32]
	Supply a decimal value for "size" [262143] 262144
	Explicitly specify beg/end address ? [n]
	sysid 6,(Primary 'big' DOS (> 32MB))
	    start 32, size 262144 (128 Meg), flag 80 (active)
		beg: cyl 0/ head 1/ sector 1
		end: cyl 256/ head 0/ sector 32
	Are we happy with this entry? [n] y
	The data for partition 2 is:
	<UNUSED>
	Do you want to change it? [n] y
	Supply a decimal value for "sysid (165=FreeBSD)" [0] 165
	Supply a decimal value for "start" [0] 262145
	Supply a decimal value for "size" [0] 237536
	fdisk: WARNING: partition does not start on a head boundary
	fdisk: WARNING: partition does not end on a cylinder boundary
	fdisk: WARNING: this may confuse the BIOS or some operating systems
	Correct this automatically? [n]
	Explicitly specify beg/end address ? [n]
	sysid 165,(FreeBSD/NetBSD/386BSD)
	    start 262145, size 237536 (115 Meg), flag 0
		beg: cyl 256/ head 0/ sector 2
		end: cyl 487/ head 31/ sector 1
	Are we happy with this entry? [n]
	Supply a decimal value for "sysid (165=FreeBSD)" [165]
	Supply a decimal value for "start" [262145] 262144
	Supply a decimal value for "size" [237536]
	Explicitly specify beg/end address ? [n]
	sysid 165,(FreeBSD/NetBSD/386BSD)
	    start 262144, size 237536 (115 Meg), flag 0
		beg: cyl 256/ head 0/ sector 1
		end: cyl 487/ head 30/ sector 32
	Are we happy with this entry? [n] y
	The data for partition 3 is:
	<UNUSED>
	Do you want to change it? [n]
	The data for partition 4 is:
	<UNUSED>
	Do you want to change it? [n]
	Partition 1 is marked active
	Do you want to change the active partition? [n]

	We haven't changed the partition table yet.  This is your last chance.
	parameters extracted from in-core bsdlabel are:
	cylinders=488 heads=32 sectors/track=32 (1024 blks/cyl)

	parameters to be used for BIOS calculations are:
	cylinders=488 heads=32 sectors/track=32 (1024 blks/cyl)

	Information from DOS bootblock is:
	1: sysid 6,(Primary 'big' DOS (> 32MB))
	    start 32, size 262144 (128 Meg), flag 80 (active)
		beg: cyl 0/ head 1/ sector 1
		end: cyl 256/ head 0/ sector 32
	2: sysid 165,(FreeBSD/NetBSD/386BSD)
	    start 262144, size 237536 (115 Meg), flag 0
		beg: cyl 256/ head 0/ sector 1
		end: cyl 487/ head 30/ sector 32
	3: <UNUSED>
	4: <UNUSED>
	Should we write new partition table? [n] y

	bsdlabel -w -r da0s2 auto ; bsdlabel -e da0s2
	newfs /dev/da0s2
	echo '/dev/da0s2a /stick.bsd ufs rw,noauto 0 0' >> /etc/fstab
	fsck -y /dev/da0s2a
	fsck -y -t msdos /dev/da0s1
	mount /stick.bsd
	echo unproven:
	echo 'drive u: file="/dev/da0s1"' >> /etc/mtools.conf
	mformat -v stacey_juli -t 257 -h 31 -n 32 -F -H 32 u:
	# -v is 11 chars max, stacey is first for if lost & finder looks in phone book
	# -H	number	of  hidden sectors
	mdir u:
	echo '/dev/da0s1 /stick.dos msdos rw,noauto 0 0' >> /etc/fstab
	usbconfig
-------------------------------------------------------------------------------
Win-XP:
	WINDOWS/system/setup.inf:	For XP similarity to /etc/rc, see
	WINDOWS/inf/biosinfo.inf:	Hints on hardware anomalies
	I386/BIOSINFO.INF
-------------------------------------------------------------------------------
OLD to scrap or merge
HOW TO BE ABLE TO NFS MOUNT /usr/src, & MAKE ON MULTIPLE HOSTS.

How to compile from nfs mounted /usr/src on multiple hosts.

My Setup:
  My hosts are called: `src_master' & `src_client_1' & ``src_client_2',
  with nfs cross mounts, such that
	src_client_1:/host/src_master/___	==	src_master:/___
	src_client_1:/host/src_master/usr/___	==	src_master:/usr/___
	src_client_1:/host/src_master/usr1/___	==	src_master:/usr1/___
	src_client_2:/host/src_master/___	==	src_master:/___
	src_client_2:/host/src_master/usr/___	==	src_master:/usr/___
	src_client_2:/host/src_master/usr1/___	==	src_master:/usr1/___

  /usr/src resides on host `src_master', which has a symbolic link:
	/usr/src --> ../usr1/src.
  hosts src_client_1 & src_client_2 have symbolic links:
	/usr/src --> /host/src_master/usr/src

  Each of src_master & src_client_1 & src_client_2 have their own /usr/obj with:
	/usr/obj/host
	/usr/obj/host/src_client_1	--> ..
	/usr/obj/host/src_client_2	--> ..
	/usr/obj/host/src_master	--> ..
  The purpose of the /host/ component, is so that whichever host first runs
  make world, the obj dirs are local, & also under /usr/obj, (& not under
  /usr/obj/host/src_master when src_client_1 or src_client_2 runs make world).

src/Makefile requires
	setenv NOCLEANDIR
so that on `src_client_1', `make world' will do nothing when calling `cleandir'

This might be advisable, as it will save some time:
	setenv NOOBJ
so that when this
	src_client_1 % make world
results in this:
	Rebuilding /usr/lib
	cd /usr/src/gnu/lib &&	make depend all install clean obj
the make obj does nothing, & does not result in
	/host/src_master/usr1/src/gnu/lib/libdialog ->
		/usr/obj/host/src_master/usr1/src/gnu/lib/libdialog

My /usr/src/sys
	now supports all this too - thought the patches will take a while
	to work in to public src.
---------------------
What is the difference between Safe Mode and Default Mode?
	grep -A11 'bootsafekey @' /boot/beastie.4th
-------------------------------------------------------------------------------
mailman
	CHECKS
	  cd /usr/local/mailman; bin/check_perms ; \
		echo if problems bin/check_perms -f
	  ps -laxww | grep mailman | sort | grep -v grep \
		| sed -e s/...................................//	\
		| sed -e s/....................................//	\
		| sed -e s/.usr.local.bin.python2.7//
	  cat /usr/local/mailman/data/master-qrunner.pid
		PID of mailmanctl
	  ps -laxww | grep mailmanctl | grep -v grep
	  bin/check_db --all
	BACKUP
	  cd /usr/local/mailman ;
 tar zcf /usr/backup/host/list/mailman.tars/`date +%Y_%m_%d_%H_%M`.tgz .
	  cd /usr/backup/host/list/mailman.tars
	  chown jhs:staff `/bin/ls -1 -t -r 20* | tail -1`
	  chmod 400 `/bin/ls -1 -t -r 20* | tail -1`
	  ls -l
	  echo Suggest you sftp
	CLEAR PROBLEMS
	  cd /usr/local/mailman; ls qfiles/shunt
	  cd /usr/local/mailman; bin/show_qfiles qfiles/shunt/*.pck
	  xs
	  ps -laxww | grep mailman | sort | grep -v grep
	  cd /usr/local/etc/rc.d ; umask 077
	  ./mailman stop
	  ./mailman start
	  ps -laxww | grep mailman | sort | grep -v grep
	  ./mailman stop
	  ./mailman start
	  cd /usr/local/mailman; ls qfiles/shunt
	  cd /usr/local/mailman; unshunt qfiles/shunt
	  cd /usr/local/mailman; ls qfiles/shunt
	  grep mailman /var/log/cron | grep shunt
	CONFIGS COMPARE
	  cd /usr/local/mailman/lists
	  config_list -o - ListName | egrep -v '^#|^$|^[[:space:]*]$' \
		> ~/tmp/ListName.mailman_jhs_config
	  config_list -o - pc532 | egrep -v '^$|^#|^[[:space:]]*$' \
		> ~/tmp/pc532.mailman_jhs_config
	CONFIGS EDIT
	  config_list --outputfile ~/tmp/ListName ListName
	  vi -c/member_verbosity_interval ~/tmp/ListName
		s/300/301/
	  config_list --checkonly -i ~/tmp/ListName ListName	# OK silent
	  config_list  -i ~/tmp/ListName ListName	# OK silently applies
	  config_list --outputfile ~/tmp/ListName2 ListName
	  diff -c ~/tmp/ListName ~/tmp/ListName
	  config_list -v -i ~/tmp/ListName ListName |& grep changed|wc -l # 115
		noisily falsely reports loads of changes.
	  foreach i ( * )
		config_list -o ~/tmp/$i $i
		end
	cd /usr/local/mailman/lists
	foreach i ( `/bin/ls -1` )
		/usr/local/mailman/bin/config_list -i ~/tmp2/$i $i
		end
	-----
	/usr/local/mailman/bin/list_lists -b | wc -l
	mkdir -p ~/mailman/orig; cd  ~/mailman/orig
	foreach i ( `list_lists -b` )
		/usr/local/mailman/bin/config_list -o $i $i
		end
	cd  ~/mailman
	list_lists -b > editlist
	vi editlist
	mkdir -p ~/mailman/new; cd  ~/mailman/new
	foreach i ( `cat ../editlist` )
		echo start $i
		/usr/local/mailman/bin/config_list -o - $i | sed -e 's/require_explicit_destination = 1/require_explicit_destination = 0/' > $i
		/usr/local/mailman/bin/config_list -v -i $i $i
		end
-------------------------------------------------------------------------------
mplayer
	Sample from [email ?]
		mplayer -tv
		driver=bsdbt848:input=1:channels=SE14-BBC,SE9-3sat,\
			E10-ARD,E8-ZDF,SE4-arte,S22-WDR tv://)
	mplayer /dev/acd0
		Works on commercial Bach DVD, (single prog.)
		Works on jes@ made global warming dvd [from tv?], (single prog.)
		Fails on commercial BBC B.... A.... DVD, (intro + 6 progs)
		  Could not initialize video filters (-vf) or video output (-vo)
	Log of trials with B.... A.... DVD :-
	chmod 666 /dev/acd0
	mplayer /dev/acd0	 # pic. fractured, complains Encrypted VOB file!
	mplayer dvd:// /dev/acd0	{
		Plays intro, pic & sound OK, Then complains Encrypted
		VOB, starts new frame & repeats intro with fragmented pics. }
	mplayer dvd://5-7			# plays inc sound
	mplayer dvd:// -dvd-device /dev/acd0	# plays intro inc sound
	mplayer dvd://2 -dvd-device /dev/acd0	# plays prog2 inc sound
	dvdbackup -M -i /dev/acd0 -o b...._a....
		/usr/ports/sysutils/dvdbackup
		Copies dvd content, but probably not title.
	   cd b...._a.... ; echo B* | sed -e "s/ /_/g"
		B....A...._____________________
	   ls B....A....*		# VIDEO_TS
	   ls /cdrom		# audio_ts video_ts
	   ls /cdrom/audio_ts	# empty
		So dvdbackup discards empty dirs, & maps to upper case.
	mv B* cp_by_dvdbackup  ; cd cp_by_dvdbackup
	ls # ensure it shows sub dir VIDEO_TS
	mkisofs -r -o ../b...._a.....iso .
		# NOT mkisofs -r -o ../b...._a.....iso VIDEO_TS
		# (which promotes *.vob into top dir. of .iso ).
	mplayer b...._a.....iso 	# plays, no sound,
		# loops on intro track.  Shows Spruce Technologies before BBC.
	mplayer dvd:// b...._a.....iso	# plays, inc. sound
	mdconfig -a -t vnode -f *.iso
	chmod 666 /dev/md0
	mplayer /dev/md0		# plays no sound, looping on intro.
		Announces
			MPEG-PS file format detected.
			MPEG: No audio stream found -> no sound.
			Audio: no sound
		Loops, Playing intro silently, with good video.
		Never gets to offer which programme, unlike Elsa.
	mplayer dvd:// /dev/md0 # plays no sound, looping on intro.
				# tries to access DVD if in.
	mplayer dvd:// -dvd-device /dev/md0 # plays intro with sound, looping
	cd VIDEO_TS
	mplayer VTS_04_1.VOB # plays OK, inc. sound.
	chmod 666 /dev/acd0
	xine VTS_04_1.VOB # plays video & sound
	xine b...._a.....iso	# No demuxer available.
	xine /dev/acd0	# No demuxer available.
	xine /dev/md0	#
	mplayer -menu /dev/md0 # loops
	mplayer -menu-startup /dev/md0 # 1st then 2nd session, but no sound
	gmplayer -menu-startup -osdlevel 3 /dev/md0
		does progress into 1st half hour session, but no sound,
		flashes up many new screens to cursor place.
	mplayer dvd://1 -dvd-device cp_by_dvdbackup # Plays intro inc sound.
	mplayer dvd://2 -dvd-device cp_by_dvdbackup # Plays 1st of 6 episodes.
	mplayer dvd://3-7 -dvd-device cp_by_dvdbackup # Plays 6th episode.
	mount /cdrom; chmod 666 /dev/acd0
	mplayer dvd://3-7 -dvd-device /cdrom
		Over NFS (data on host=laps, screen_host=fire),
		Works with sound initialy, then sound stops
		after half a minute & on the xterm invoking mplayer, get err:
		Too many video packets in the buffer:
		Does Not need access to /dev/acd0.
		With dvd & screen all on host=laps, work ok, no sound failure.
	mplayer dvd://2 /dev/md0 # plays, over nfs but sound slow then fails.
	foreach i ( * )
		echo "To Vob From hard disc." # One large .vob per prog.
		mplayer dvd://$i -dvd-device cp_by_dvdbackup \
			-dumpstream -dumpfile vob_from_mplayer/$i.vob
		echo "To Avi From hard disc." # 30 sec. for intro. prog.
		mencoder dvd://$i -dvd-device cp_by_dvdbackup \
			-ovc lavc -oac lavc -of avi -o avi_from_mencoder/$i.avi
		echo "To Avi From dvd disc." # 45 sec. for intro. prog.
			# DVD drive runs continuously, no wearing speed changes.
		mencoder dvd://$i -dvd-device /dev/acd0 \
			-ovc lavc -oac lavc -of avi -o avi_from_mencoder/$i.avi
			file: RIFF (little-endian) data, AVI, 720 x 576,
			   25.00 fps, video:, audio: (stereo, 48000 Hz)
			These .avi are only 250M & picture quality is too low.
		end # works, mplayer later can play both .vob & .avi
	transcode:	Not tried manually.
	See also ogle: another player
-------------------------------------------------------------------------------
XP To get a command.com DOS box:
	Double Left Click Start, Double Click Run
	Type 2 x backspace (to get rid of a:), Type command.com
    Windows\system32 contains cmd.exe
---------------------
vmstat -i systat -vm
-------------------------------------------------------------------------------
Data capture for eg smtp/pop3
	tcpdump, Ethereal, sniffit, snort
	mailsnarf from the dsniff package
	tcpdump -w /var/log/mailarchive.dump -s 0 port smtp or port pop3
-------------------------------------------------------------------------------
FF adblockers
	quotes from questions@:
	Adblock Plus
	for further security, I also use NoScript and Request Policy.
	Many folks won't like the latter two, as they tend to block
	an awful lot until you get them tuned
-------------------------------------------------------------------------------
MS:
	McAfee is not free < P 2012-08 & Owner done by USA gov 2021-03-06 for bitcoin fraud said BBC R4.
	AVG Basic is free but no firewall < P 2012-08
	MS have a free download that has been reviewed very highly < P 2012-08
-------------------------------------------------------------------------------
youtube-dl -t 'http://www.youtube.com/watch?v=6xuubjIrYkc'
-------------------------------------------------------------------------------
Fontconfig error: Cannot load default config file: No such file: (null)
 {
 If above is emitted on FreeBSD 12.2-STABLE by exmh & firefox & xpdf,
 Same error can be emitted faster, (without graphic rendering ballast) by eg
  fc-list -q
 & also by
  fc-match hello
 /usr/local/bin/fc-* are installed from /usr/ports/x11-fonts/fontconfig
  man fc-list has SEE ALSO  /usr/share/doc/fontconfig/fontconfig-user.html
  but pkg-plist does not mention:
 /usr/ports/x11-fonts/fontconfig/work/fontconfig-2.13.93/doc/fontconfig-user.html
 /usr/ports/x11-fonts/fontconfig/work/fontconfig-2.13.93/doc/fontconfig-user.pdf
 This did not help:
  ls -la ~/.config/fontconfig; mv ~/.config ~/.config.MV
 This solved it
  ln -s ../usr/local/etc/fonts /etc/fonts; cd /etc/fonts; cp fonts.conf.sample fonts.conf
-------------------------------------------------------------------------------
Want to strip UTF-8 BOM(Byte Order Mark) from given files?
	sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile
-------------------------------------------------------------------------------
