IOzone is a filesystem benchmark tool that
- read
- write
- re-read
- re-write
- read backwards
- read strided
- fread
- fwrite
- random read
- pread
- mmap
- aio_read
- aio_write
BackupPC is an awesome program for backing up your data in an efficient manner. It provides you with an easy to use web interface and some very complete documentation. Read more about it at the BackupPC SourceForge page.
For some reason, the FreeBSD ports tree still does not contain BackupPC! This guide details the configuration steps to get BackupPC running with an Apache (lighttpd also supported, though) web interface on a FreeBSD host.
Upgrading a FreeBSD system is not all that hard. The FreeBSD Handbook obviously has a more verbose look at the whole process, but the following is basically what you will need to do on most systems.
If csup is new to you, man csup for more information. It is a C rewrite of cvsup.
I stumbled across pv the other day and found it interesting. It is not so much a utility as eye-candy, but useful non-the-less.
from the man page: pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.
First, install pv with what ever package manager you use.
- # cd /usr/ports/sysutils/pv && make install clean
- # apt-get install pv
- # yum install pv
Using pv is analogous to using cat, only with a progress bar and some extra goodies!
- # pv file.iso | dd of=/dev/cd0 bs=64k
- (server)
- # pv file.iso > nc -l 4444
- (client)
- # nc host 444 > file.iso
NanoBSD is an awesome set of scripts contained in the FreeBSD source tree that enables you to easily prepare and install a custom FreeBSD system for an embedded device. It is also highly optimized for Compact Flash media, providing a Read-Only file system and memory disks for the heavily written mount points, namely /etc and /var, to protect against wear-leveling.
I have provided a number of config files for a NanoBSD system that provides various services to get you started on an overlay of custom files that are geared towards making an AP (access point) out of an ALIX2C2 board from http://pcengines.ch (purchased at NetGate [US]), although these files require minor tweaks if you are using another ALIX board or even completely different hardware (mainly just network device names!).
- # mkdir /mnt/nanobsd
- # mount /dev/da0s1a /mnt/nanobsd
- # mkdir /mnt/nanobsd/usr/ports
- # mount -t nullfs /usr/ports /mnt/nanobsd/usr/ports
- # mount /dev/da0s3 /mnt/nanobsd/cfg
- # chroot /mnt/nanobsd
- # cd /usr/ports/foo/bar
- # make install clean
- # mkdir /cfg/local
- # cp -R /usr/local/etc/* /cfg/local
- # exit
- # umount /mnt/nanobsd/usr/ports
- # umount /mnt/nanobsd/cfg
- # umount /mnt/nanobsd
I always seem to forget this command. The following mounts the UFS2 FreeBSD filesystem to /mnt/fbsd directory on a Linux box. Notice the read-only permission. Unfortunately, (as of this writing) Linux does not have write support for UFS2. Please let me know if I am in error.
Change /dev/sda3 to your disk device!
- # mkdir /mnt/fbsd
- # mount -t ufs -o ro,ufstype=ufs2 /dev/sda3 /mnt/fbsd
Under construction...
Never edit /boot/grub/grub.cfg directly! You have to make changes in a special file under /etc/grub.d so that your changes will not get overwritten every time you update kernels, etc.
I am using my disk device name here. Make sure you use the one that fits your system.
- hd0 hard drive number
- 3 partition of FreeBSD partition (indexed from 1)
- a slice of /boot partition
- # vi /etc/grub.d/40_custom
- #!/bin/sh
- exec tail -n +3 $0
- menuentry "FreeBSD 8.0-RELEASE" {
- insmod ufs2
- set root=(hd0,3,a)
- chainloader +1
- }
Run update-grub2 to merge the changes in /etc/grub.d/40_custom. You should also be able to verify that the new entry will be seen next time grub2 is loaded.
- # update-grub2
- # cat /boot/grub/grub.cfg | grep FreeBSD
Reboot and give it a try!
I was on the hunt for an expect library for PHP and finally found one in PECL, a repository for PHP Extensions. I was surprised this was not a PHP module more easily accessible like php-session, php-mysql, etc... but it works just as well.
Since Metasploit is so dynamic and still changing frequently with full time employees, it is best to just sync a local file tree to the latest code branch when you plan to use it. You can use the /usr/ports/security/metasploit port, but you will find it lagged far behind the latest SVN tree.
Anyways, we need to install subversion to download the Metasploit Framework.
- # cd /usr/ports/devel/subversion
- # make install clean distclean
Now make room for Metasploit and download the tree.
- $ mkdir ~/.msf3
- $ cd ~/.msf3
- $ svn co https://www.metasploit.com/svn/framework3/trunk framework
Finally, drag in Ruby and a few supporting modules.
- # cd /usr/ports/databases/rubygem-activerecord
- # make install clean distclean
- # cd /usr/ports/devel/ruby-rreadline
- # make install
Coming soon...
A FreeBSD port for the Eclipse AVR add-on has yet to be created and the Eclipse CDT add-on that is contained in even a recent ports tree is too outdated to use with the AVR add-on.
To fix this, I basically started with a naked Eclipse install from ports and installed the extra features manually using Eclipse's update mechanism and each add-on's respective update site.
This uses the new VAP interface setup that comes with FreeBSD 8.0 and newer.
- # vi /etc/rc.conf
- --- snip --- snip ---
- wlans_ath0="wlan0"
- ifconfig_wlan0="WPA DHCP"
- # vi /etc/wpa_supplicant.conf
- network={
- ssid="ssid_goes_here"
- key_mgmt=WPA-PSK
- psk="password_here"
- }
- # /etc/rc.d/netif restart
Wait a few seconds for your wireless card to associate with the wireless device and see (1) if you are associated and (2) that you have an IP address.
- # ifconfig wlan0
If you have multiple access points around and want a certain one over the other, add priority=1 (you change number), to the host's block in /etc/wpa_supplicant.conf. The lower the number, the higher the priority.
Test IP connectivity to the public Internet.
- # ping 4.2.2.1
Test DNS resolution against a public hostname.
- # cat /etc/resolv.conf
- -- list of nameservers from DHCP lease --
- # ping www.google.com
If you happen to not have anything there, you can try using the 4.2.2.1 and 4.2.2.2 nameservers.
- # vi /etc/resolv.conf
- nameserver 4.2.2.1
- nameserver 4.2.2.2
The FreeBSD Handbook covers most FreeBSD installation topics in depth, but the following is exactly the way I install all of my systems. This process is quick and will get you into a system that you can customize to your liking.
I have compiled a list of system commands that I felt were frequent enough to mention. The list covers commands that you use to ti interact with the file system and network, use the vi/vim editor, and utilize screen to make life easier.
I have put together a basic reference of chmod permissions. Enjoy!
For a more complete "e;guide"e; to little things like this, check out my full guide to using a shell.
| Digit | R | W | X | Result |
|---|---|---|---|---|
| 0 | - | - | - | no access |
| 1 | - | - | x | execute |
| 2 | - | w | - | write |
| 3 | - | w | x | write & execute |
| 4 | r | - | - | read |
| 5 | r | - | x | read & execute |
| 6 | r | w | - | read & write |
| 7 | r | w | x | read, write, & execute |
R is read W is write X is execute
git is an awesome reversion-control system (amougst many other things) Coupled with gitosis for easy user/project/groups/access management and gitweb to get a great visualization of a project's repository, it can quicky scale to any project at hand.
I had the need to set up irssi on my University shell account with minimal user access, so I took some notes on what I did. I have found out that a lot of people encounter the missing glib dependency, which is absolutely necessary for irssi to execute properly. Due to the problem's popularity, I included installing glib in this guide.
FreeBSD ships with the internal speaker enabled, which can be very annoying when computing in public! I chose to disable the beep by disabling it at the kernel level with sysctl, instead of doing one-off hacks for each application that uses the system bell.
- # sysctl hw.syscons.bell=0
- hw.syscons.bell: 1 -> 0
Now check to see if the beep is still there. If not, do the following to make the change permenant. If the sound is still there, skip to the next heading to see some other methods of disabling the internal speaker.
- # echo 'hw.syscons.bell=0' >> /etc/sysctl.conf
Apache's HTTP Authentication is a fast and easy way to lock down a directory so that it prompts users with a password dialog box to view the files.
This guide assumes that you have Apache2 already up and running.
Qemu enables you to emulate hardware on a virtual harddrive, allowing you to install an operating system (or systems) and start up the "virtual" computer as if you controlled the BIOS and hardware components.
This guide runs through the basics of installing and configuring Qemu on a FreeBSD host and shows how easy it is to virtualize an operating system.
Although this guide is aimed at using FreeBSD for the Qemu host system, the actual commands and process to interact with Qemu remain the same on virtually any Qemu installation (including Windows). Your mileage may vary.
If you are new to the ALIX board world or need a quick reference for a buy list, I have put together a quick list of parts that I often buy for home and office installs that need to utilize WiFi.
I mostly use ALIX (formerly WRAP) embedded boards that pcengines makes. They are 500Mhz, 256MB of ram, and come in a variety of hardware options.... and a basic kit can be had for less then 190$ (US)! The following will provide you with a basic config that would suit most smaller installs that need to utilize Wi-Fi (2.4Ghz in this case).
There are some cases where a remote ports tree is a good thing to have around. For example, it can save bandwidth by downloading dist files only once and using them across all clients, when you need to know that all hosts using the tree have the same version of packages (good in development environment or large network), or even when the client doesn't have enough space for ports tree, distfiles, or the compile itself (NanoBSD!)
This is a basic setup involving a point-to-point IPSec VPN connection between a FreeBSD host and a Sonicwall TZ-170. This guide will probably work for most other versions of FreeBSD as well as other operating systems that use ipsec-tools and racoon.
For this tutorial, the FreeBSD source tree (/usr/src) should be installed. If you do not have it, look on the FTP and download the tree and use the install.sh all script.
- Tags
- ALIX (1)
- digitalfoo.net (2)
- embedded (6)
- FreeBSD (25)
- Java (1)
- Linux (20)
- misc (4)
- my projects (1)
- NanoBSD (3)
- opensource (5)
- perl (1)
- PHP (3)
- programming (7)
- security (4)
- Archives
- 2010
- June (5)
- July (2)
- April (6)
- March (2)
- May (1)
- August (2)
- 2009
- August (7)
- July (8)
- April (4)
- May (4)
- December (2)
- June (1)
- September (1)
- November (4)
- October (1)
- Web Tools
- Index
- dig-shovel Live
- SQL Injection Encoder
- Links
-

