gfxgfx
 
Welcome, Guest. Please login or register.

Login with username, password and session length
 
gfx gfx
gfxgfx
 
Howdy. Welcome to Madlinux Forum/Blog
Feel free to apply for an account to post something interesting.
 
gfx gfx
gfx
204 Posts in 100 Topics by 1 Members - Latest Member: zzsql September 04, 2010, 06:16:39 PM
*
gfx*HomeHelpSearchCalendarLoginRegistergfx
gfxgfx
      « previous next »
Pages: [1] Print
Author Topic: FreeBSD Notes:  (Read 786 times)
zzsql
Administrator
Full Member
*****
Posts: 205



View Profile
« on: July 28, 2008, 07:44:44 PM »

God damit.

There's a 20,000 character limit and my BSD Notes page is longer than that.

Click here to see my notes:
http://madlinux.com/bsdnotes.txt

They're pretty sweet.
Bullet items of all the best things I've learned over the past year or so.
« Last Edit: May 19, 2009, 10:16:30 PM by zzsql » Logged
zzsql
Administrator
Full Member
*****
Posts: 205



View Profile
« Reply #1 on: July 28, 2008, 07:46:29 PM »


Notes for FreeBSD Unix.
irc servers:
   - irc.blackened.com
   - irc.easynews.com
   - irc.vrfx.com
   - irc.choopa.net
   - irc.inet.tele.dk
   - irc.avalonworks.ca
   - irc.daxnet.no

1. Installed FreeBSD 4.8 onto my Dell Latitude L700/256.
2. first, X didn't work. Had to edit my /usr/X11R6/lib/x11/XF86Config file. See networkIQ.net/XF86Config. Added the Section "Screen" at the bottom to allow

for 24-bit color display. Was stuck at 256 colors.
3. used pkg_add -r lynx, snort, queso, xmms, gkrellm. they all worked! Sweet.
4. ifconfig xl0 for the first ethernet interface.
5. pkg_add -r wget also worked. Love that.
6. partition scheme:
   $ df -h
Filesystem    Size   Used  Avail Capacity  Mounted on   Partition
/dev/ad0s1a   197M    35M   146M    19%    /      1
/dev/ad0s1h   5.3G    13M   4.9G     0%    /home   4
/dev/ad0s1e    29M   1.6M    26M     6%    /tmp      2
/dev/ad0s1f   2.9G   1.1G   1.6G    41%    /usr      2
/dev/ad0s1g   295M   9.3M   262M     3%    /var      2
/dev/ad0s1i   512M   9.3M   262M     3%    swap      3

/  =  200 megs.
/tmp = 30 megs
/usr = 3  gigs
 /var = 300 megs
/home = the rest

7. The partition table was half the battle. Couldn't decide on the best use of my drive.
8. sudo pkg_add -r pico, added this nice text editor. vi on bsd is a bit of a pill :/
9. sudo pkg_add -r irssi
   - pkg_delete everybuddy.1.2.4 to remove a package.
10. pkg_add -r screen, minicom and whatever other binaries I wanted.
11. /etc/rc.conf: edit that plus /etc/inetd.conf file to turn off uneeded
services.
   - Example: sshd_enable="NO"
   - Do this in /etc/rc.conf to disable unneeded services.
12. ran visudo, added my user account to those who can sudo.
13. Security subsection:
   - disabled sshd and sendmail in rc.conf
14. man kldload to load modules into the kernel. insmod for FreeBSD.
15. sockstat to view open/closed sockets.
16. /usr/ports: here is your set of ports to install:
   - insert ports usage here:
17. ~.xinitrc= added "exec startkde" to have kde as my default windows manager. Could put gnome in there too maybe =)
18. pkg_info to see what packages are installed.
19. added bash to ~.profile to have bash load as my default shell.
20. cirrus logic 4281 model is the L400 sound card:
   - snd_cs4281_load="YES"           # cs4281 pci
   - That's the module for this soundcard =)
21. fstat |grep dsp - I was trying to use mpg123 but it errored saying can't open /dev/dsp - found the process holding /dev/dsp and killed it
22.  337  sudo pccardd - That started the pc card daemon giving power to the pcmcia card slot for my wireless card - now, airsnort
23. netstat -rn to show routing table
24. sudo route add default 192.168.1.1 added my default gateway which alter the routing table
25. pkg_add -r apache: copied Oreilly bookshelf cdrom to /home/apache/.
   - recall: apachectl start|stop|restart|status|graceful|etc.
   - Edited httpd.conf to point to /home/apache/index.htm.
