blog.up-link.ro android bsd linux unix & open-source world

21Jun/100

FreeBSD: Complete Virtualization using VirtualBox

VirtualBox is a virtualization software,originally created by German software company innotek GmbH, purchased by Sun Microsystems, and now developed by Oracle Corporation as part of its family of virtualization products. It is installed on an existing host operating system; within this application, additional guest operating systems, each known as a Guest OS, can be loaded and run, each with its own virtual environment.

In this article I'll show you how to install VirtualBox under FreeBSD.

VirtualBox is available as a FreeBSD port and may be installed using the following commands:

Print This Post Print This Post
18Jun/101

FreeBSD: How To Create a Network Bridge

A device that connects two networks together into two separate network segments without having to create IP subnets and use a router to connect the segments together is called a "bridge".

To create a bridge use ifconfig command:

ifconfig bridge create

A bridge interface is created and is automatically assigned a randomly generated Ethernet address.

Print This Post Print This Post
18Jun/102

UNIX Tools: vmstat – report virtual memory statistics

vmstat is a computer system monitor tool that collects and displays summary information about operating system memory, processes, interrupts, paging and block I/O information.

vmstat

vmstat sample output

vmstat usage:

vmstat [-V] [-n] [delay [count]]

-V prints version.
-n causes the headers not to be reprinted regularly.
-a print inactive/active page stats.
-d prints disk statistics
-D prints disk table
-p prints disk partition statistics
-s prints vm table
-m prints slabinfo
-S unit size
delay is the delay between updates in seconds.
unit size k:1000 K:1024 m:1000000 M:1048576 (default is K)
count is the number of updates.

Print This Post Print This Post
17Jun/101

FreeBSD: System Monitoring with MRTG

The Multi Router Traffic Grapher, or just simply MRTG, is free software for monitoring and measuring the traffic load on network links. It allows the user to see traffic load on a network over time in graphical form.

1. Installing Apache2 HTTP Server

Install Apache on the server you wish to display MRTG stats from:

cd /usr/ports/www/apache22
make install clean

To run Apache2 at system startup, append the following line to /etc/rc.conf :

apache22_enable="YES"

Start Apache2, enter:

/usr/local/etc/rc.d/apache22 start
Print This Post Print This Post
16Jun/100

Text Editors: vi commands and tips

vi is a family of screen-oriented text editors which share certain characteristics, such as methods of invocation from the operating system command interpreter, and characteristic user interface features. The portable subset of the behavior of vi programs, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.

vi operates in either insert mode (where typed text becomes part of the document) or normal mode (where keystrokes are interpreted as commands). Typing "i" while in normal mode switches the editor to insert mode. Typing "i" again at this point places an "i" in the document. From insert mode, pressing the escape key switches the editor back to normal mode.

Print This Post Print This Post
12Jun/100

OpenBSD: How To Create a Transparent Bridge

A network bridge is a device which connects two parts of a network together. In this article I'll show you how to create a transparent bridge in OpenBSD.

To activate the bridge in OpenBSD run the following commands:

echo up > /etc/hostname.xl0
echo up > /etc/hostname.xl1
echo add xl0 add xl1 up > /etc/bridgename.bridge0

This will setup the two interfaces (xl0 and xl1) and add them into the bridge0.

Now, you need to enable IP forwarding so that IP packets will pass from one interface to another.
To enable ip forwarding add the following line to /etc/sysctl.conf:

 net.inet.ip.forwarding=1

Once this is all done, reboot to activate.

reboot

Print This Post Print This Post
11Jun/100

OpenBSD: How To Install OpenBSD Ports and Packages Collection

OpenBSD is a fairly complete system of its own, but still there is a lot of software that one might want to see added.

The port collection, originally borrowed from FreeBSD and significantly rewritten, fills this gap. The concept is to have, for each third-party software, a Makefile that controls:

  • where to fetch it,
  • how to do the fetch,
  • what it depends upon (if anything),
  • how to alter the sources (if needed),
  • how to configure, build and install it.

This information is kept in a directory hierarchy under the /usr/ports directory.

Packages are the binary equivalent of ports. A compiled port becomes a package that can be easily installed and registered into the system using pkg_add utility.

Print This Post Print This Post
10Jun/103

OpenBSD: How To Install OpenBSD – OpenBSD 4.7 Installation Guide

OpenBSD is a Unix-like operating system descended from Berkeley Software Distribution (BSD), a Unix derivative developed at the University of California, Berkeley.

The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. OpenBSD supports binary emulation of most programs from SVR4 (Solaris), FreeBSD, Linux, BSD/OS, SunOS and HP-UX.

This article is a step-by-step guide about how to install OpenBSD 4.7 using the installation CD. The installation guide will show a clean install, meaning any operating system or information already on the computer will be erased.

Print This Post Print This Post
3Jun/103

UNIX Tools: txt2regex – regular expression (regex) generator

^txt2regex$ is a regular expression wizard that leads the user through the construction of a regular expression. txt2regex can create RegExes for use with different programs, including awk, ed, egrep, Emacs, expect, find, grep, lex, Lisp, MySQL, OpenOffice.org, Perl, PHP, PostgreSQL, Procmail, Python, Sed, Tcl, VBscript and vi. It is a useful tool for users with little or no knowledge of regular expressions and is included in several Linux distributions ( including Debian, Gentoo, Ubuntu ), in FreeBSD, and in Fink for Mac OS X.

Print This Post Print This Post