Linux/ FreeBSD GNU GCC Common option for C compiler
November 15th, 2010 by upa_kid
gcc is a GNU project C and C++ compiler for Linux, UNIX, FreeBSD etc. From the wikipedia:
GCC is a key component of the GNU toolchain. As well as being the official compiler of the GNU system, GCC has been adopted as the standard compiler by most other modern Unix-like computer operating systems, including Linux, the BSD family and Mac OS X. GCC has been ported to a wide variety of computer architectures,...FreeBSD How to restart inetd service / daemon
November 15th, 2010 by upa_kid
inetd is referred to as the Internet Super-Server because it manages connections for several services. When a connection is received by inetd, it determines which program the connection is destined for, spawns the particular process and delegates the socket to it. First login as a root user.
FreeBSD version 5.0/6.0 or later
Newer version of FreeBSD has special start, stop, restart script, you can...FreeBSD > How to load device driver (module) automatically every time system comes up?
November 15th, 2010 by upa_kid
1. Check if your module exists or not in /boot/defaults/loader.conf file
2. If it exists then open file /boot/loader.conf and add entry in it. Do not add or modify /boot/defaults/loader.conf file. If entry does not exist then read step # 4.
3. Reboot system to see to take effect..
For example, we want to load NTFS file system driver everytime our FreeBSD box comes up. Here is procedure:
a) Find if...FreeBSD: HowTo Start / Stop / Restart Network and Routing Service
November 15th, 2010 by upa_kid
FreeBSD is a Unix-like free operating system. You can install to choose third party software on FreeBSD from the Ports Collection. Many services such as POP3 server daemons, IMAP, etc. could be started using the inetd.
However, networking can be stop or started using special script located in /etc/rc.d/ directory. This directory includes script to stop or start network, and other services such as...FreeBSD > which directories (PATHs) used to load device drivers (modules)?
November 15th, 2010 by upa_kid
The kldconfig utility displays or modifies the search path used by the
kernel when loading modules using the kldload utility or the
kldload syscall. You can also use sysctl command (the sysctl utility retrieves kernel state). Try any one of the following command as a root user:
1) To get PATH (or directories name) type command:
# sysctl kern.module_path
OR
# kldconfig -r
2) The path can modified in...FreeBSD > How to enable colorized ls output?
November 15th, 2010 by upa_kid
FreeBSD has ls command to list directory contents. You can pass -G option to ls command to enable colorized output. For example, type following command at shell prompt to get colorized output:
$ export TERM=xterm
$ ls -G
But hold on you do not have to type ls –G every time, just create an alias as follows:
1) Simple use following alias
$ alias ls=’ls –G’
2) Store above alias to ~/.bash_profile
3)...FreeBSD: Customize Home, Del, Insert keys for BASH shell
November 15th, 2010 by upa_kid
By default when you use FreeBSD’s BASH shell and if you hit Home, Del, Insert keys all of them just prints ~ (some garbage is printed ). To get rid of this problem, edit /etc/profile file and define key binding.
1) Open your bash global profile file:
# vi /etc/profile
2) Add following line to it:
export INPUTRC=/usr/local/etc/inputrc
3) Close and save the file
4) Open the file /usr/local/etc/inputrc...FreeBSD > How to setup FreeBSD as DNS client?
November 15th, 2010 by upa_kid
Local name resolution is done via /etc/hosts file. If you have small network then use /etc/hosts file. DNS (domain name service is accountable for associating domain names with ip address, for example domain yahoo.com is easy to remember than IP address 202.66.66.12) provides better name resolution. To configure FreeBSD as DNS client you need to edit or modify /etc/resolv.conf file. This file defines...FreeBSD Load Device Driver / Kernel Module
November 15th, 2010 by upa_kid
Under FreeBSD operating system you need to use the kldload utility to load file.ko into the kernel using the kernel linker. You can find all loadable kernel drivers in in /boot/kernel or /boot/modules/ directory. Some modules (pf, ipfw, ipf, etc.) may be automatically loaded at boot time when the corresponding /etc/rc.conf statement is used. Modules may also be auto-loaded through their addition to...FreeBSD: How to unload (remove) device driver (module) from kernel?
November 15th, 2010 by upa_kid
FreeBSD comes with kldstat command. The kldstat utility or command displays the status of any files dynamically linked into the kernel. And the kldunload utility unloads a file which was previously loaded with lldload command. You can use kldunload command as follows.
Unload a file from the kernel
First login as a root user (use su – or sudo commnad):
Get list of loaded modules/drivers first...FreeBSD: How To List Device Drivers ( modules ) Loaded In Memory
November 15th, 2010 by upa_kid
A question from my email bag – How do you find out all drivers loaded by FreeBSD kernel?
Simply use the kldstat command to display the status of any files dynamically linked into the kernel. The kldstat utility first appeared in FreeBSD 3.0, replacing the lkm interface.
kldstat Command Example
Use kldstat command as follows:
# kldstat
Sample outputs:
Id Refs Address Size Name
1 6...FreeBSD > Compiling application with QT
November 15th, 2010 by upa_kid
Qt is a complete C++ application framework (toolkit), including a class library and tools for cross-platform. While compile qt application under FreeBSD you get error:
/bin/uic about.ui -o about.h
/bin/uic:No such file or directory
*** Error code 1
Stop in /home/projects/nqe.
To get rid of this problem:
1) To compile application under QT define QTDIR variable (assuming you are using...