26. httpd.conf: Significant entries;
   - Listen: allows you to bind apache to a specific IP address. You can also add a virtual
   IP Address to your NIC and have apache listen to that address on 80 or whatever port.
   - DocumentRoot "/usr/local/www/data" Changed to /home/apache
   - Make your changes and restart apache (apachectl restart)
   - User www, left that default. Advisable not to use nobody account. Nobody becomes
   somebody if you use it enough.
27. /usr/local/etc/apache/httpd.conf is the default loc for the conf file.
28. Ok, this is important. Apache was failing to start. Couldn't gethostbyname. /etc/hosts didn't have an adddress for the local apache server. added a

mapping "192.168.1.21 clams.comcast.net" which apparently mapped correctly. Apache works but now have an issue wtih permissions.
29. httpd.conf didn't have a pointer to default document. Fixed permission problem mentioned above by doing a # chmod a+x apache/ . Looks like must be able

to execute webpage. makes sense.
30. /usr/local/etc has some interesting .conf files for programs i use
31. replaced instances of index.html for index.htm. I seem to recall there being a defaultDocument variable that i couldn't find this time :/
32. kill artsd to play xmms
33. <link rel=SHORTCUT ICON href=/images/favicon.ico> to add a n incon to your shortcuts in a browser
34. Here's how I get my Enterasys card running on bsd. (At least before I add some startup options to do it automatically.)
   - System starts, I start the pccardd pcmcia card daemon with sudo pccardd
   - Ifconfig an IP address and add a route with "route add default 192.168.1.1"
   - Ifconfig shows that the card is associated because the base station has this MAC address is trusted.
35. Start services in /etc/defaults/rc.conf.
36. /etc/defaults/rc.local, add an entry to start the pccard daemon
37. /etc/defaults/rc.conf is for reading only. edit your /etc/rc.conf for your real system changes
38. man ata to read about disk controller driver. like hdparm on linux
39. /fset format_public [$0] %b<%n$1%b>%n $3- in BitchX.sav to timestampt. That's a classic.
40. snort -dev -i wi0 |grep PASS
41. wow! There's a utility called "dict". It is a command-line dictionary. Usage: $ dict apropos and it returns what it knows or closest matches.
42.
/var/db/dhclient.leases to see some dhclient leases
dmesg |tee dmesg - That would dump dmesg to the screen and to the dmesg file
43. maybe use the bios to set disk timeout variables. Otherwise, check man apm.
44. Ok, here's how ntpd works. First I installed ntpd with pkg_add -r ntp. Installed properly. Went to google, did a search on ntp servers and
found 129.132.2.21. There are others. That one is in die Schweitz.
   - Usage: $ntpdate 129.132.2.21 and it states "adjust time server offset 0.011171 sec" or whatever your local clock is off by.
45. Copy your timezone info to /etc. cp /usr/share/zoneinfo/America/New_York /etc/localtime (note the new name.)
   - Used the "date" command, view how it says "EDT" instead of GMT.
   - Restarted X and it re-read the local time and was correct. Now to cron it to set the time hourly.
46. Added a cron job to run hourly in /etc/crontab
   # Added an hourly time update. Greg.
   0       *       *       *       *       root    /home/clams/tools/set-time
47. <zi> clams: you do crontab -e <username> to edit a users crontab
48. /var/cron/tabs to view crontab history. Shows things like user viewed crontab, user listed, user edited etc.
49. cron usage
   -l to list conrents of an installed crontab
   -r to remove all crontab entries. Sweet
   -u user for whom to show crontab entries.
50. $ sudo crontab -l -u root to view roots crontab w/o being root.
51. Basically; crontab: as root, issue a crontab -r to remove all crontab entries. Edit /etc/crontab to your needs, then crontab /etc/crontab to
import your added crontab entries. Looks like /etc/crontab is only used as the template. Edit it, then import it into your cron list.
52. sudo su to su to root whilst not being in the sudoers group.
53. ncftp3 for FreeBSD works just like ncftp. Sweet unix goodness Smiley
54. unrar: to unrar .rar files. Sweet
55. apachectl startssl
56. XF86Config creates a default XF86Config. Edit that until it works.
57. crontab -u root -e
58. rm -rf directory/
59. /usr/X11R6/lib/X11/XF86Config is the location of the config file in fbsd.
60. http://www.ictp.trieste.it/~radionet/2000_school/lectures/pollarini/html/sample-XF86Config.html
61. system configuration things like ifocnfig entries to be persistent should go in /etc/rc.conf like this:
   defaultrouter="10.5.1.1"
   ifconfig_xl0="10.5.1.15/24"
   hostname="clams"
62. http://www.d20.co.edu/downloads/ilister.php?type=mac for good mac osx software
63. gdm/xdm == gui logon for X
64. best to remove moused_enable=YES in /etc/rc.conf and put it in the XF86Config under Section InputDevice
   - device for the mouse will be /dev/psm0 I think.
   - I did that and these bad mouse error messages to the stdout/term/console went away but the mouse worked in kde
