From 4813e284c669aa2f2612237e6f0102865d14df65 Mon Sep 17 00:00:00 2001 From: reed Date: Fri, 21 Mar 2008 21:09:48 +0000 Subject: Add "netbsd-tips" fortune database with 23 initial fortunes -- actually hints or suggestions or tips on using NetBSD. Please share your brief NetBSD usage tips. If you want to discuss or share suggestions, have a look at http://wiki.netbsd.se/netbsd-tips wiki page. --- fortune/datfiles/Makefile | 9 ++-- fortune/datfiles/netbsd-tips | 115 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 fortune/datfiles/netbsd-tips (limited to 'fortune/datfiles') diff --git a/fortune/datfiles/Makefile b/fortune/datfiles/Makefile index 0a3eed0b..d9b44a35 100644 --- a/fortune/datfiles/Makefile +++ b/fortune/datfiles/Makefile @@ -1,15 +1,15 @@ -# $NetBSD: Makefile,v 1.36 2003/10/21 10:01:19 lukem Exp $ +# $NetBSD: Makefile,v 1.37 2008/03/21 21:09:48 reed Exp $ # @(#)Makefile 8.2 (Berkeley) 4/19/94 .include # for INSTALL_OFFENSIVE_FORTUNES SRCFILES= fortunes fortunes2 startrek zippy unamerican-o limerick \ - netbsd farber + netbsd farber netbsd-tips DATFILES= fortunes.dat fortunes2.dat startrek.dat zippy.dat \ fortunes-o fortunes-o.dat fortunes2-o fortunes2-o.dat \ limerick.dat limerick-o limerick-o.dat unamerican-o \ unamerican-o.dat netbsd.dat netbsd-o netbsd-o.dat \ - farber.dat + farber.dat netbsd-tips.dat # TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, RUN 'make' with # "INSTALL_OFFENSIVE_FORTUNES=NO", or set "INSTALL_OFFENSIVE_FORTUNES=NO" @@ -36,7 +36,7 @@ realall: ${DATFILES} # Normal fortunes: build directly from data files. -fortunes.dat fortunes2.dat startrek.dat zippy.dat limerick.dat netbsd.dat farber.dat: +fortunes.dat fortunes2.dat startrek.dat zippy.dat limerick.dat netbsd.dat farber.dat netbsd-tips.dat: ${_MKTARGET_CREATE} ${STRFILE} -rs ${.CURDIR}/${.TARGET:R} ${.TARGET} fortunes.dat: fortunes @@ -46,6 +46,7 @@ zippy.dat: zippy limerick.dat: limerick netbsd.dat: netbsd farber.dat: farber +netbsd-tips.dat: netbsd-tips # Obscene fortunes: we have to build source and data files diff --git a/fortune/datfiles/netbsd-tips b/fortune/datfiles/netbsd-tips new file mode 100644 index 00000000..83a6cacf --- /dev/null +++ b/fortune/datfiles/netbsd-tips @@ -0,0 +1,115 @@ +List 20 largest files (larger than 5 MB) sorted by megabytes: + + find / -type f -size +10000 -print0 | xargs -0 du -m | sort -nr | head -20 +% +You can keep specific rc.conf configurations in individual files +under /etc/rc.conf.d/ where each file is named after the $name of +the rc.d script. Some configurations may have different names than +the script; see the $name variable to check. +% +You can see the total used buffers in megabytes with: + + vmstat -s | awk ' +/ bytes per page$/ { bpp = $1 } +/ cached file pages$/ { cfp = $1 } +/ cached executable pages$/ { cep = $1 } +END { print((cfp + cep) * bpp / 1024 / 1024); }' +% +You can view a value of a variable in pkgsrc by using the show-var +target, for example: + + make show-var VARNAME=MAINTAINER +% +You can view the basic order of your rc.d scripts with: + + rcorder /etc/rc.d/* +% +You can ask questions about NetBSD at the netbsd-users@NetBSD.org +mailing list. Be sure to clearly explain your problem, what you +tried, what results you had, and what you expected. +% +You can view your non-default Postfix settings with: + + postconf -n +% +To report about installed packages with known vulnerabilities, +fetch the latest pkg-vulnerabilities file as the superuser with: + + download-vulnerability-list + +And then run: + + audit-packages +% +The following shows an example of temporarily adding 10MB more swap +space for virtual memory: + + dd if=/dev/zero of=/root/swapfile bs=1024 count=10000 + swapctl -a /root/swapfile +% +If your console ever gets broken, you can try resetting it to its +initial state with: + + printf "\033c +% +If you installed a package, but don't know what the software is +called or what executables, to run use the pkg_add with the -L +switch to list the package's files and search for /bin: + + pkg_add -L PACKAGE-NAME | grep /bin +% +A new user can be added by using the useradd tool with the -m switch +to create the home directory. Then set the password. For example: + + useradd -m susan + passwd susan +% +To modify user account information use the chpass or usermod tools. +If you need to edit the user database directly, use the vipw command. +% +You can temporarily start the SSH server by running the following +as root: + + /etc/rc.d/sshd onestart +% +Several IP Filter and ipnat examples are available in the +/usr/share/examples/ipf/ directory. +% +Want to dual boot using a bluetooth mouse or keyboard? Use btkey(1) +to store the link key in the hardware. +% +If you are having trouble connecting to a remote bluetooth device, +try the btconfig(8) inquiry command. The kernel will retain some +clock offset information that may help. +% +You can download files via HTTP using the ftp(1) command; for example: + + ftp http://www.NetBSD.org/images/NetBSD.png +% +The mtree(8) tool can be used to check permissions, ownerships, +file changes, and more when compared against a specification. For +example to check directory ownership and permissions for standard +NetBSD directories, run: + + /usr/sbin/mtree -e -p / -f /etc/mtree/NetBSD.dist +% +If you need reminders on your console to leave, use the leave(1) +tool. For example to receive reminders to leave in one hour: + + leave +0100 +% +To stop non-superuser logins until next boot, as root: + + touch /etc/nologin +% +When extracting distribution tar sets, be sure to use the pax -pe +option or the tar -p switch to preserve the user and group and file +modes (including setuid and setgid). This is needed, for example, +so su(1) will work after extracting the base.tgz set. +% +Math can be done within the sh(1) and ksh(1) shells or with expr(1), +dc(1), bc(1), or awk(1). Here are some simple examples: + + echo $((431 * 79)) + expr 60 \* 60 \* 24 \* 7 +% -- cgit v1.2.3-56-ge451