Dec 09 2009

Atheros Wireless Interface on Linux Ubuntu

Published by under Linux




I was surprised ifconfig wouldn’t return an interface for my Atheros chipset based Netgear wireless card. Unlike Redhat, Madwifi does not seem to compile on Ubuntu, no matter what version is used. Kernel headers installed, I keep getting the same error:

/root/madwifi-0.9.4/net80211/ieee80211_power.c:
In function 'ieee80211_pwrsave':
/root/madwifi-0.9.4/net80211/ieee80211_power.c:240:
error: implicit declaration of function '__skb_append'
make[3]: *** [/root/madwifi-0.9.4/net80211/ieee80211_power.o]
Error 1
make[2]: *** [/root/madwifi-0.9.4/net80211] Error 2
make[1]: *** [_module_/root/madwifi-0.9.4] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-generic'
make: *** [modules] Error 2

Seems to be some changes in the newest kernels. A solution is to install madwifi-ng.

Start installing svn

root@ubuntu:~# aptitude install subversion

And follow instructions on madwifi-ng website. It’s pretty straightforward.

I also noticed wpa_supplicant was provided on Ubuntu but does not support the madwifi driver. Hence, it’ll need to be compiled as well.
Don’t forget to install openssl and its libs:

root@ubuntu:~# aptitude install openssl libssl-dev

You can then follow instructions on my WPA howto to connect to your wireless network.

 

No responses yet

Oct 13 2009

Command History with Arrow Keys in ksh

Published by under Aix,Linux,Misc,Solaris

Arrows aren’t used in ksh as a default. To enable command history like in Bash, add the following lines in the .profile or .kshrc file:

# Switch to Emacs mode
# Only Emacs mode lets you make use of arrow keys
set -o emacs

# Go back in command history (up arrow)
alias __A='^P'

# Go back in command history (down arrow)
alias __B='^N'

# Move right on the command line (right arrow)
alias __C='^F'

# Move left on the command line (left arrow)
alias __D='^B'

 
^P, ^N, etc aren’t one single character. Enter Ctrl-V and Ctrl-P to display them in vi.
 
Auto-completion is only available for files, not commands. Press either twice on the escape key, or the tab key on newer systems.
 

 

One response so far

Oct 04 2009

Compiling Freeradius with Oracle Support

Published by under Freeradius,Oracle

Compilation Error?




The Oracle client being installed (11g R2 in my setup), Freeradius doesn’t seem to find Oracle headers.
I get the following error message:

Error compiling Oracle/Freeradius
configure: WARNING: oracle headers not found. 
Use --with-oracle-home-dir=<path>.
configure: WARNING: silently not building rlm_sql_oracle.
configure: WARNING: FAILURE: rlm_sql_oracle requires: oci.h.

 
Specifying the path to –with-oracle-home-dir doesn’t change anything at all.
 

Installing Oracle Client

Install Oracle runtime client to get necessary headers for applications.
I won’t focus on this since this is not the subject. More information is available on Oracle.
 

Compiling Freeradius

I thought I could get out of this giving the compiler the path to oci.h like:

CFLAGS=-I/home/oracle/app/oracle/product/11.2.0/client_1/rdbms/public

 

But, I am still getting errors. Before finding out environment variables need to be set as for any Oracle user:

ORACLE_BASE=/home/oracle/app/oracle
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/client_1

Freeradius has automated libraries detection with Oracle variables.

 

No responses yet

Sep 28 2009

TCP Offload

Published by under Windows




TCP Offload Engine (or TOE) transfers network processing load, from the CPU (software) to the network controller (hardware). The network card needs to support TOE such as the HP NC382T. This functionnality is disabled after the server installation.
 

Check if TOE is enabled

 
Windows 2003
The activation can only be checked with the registry key EnableTCPChimney under HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters 
 
Windows 2008

C:\>netsh int tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : enabled
Receive Window Auto-Tuning Level    : disabled
Add-On Congestion Control Provider  : ctcp
ECN Capability                      : disabled
RFC 1323 Timestamps                 : disabled

 
The important line here is Chimney Offload State.
 

Enabling/Disabling

 
Windows 2003

netsh int ip set chimney ENABLED
netsh int ip set chimney DISABLED

 
Windows 2008

netsh int tcp set global chimney=enabled
netsh int tcp set global chimney=disabled

 

Linux

TCP Offload isn’t supported in Linux for different reasons described on the Linux Foundation website.
 

Improvements

It is stated that 1Gb of traffic roughly requires 1Ghz of CPU resource. In this matter, TCP Offload is only valuable for Gigabit interfaces, with an important traffic flow. It especially suits servers with iSCSI interfaces.
These are the numbers I’ve seen on servers and it’s quite impressive. CPU usage remains close to 0 during heavy traffic processing. I’ve had no problem so far since it’s been enabled.
 

Issues

It isn’t advised to enable TOE on servers running firewall, IPSEC and IPNAT applications. There are side effects: http://support.microsoft.com/kb/948496

 

No responses yet

Sep 27 2009

Findstr, a Native Alternative to grep in Windows

Published by under Windows

A builtin equivalent to the Unix/Linux grep command is available in Windows, a bit less powerful though: findstr. You can do searches based on patterns, still in a measured way.
You don’t need to install anything, it is natively present on all Windows flavours.


Findstr Options

C:\>findstr /?
Searches for strings in files.

FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
[/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
strings [[drive:][path]filename[ ...]]


/B Matches pattern if at the beginning of a line.
/E Matches pattern if at the end of a line.
/L Uses search strings literally.
/R Uses search strings as regular expressions.
/S Searches for matching files in the current directory and all
subdirectories.
/I Specifies that the search is not to be case-sensitive.
/X Prints lines that match exactly.
/V Prints only lines that do not contain a match.
/N Prints the line number before each line that matches.
/M Prints only the filename if a file contains a match.
/O Prints character offset before each matching line.
/P Skip files with non-printable characters.
/OFF[LINE] Do not skip files with offline attribute set.
/A:attr Specifies color attribute with two hex digits. See “color /?”
/F:file Reads file list from the specified file(/ stands for console).
/C:string Uses specified string as a literal search string.
/G:file Gets search strings from the specified file(/ stands for console).
/D:dir Search a semicolon delimited list of directories
strings Text to be searched for.
[drive:][path]filename
Specifies a file or files to search.

Use spaces to separate multiple search strings unless the argument is prefixed
with /C. For example, ‘FINDSTR “hello there” x.y’ searches for “hello” or
“there” in file x.y. ‘FINDSTR /C:”hello there” x.y’ searches for
“hello there” in file x.y.

Regular expression quick reference:
. Wildcard: any character
* Repeat: zero or more occurrences of previous character or class
^ Line position: beginning of line
$ Line position: end of line
[class] Character class: any one character in set
[^class] Inverse class: any one character not in set
[x-y] Range: any characters within the specified range
\x Escape: literal use of metacharacter x
\<xyz Word position: beginning of word
xyz\> Word position: end of word

For full information on FINDSTR regular expressions refer to the online Command
Reference.


Command Usage Example

Pipe the previous command result to findstr, as you would with the grep command in Linux:

C:\>netstat -an | findstr 0.0.0.0
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1033           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING
  TCP    10.0.0.10:139          0.0.0.0:0              LISTENING
  TCP    10.1.0.10:139          0.0.0.0:0              LISTENING
  TCP    192.168.15.240:139     0.0.0.0:0              LISTENING
  UDP    0.0.0.0:445            *:*
  UDP    0.0.0.0:500            *:*
  UDP    0.0.0.0:4500           *:*
 

3 responses so far

« Prev - Next »