65. X -config is a tool for configuring X
66. /stand/sysinstall for install process, useful for post-install configuration. the gui setup thing.
67. xf86config is that fugly utility to configure X. Be sure you select the right monitor, video card else kde looks ugly.
68. added DefaultDepth 23 to my XF86Config to fix the ugly grainy X desktop in kde.
   - see madlinux.com/XF86Config
69. ls -FAG, simple dir list.
70.0ngrep -O dump 'string to watch for' or ngrep -O dump 'whatever' tcp dst port 8080
71. ~/.BitchX/BitchX.sav isn't created until you enter /save in BitchX whilst logged on
72. Install apache:
   Download $ lynx http://httpd.apache.org/download.cgi 
   Extract $ gzip -d httpd-2_0_NN.tar.gz
   $ tar xvf httpd-2_0_NN.tar 
   Configure $ ./configure --prefix=PREFIX 
   Compile $ make 
   Install $ make install 
   Customize $ vi PREFIX/conf/httpd.conf 
   Test $ PREFIX/bin/apachectl start 
73. /usr/local/etc/apache/httpd.conf for apache config file
74. wheel:*:0:root,clams in the /etc/group to be able to su
75. make install clean from /usr/ports/network/whatever to install a port. It's nice.
76. irc servers:
   - irc.colosolutions.net
   - irc.choopa.net
   - irc.servercentral.net
   - irc.vrfx.com

77. de-dict [german word] for the german version of dict
78.  alias l='ls -alt'  to make a nice alias for ls -alt
79. alias and unalias to remove aliases. Also, enter 'alias' to see a list of your current aliases
80. make deinstall to remove installed applications whilst in the folder. (/usr/ports/directory/)
81. ncftp2 is a nice windowed automatic ftp program
82. /usr/X11R6/lib/X11 is the direcoty for XF96Config
83. /usr/local/etc/sudoers is the sudoers file and edit it with visudo
84. /etc/rc.conf to setup persistent IP addresses on freebsd
85. /usr/X11R6/bin/gnome-session to start gnome on boot from ~/.xinitrc
86. sudo tar -xvf konstruct-stable.tar
87.env to see your current environmental variables: interesting
88.usb drive: sudo mount -t msdos /dev/da0s1 /mnt/usb
89./dev/da0s1 on /mnt/usb (msdosfs, local)
90./usr/ports/x11-wm/kde/ is where new kde 3.3 is
91. time stamp BX stuff /fset format_public [$0] %b<%n$1%b>%n $3-
   /fset format_version Hi, this is my version reply =-)
92.camcontrol to control hdparms
93.man atacontrol for a disk controller on fbsd
94.put arpwatch into /usr/local/etc/rc.d to have it start auto
95.man vidcontrol to see how to control the size of fonts in runlevel 3 /
console tty.
96.ditch system beeps in X with 'xset b off'
97. Wow! I know this is simple but just cd to /usr/ports/whatever and do a
98. make install to get the package there installed. It appears to go to the ftp site to get the latest. Wonderful.
99. bgput or bgget to put or get things from an ftp site. Automate for even more fun.
100. psybnc to bounce and encrypt irc traffic.
101. ps -waux |grep whatever to see a process on FreeBSD. Linux is different
102. -a my.remote.ip/32: for /etc/syslogd to configure to where to send incoming logs
103. <sokan> clams, /etc/rc.conf settings override /etc/default/rc.conf
104. Meeded to enable remote logging with syslog. Added these to /etc/rc.conf to configure syslog then did a restart like /etc/rc.d/syslogd restart. parses

the /etc/rc.conf file.
   - One note, I had to rem out the second .1.1 entry to get it to work. I think they need to be on the same line.
   syslogd_flags="-a 10.5.1.2/32:*"
   # syslogd_flags="-a 10.5.1.1/32:*"

105. sudo /etc/rc.d/syslogd restart to restart syslogd and reparse the /etc/rc.conf file
106. /usr/local/apache2/ is the apache dir
107. /usr/local/apache2/htdocs is the apache content directory
108. portupgrade is the util to upgrade ports in your tree. automate.
109. look into /etc/ssh/sshd_conf and ssh_conf config files
110. www.egghelp.org for tutorials on eggdrop
111. /etc/ssh/sshd_config is the config file for ssh
112. pkg_add package.tgz to add packages through tgz files. sweet
113. ee is a neat little editor for text.
114. unix file system allows running processes to have 'shadow' copy of a file that gets changed out at whatever point you restart the service the new binary

is used
Logged
gfx
Pages: [1] Print 
gfx
Jump to:  
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!