Category Archives: Unix

Unix

Installing FreeBSD 4,5,6 and 7

Basic FreeBSD questions for beginner like me icon smile Installing FreeBSD 4,5,6 and 7

1. What is FreeBSD?

Wikipedia has the answer

2. Is it good as server?

Don’t know icon smile Installing FreeBSD 4,5,6 and 7 , see yourself in netcraft

3. Which version is the best?

For old hardware, consider using 4.xxx, for modern hardware use 6.xxx

4. Is there any video for installing FreeBSD?, I wanna see general view on how to install FreeBSD

For quick overview I make video using vmware 6, installing FreeBSD 4, 5 and 6. I wanna upload it in youtube, due to maintain problem I upload it in metacafe. Here’s the link :

P.S :

I’ve upload new video about running vmdk FreeBSD 4,5 and 6 in VirtualBox 1.4,  click here to see

Whats next? You can do many things in FreeBSD. Some recommended books for you :

 

Unix

cvs, cvsup, portsnap and csup

Progress in *BSD world is very fast, everyday patch released, program update etc

to get that update via internet FreeBSD provide a few tools :

  • cvs, not so familiar for beginner
  • cvsup, very famous in FreeBSD, can update ports, source even for backup purpose
  • portsnap, only for port update, in FreeBSD tree since 6.0
  • csup, cvsup alternative, already integrated in 6.2 tree, no need to install, compatible with cvsup

example for cvs :

cvs -z3 -d :pserver:anonymous@cvs.freesbie.org:/cvs co -P freesbie2

will fetch freesbie2 and located in current directory where command issued

example for cvsup :

cvsup -g -L2 ports-supfile -h cvsup12.freebsd.org

will update ports information

example for portsnap :

portsnap update

will update ports data, faster than portsnap extract

csup example :

cvsup -g -L2 stable-supfile -h cvsup12.freebsd.org

will update stable source

P.S :

make sure port 5999/tcp open for cvsup and csup

portsnap will use port 80

Unix

Recreate FreeBSD ports build option

As big fan of FreeBSD ports, I like to play around with ports option, like when installing php4 I was prompted with a lot of build options :

kongja# whereis php4
php4: /usr/ports/lang/php4
kongja# cd /usr/ports/lang/php4

then this ncurse option will popup

 Recreate FreeBSD ports build option

===> Found saved configuration for php4-4.4.6
===> Extracting for php4-4.4.6

read more »

Unix

View crontab entries of entire user in FreeBSD

Cron is special utility that process command in periodic time such ;

  • doing regular backup every night
  • email special report every week
  • etc

cron access can be usefull but sometime not, depend on the command issued.

As super user we can list all of entire user crontab entries using log locate in /var/log

su-2.05b# tail -f /var/log/cron
Apr 30 20:30:00 erau /usr/sbin/cron[81893]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:30:00 erau /usr/sbin/cron[81894]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:35:00 erau /usr/sbin/cron[84459]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:35:00 erau /usr/sbin/cron[84462]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:40:00 erau /usr/sbin/cron[87061]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:40:00 erau /usr/sbin/cron[87062]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:45:00 erau /usr/sbin/cron[90181]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:45:00 erau /usr/sbin/cron[90180]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:50:00 erau /usr/sbin/cron[93304]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:50:00 erau /usr/sbin/cron[93305]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)

pay attention on (root) entries, that mean user who run that command in this case generate data for cacti.

You can run the command as root or sudo, otherwise you’ll get “permission denied” message

-bash-2.05b$ tail -f /var/log/cron
tail: /var/log/cron: Permission denied
-bash-2.05b$ su
Password:
kongja# tail -f /var/log/cron
Apr 30 20:36:00 kongja /usr/sbin/cron[81442]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:37:00 kongja /usr/sbin/cron[81504]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:38:00 kongja /usr/sbin/cron[81567]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:39:00 kongja /usr/sbin/cron[81631]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)

happy viewing icon smile View crontab entries of entire user in FreeBSD

P.S :

other usefull place to check for cron entries

/var/cron/tabs
/var/cron/atjobs
/etc/crontab

Linux Unix

no eth0 in FreeBSD?

Convention in Linux for network interface simple and clear.

eth for cable connection

ath or wifi for wireless connection

l0 for loopback

sample from my ubuntu feisty fawn box :

alamsyah@alamsyah-laptop:~$ ifconfig -a

ath0  Link encap:Ethernet� HWaddr 00:14:A4:70:02:3E
inet addr:192.168.12.100� Bcast:192.168.12.255� Mask:255.255.255.0
inet6 addr: fe80::214:a4ff:fe70:23e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST� MTU:1500� Metric:1
RX packets:8945 errors:0 dropped:0 overruns:0 frame:0
TX packets:6503 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5854116 (5.5 MiB)� TX bytes:1133161 (1.0 MiB)

eth0 Link encap:Ethernet� HWaddr 00:0A:E4:F1:CC:ED
UP BROADCAST MULTICAST� MTU:1500� Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b)� TX bytes:0 (0.0 b)
Interrupt:23 Base address:0xe000

eth0:avah Link encap:Ethernet� HWaddr 00:0A:E4:F1:CC:ED
inet addr:169.254.12.119� Bcast:169.254.255.255� Mask:255.255.0.0
UP BROADCAST MULTICAST� MTU:1500� Metric:1
Interrupt:23 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1� Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING� MTU:16436� Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:346 (346.0 b)� TX bytes:346 (346.0 b)

read more »