Thursday, December 31, 2009

An Inside Look At Warhammer Online's Server Setup

From Slashdot:

An article at Gamasutra provides some details on the hardware Mythic uses to power Warhammer Online, courtesy of Chief Technical Officer Matt Shaw and Online Technical Director Andrew Mann. Quoting: "At any given time, approximately 2,000 servers are in operation, supporting the gameplay in WAR. Matt Shaw commented, 'What we call a server to the user, that main server is actually a cluster of a number of machines. Our Server Farm in Virginia, for example,' Mann said, 'has about 60 Dell Blade chassis running Warhammer Online — each hosting up to 16 servers. All in all, we have about 700 servers in operation at this location.' ... 'We use blade architecture heavily for Warhammer Online,' Mann noted. 'Almost every server that we deploy is a blade system. We don't use virtualization; our software is somewhat virtualized itself. We've always had the technology to run our game world across several pieces of hardware. It's application-layer clustering at a process level. Virtualization wouldn't gain us much because we already run very close to peak CPU usage on these systems.' ... The normalized server configuration — in use across all of the Mythic-managed facilities — features dual Quad-Core Intel Xeon processors running at 3 GHz with 8 GB of RAM."

Why Coder Pay Isn't Proportional To Productivity

From Slashdot:

Why Coder Pay Isn't Proportional To Productivity
"John D. Cook takes a stab at explaining why programmers are not paid in proportion to their productivity. The basic problem, Cook explains, is that extreme programmer productivity may not be obvious. A salesman who sells 10x as much as his peers will be noticed, and compensated accordingly. And if a bricklayer were 10x more productive than his peers, this would be obvious too (it doesn't happen). But the best programmers do not write 10x as many lines of code; nor do they work 10x as many hours. Programmers are most effective when they avoid writing code. An ├╝ber-programmer, Cook explains, is likely to be someone who stares quietly into space and then says 'Hmm. I think I've seen something like this before.'"

Wednesday, December 23, 2009

An Open Source Compiler From CUDA To X86-Multicore

From Slashdot:

An Open Source Compiler From CUDA To X86-Multicore

"An open source project, Ocelot, has recently released a just-in-time compiler for CUDA, allowing the same programs to be run on NVIDIA GPUs or x86 CPUs and providing an alternative to OpenCL. A description of the compiler was recently posted on the NVIDIA forums. The compiler works by translating GPU instructions to LLVM and then generating native code for any LLVM target. It has been validated against over 100 CUDA applications. All of the code is available under the New BSD license."

Monday, December 21, 2009

X11 Server Setting No Mouse, Try AllowEmptyInput

Upon setting up FreeBSD 7.2 from 6.4, I though that unrolling the tarball would do it. I did copy xorg.conf to /etc/X11, but no luck. I then read the error log (/var/log/Xorg.0.log). After a search on, I did see a reference on to how to TURN OFF all keyboard and mouse input by adding to the Section "ServeFlags"

Option "AllowEmptyInput" "True"

I reversed it to

Option "AllowEmptyInput" "False"


Tuesday, December 15, 2009

Fork Bomb

The bash fork() bomb
:(){ :|:& };:
This is a bash function. It gets called recursively (recursive function). This is most horrible code for any Unix / Linux box. It is often used by sys admin to test user processes limitations (Linux process limits can be configured via /etc/security/limits.conf and PAM).

Once a successful fork bomb has been activated in a system it may not be possible to resume normal operation without rebooting, as the only solution to a fork bomb is to destroy all instances of it.

Understanding :(){ :|:& };: fork() bomb code

:() - It is a function name. It accepts no arguments at all. Generally, bash function is defined as follows:

echo ''
#do_something on $arg argument

fork() bomb is defined as follows:


:|: - Next it call itself using programming technique called recursion and pipes the output to another call of the function ':'. The worst part is function get called two times to bomb your system.

& - Puts the function call in the background so child cannot die at all and start eating system resources.

; - Terminate the function definition

: - Call (run) the function aka set the fork() bomb.

Sunday, December 13, 2009

OpenDarwin has Shut Down!

When did this happen?   I am finally getting around to developing a mac app. I wanted to use SDL and they had a great ports collection apparently that is now GONE! Shit.

OpenDarwin Shutting Down
OpenDarwin was originally created with the goal of providing a development environment for building and developing Mac OS X sources as well as developing a standalone Darwin OS derivative. OpenDarwin was meant to be a development community and a proving ground for fixes and features for Mac OS X and Darwin, which could be picked up by Apple for inclusion in the canonical sources. OpenDarwin has failed to achieve its goals in 4 years of operation, and moves further from achieving these goals as time goes on. For this reason, OpenDarwin will be shutting down.
Over the past few years, OpenDarwin has become a mere hosting facility for Mac OS X related projects. The original notions of developing the Mac OS X and Darwin sources has not panned out. Availability of sources, interaction with Apple representatives, difficulty building and tracking sources, and a lack of interest from the community have all contributed to this. Administering a system to host other people's projects is not what the remaining OpenDarwin contributors had signed up for and have been doing this thankless task far longer than they expected. It is time for OpenDarwin to go dark.
Project admins for all active projects have been notified, and we will be working with them to provide as seamless a transition to their new homes as possible. We don't want to boot anyone off, we will be operating the machines as usual for several months, until everyone has had a chance to move elsewhere.
We will continue to provide email and dns redirection after the machines go dark. We'll be looking at what other redirection services are needed and can be provided after hosting has ceased.
The OpenDarwin team would like to thank everyone who did contribute to the project, and our apologies to active, loyal projects that have to move.
- OpenDarwin Core Team and Administrators

Thursday, November 19, 2009

Method for "The INSECURE X11" connection

If you have already setup an ssh connection to your remote machine, then getting the X11 client application (on the remote) to show up on your (local) diplay is easy.


Before you login to the remote machine make sure your X11 server (Note: the server runs the display, not the programs, clients, or applications.), make sure it is listening for TCP connections. MANY X11 display managers have this turn OFF by default, John has shown how to do this in his article for gdm (gnome)

I use icewm, so I just use startx(1). As such, the following is at the end of my .login file.

echo Starting X in 3 seconds
sleep 3
startx -listen_tcp

Next, login to the remote machine and at the commandline enter:

$ export DISPLAY=

then test your connection with

$ xterm

Then rather than hardcode the display add the following to your .chsrc or .bashrc file:

if [ -n "$SSH_CLIENT" ]
X=`echo $SSH_CLIENT | cut -f 1 -d " "`
# The insecure way
#export DISPLAY=$X:0.0
# The secure way
if [ "$X" = "" ]
export DISPLAY=
#echo X $X

NOTE #1: Substitute your domainname or your IP for

NOTE #2: Your SSH shell/terminal will not close, if you have an X application running the secure way.

NOTE #3: This method is extremely useful, if you have control of your firewall.

Wednesday, November 18, 2009

Tech World Anagrams

Tech World Anagrams

Some are better then others.

Medical Marijuana = AN IDLE JAMAICA RUM

Thomas Edison = ATOMS DO SHINE
Albert Einstein = TEN ELITE BRAINS

Microsoft = IS COMFORT
Microsoft Windows = I'D WOW CONFORMISTS
Microsoft Windows Xp = WORM DOWNS PC, SO FIX IT
Microsoft Word = IFORMWORST.DOC
Microsoft Office = IS OF COMIC EFFORT
Microsoft Vista = FASCIST OR VOMIT
Microsoft Windows Vista = OVATIONS WORM SWIFT DISC
Microsoft Windows seven = NOW SNOW-COVERED MISFITS

Sun Microsystems = COSTS MESS - MY RUIN
Sunsoft = NOT FUSS

Freebsd Unix = BURNED FIXES
Netbsd unix = BID NEXT SUN
Openbsd Unix = INDEX UP SNOB
Berkeley System Distribution = TRUSTILY. BEE'S KNEES MORBIDITY
Berkeley Software Distribution = SWEATIEST OR BROKENLY BRUTIFIED
Debian Linux = I ANNEX BUILD
Redhat Linux OS = Dear! Lush Toxin = IN HOARD EXULTS
Fedore Core OS = FREE CODE OR SO
Fedore Core Linux = IF DELUXE CROONER
Linus Torvalds = STUN AVID ROLLS

Public Domain = BULIMIAC POND



-- TOADEATER [Originally, a charlatan's helper who ate (or pretended to eat) poisonous toads so that his employer could display his prowess in expelling the poison.]

Internet Guru = TURGENT URINE

World Wide Web = BORED, IDLE? - "W.W.W."
Network Solutions = NOW STINK OUT LOSER
Internic = IN CRETIN
Internet protocol = COOL! NOT INTERPRET

Boarder Gateway Protocol = COWPAT OR DEROGATORY ABLE

Secure Shell = HER CLUELESS

Universal Serial Bus = ILLUSIVE AS RARE SNUB


T One Line = NON-ELITE
Co Location = COOL ACTION!
Server Room = ERRORS MOVE
Beowulf Cluster = WE'LL BRUTE FOCUS

Relational Database = INALTERABLE AS A TOAD

High Definition Television = OH NO! THIEVING INFIDELITIES
Music Television = SIT, VOLUME IS NICE
Blue Ray Disk = IS BULKY DEAR

Silicon Valley = SOCIAL 'N' LIVELY & Villainy Close


Pacific Bell = IF CLIP CABLE

Computational Chemistry = PSYCHOTIC, MEAN MUTILATOR

high speed internet = EIGHTH SERPENTINED
This is really interesting in many mythologies. Gnostic, Hundu, Egyptian, Japaneses

Now to really blow your mind!
If your wondering how some of these anagrams ring true then think about these anagrams


Messages In Anagrams = A MASSAGER MANGINESS
massage is to manipulate
manginess is defined as Mean; contemptible

Anagram Studies = Sugared Stamina & ARGUED SATANISM & Grade us, I'm Satan!

Friday, November 13, 2009

X Windows over ssh

Before we can get started you must enable your local X Server to recieve from the network.

To do this in Linux in edit /etc/X11/gdm/gdm.conf


You will need to reboot your Linux box or restart the X-server which is more then I care to try to explain here. 

ssh -R 6001:

sokol@'s password: xxxxx
Last login: Fri Apr 1 12:04:48 2005 from

[sokol@localhost ~]$ xterm -display

-- THEN an Xterm will pop-up on your local machine.

If you install cygwin on your windows PC this will also work using the X server in cygwin, or my favorate is using Hummingbird Exceed ( I have an ancient copy I use) on windows but over the ssh on Cygwin

Works great. I can run synaptic remotely and almost all X-apps that don't do high end graphics like games or video.

How to get a password-less Putty Session

==How to get a password less Putty Session==
Putty is the virtual ssh terminal under with windows.

Download putty-sshgen

Run putty-sshgen & generate keys

Go to the putty configuration for the session you want to be passwordless.

Add an entry for the ssh private key

Login to your linux/bsd server

Add to ~/.ssh/authorized_keys the public key in the following fashion
  1. add a blank line
  2. add "ssh-rsa" with a blank space
  3. add the putty-sshgen public key, without the dashes, and all on one line.
When done ~/.ssh/authorized_keys should look like this:
       ssh-rsa 3NzaC1yc2EAAAAA--- RANDOM CRAP HERE ---aC1yc2EAA=

Tuesday, October 20, 2009

Fair Use Statement

I just want to take a moment here to point out something.

Fair Use Statement

This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. Such material is made available in an effort to advance understanding of issues of environmental and humanitarian significance. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those who have expressed a prior interest in receiving the included information for research and educational purposes.

Monday, October 19, 2009

My notes on TCP/IP stacks.

Please excuse, some if this is just stuff I grabed off of web sites for further investigation.

TCP/IP stacks

Mini TCP/IP stacks.


lwIP    lwIP is significantly more complex

uC/IP   uC/IP - TCP/IP for microcontrollers

Alpine - user space TCP/IP  (have source code somewhere)
UPDATE July 20, 2011:
I found my Alpine code, but it's only the Alpine4Linux. 

The file can be downloaded from :
I'd like to put these up on source forge or at least something like where the code can no longer get lost. 

Daytona ""


> i want to move tcp/ip stack(including routing and
> netfilter) to userspace, my goal is to trace all the
> instructions involved in a firewall and router since i
> don't know how to trace these instructions inside the
> kernel. i want to get something like:
> incoming ip packets(a file)-->fake ISR-->tcp/ip
> stack-->outgoing ip packets( to /dev/null).
> my question is: is it possible and relatively easy to
> move tcp/ip stack to user space?
This comes up fairly frequently, it might be a good addition to the FAQ.
Here's my attempt at an answer culled from prior messages.

Several people have user-mode network stacks at various levels of
development, but it is *highly* unlikely for them ever to get into
the kernel proper (see the monolithic versus microkernel debate at

Here are some URLs to which you can refer for more information:

However, for security purposes, you probably do not want a user-mode stack.
You want an extensible packet handling mechanism, and can be found with:
        iptables/ipchains -- the native Linux firewalling tools,
        tc -- the Traffic control program,
        libpcap -- packet capture library,
I've started a syncookie fw using a daemon process  ???

I do this using the REDIRECT ( ipchains ) / QUEUE ( ipfilter ) targets,
to get the packets to userspace. Once there, you can do what you want
using libpcap or syuscalls.


[10] C.A. Thekkath, T.D. Nguyen, E.Moy and E.D.
Lazowska, ‘Implementing Network Protocols at User
Level,’ in Proceedings SIGCOMM 1993,
San Francisco, pp. 64-73, September, 1993.

[13] C. Maeda and B.N. Bershad, ‘Protocol service
decomposition for high-performance networking,’ in
14th ACM Symposium on Operating Systems
, December 1993.

[15] G.L. Peterson, “Myths about the mutual exclusion
problem,’ in Information Processing Letters, Vol. 12,
No. 3, pp. 115-116, June 1981.
A Appendices
A.1 Peterson’s algorithm
Peterson’s algorithm for mutual exclusion between two
processes is as follows (also see [15]):
while (wantAccess[YOU] && nextAccess==YOU)
/* Add yield code here */

A.2 Edwards’ Algorithm
This algorithm for mutual exclusion exploits the fact that
the child process runs at real-time priority and so cannot be
pre-empted by the user process:
if (disable_child) {
/* If user process has disabled us
* then we block and wait for him to
* wake us up
/* We know child must be blocked at the
* moment (thus not holding lock) as it
* runs as a real-time priority so can
* not be pre-empted
if (wakeup_user_process) {
if (child_blocking) {


UPDATE July 20, 2011:
I found my Alpine code, but it's only the Alpine4Linux. 

The file can be downloaded from :


Date: Fri, 30 May 2003 11:53:23 -0700 (PDT)
To: or

Neelkanth Natu (

Hi all,

Alpine4Linux is a userlevel FreeBSD 4.8 networking stack running on top of a stock Linux kernel.  It is an implementation of an idea that I came across in a paper[1] by David Ely, Stefan Savage and David Wetherall.

Alpine4Linux consists of a userland server program that runs the FreeBSD kernel code as well as
the unmodified networking stack. Client programs use the Alpine stack by setting the LD_PRELOAD
environment variable to link to libraries, that intercept socket related system calls. These
intercepted system calls are routed to the Alpine server over a TCP connection established on the loopback interface.

Alpine4Linux goes great lengths to ensure that its behavior is identical to that of a FreeBSD
kernel as far as networking is concerned. Thus, in addition to the unmodified FreeBSD stack.
Alpine4Linux also has unmodified socket layer code, file descriptor code, tsleep and wakeup for
e.g. It also has a rich client-side library that supports almost all socket functions as well as
functions like fork() that are commonly used by server programs.

I have tested stock Linux programs like telnet, nmap, ifconfig, vsftpd-1.1.3 etc. against
the Alpine stack. I have only compiled it on a Redhat 8.x Linux box, so if someone manages to run it on another Linux distribution/kernel please let me know.

You can find more information at:

Hopefully someone finds use for this.


[1] Alpine: A user-level infrastructure for network protocol development
    David Ely, Stefan Savage, David Wetherall


Application-L evel Protocol Infrastructure for Network Experimentation


TCP Tahoe and Reno
TCP Vegas
TCP New Reno
TCP Hybla   high-latency terrestrial or satellite radio link
TCP BIC     In linux 2.6.8 through 2.6.18
TCP CUBIC  In linux  since version 2.6.19
Compound TCP (CTCP) is a Microsoft algorithm that is part of the Windows Vista and Window Server 2008 TCP
YeAH TCP - Yet Another Highspeed TCP - Linux

TCP Illinois congestion control. This is an implementation of TCP Illinois invented by Shao Liu at University of Illinois. It is a another variant of Reno which adapts the alpha and beta parameters based on RTT. The basic idea is to increase window less rapidly as delay approaches the maximum. See the papers and talks to get a more complete description

YeAH-TCP congestion control algorithm implementation. YeAH-TCP is a sender-side high-speed enabled TCP congestion control algorithm, which uses a mixed loss/delay approach to compute the congestion window. It's design goals target high efficiency, internal, RTT and Reno fairness, resilience to link loss while keeping network elements load as low as possible. For further details look here:

TCP cubic update for 2.6.22. The new version improves on its scalability, fairness and stability. So in all properties, we confirmed it shows better performance



web-enabled embedded systems

Many devices (printers, etc.) now use not just standard Internet Protocol but have a small web server embedded in them for input and to indicate status rather than using floppy disks or LCD panels or tiny little keyboards or other proprietary communication protocols.
[FIXME: Is there a better file for me to keep this category ?]
web appliances
[ Intelligent Instrumentation, Inc. data acquisition system ] is very similar ...


Fixing the Unfairness of TCP Congestion Control

"George Ou, Technical Director of ZDNet, has an analysis today of an engineering proposal to address congestion issues on the internet. It's an interesting read, with sections such as "The politicization of an engineering problem" and "Dismantling the dogma of flow rate fairness". Short and long term answers are suggested, along with some examples of what incentives it might take to get this to work. Whichever side of the neutrality debate you're on, this is worth consideration."

By 1999, the first P2P (peer-to-peer) application called Swarmcast began to blatantly exploit Jacobson’s TCP congestion control mechanism.  Using a technique called “parallel incremental downloading”, Swarmcast could grab a much larger share of the pie at the expense of others by exploiting the multi-stream and persistence loophole.  These two loopholes would be used by every P2P application since.

Mobile-ITX new super small PC motherboard form factor

This is a new standard PC motherboard form factor that is almost the same size as a cell phone.

Via CEO Wenchi Chen revealed a business card-sized motherboard billed as the "world's first industry-standard form-factor for PC/phone convergence," at Computex today. The "mobile-ITX" board measures 3 x 1.8 inches -- half the size of Via's "pico-ITX" form-factor -- and runs Linux or Windows XP Embedded.
Via's mobile-ITX board prototype
(Click to enlarge)

The mobile-ITX board that Chen demonstrated this morning appears to be based on a 1GHz "C7-S" processor -- apparently a standard Via
C7-M shoe-horned into a 9 x 11mm package. The chip had not previously been announced. The mobile-ITX board also apparently uses an "S" (small) version of the CX700 integrated north-/south-bridge chipset. And, it appears to have an on-board DC-DC converter. Additionally, according to Via, the board includes a CDMA baseband processor chip, suggesting that the mobile-ITX board could be used as the basis for x86-compatible smartphones.

Motorola phone compared to mobile-ITX

According to a brief item at EpiaCenter, Via's mobile-ITX board will be available with 256MB or 512MB of RAM soldered on-board, and will run Linux or Windows XP Embedded. Even an embedded version of Windows Vista may be too much for the little board, however, a Via spokesperson admits.

Chen stated, "This prototype Mobile-ITX gives a glimpse into the future of ultra mobile devices and the real convergence of computing and communications. Yet this is only the start. We see the platform shrinking still further, with ever richer blends of functionality, that will truly make ultra mobility the normal way of enjoying our content and our communications."

Marketing Manager Tim Brown with Via's NanoBook UMPC reference design, and CEO Chen with mobile-ITX prototype
(Click to enlarge)

Given that Chen positioned mobile-ITX as an "industry standard," lots of technical specifications about the form-factor should become available shortly. Meanwhile, EpiaCenter has posted a few photos, and a video, here

make depends

Dependency Management
The irony of Make

Advanced Auto-Dependency Generation

The Linux Kernel API

Documentation on many of the kernel API calls, with some searching I Found some excellent pages on this.

Linux USB drivers — Understanding and developing Linux USB drivers
Embedded Linux optimizations — Optimizing the Linux kernel and applications for speed, size, RAM, power and cost.

Advanced Linux Programming

millisecond tick in C++

To compile run
g++ -l pthread -o millisecondtick millisecondtick.cpp

Turned out I had to use one static member function to jump off onto another to get up and running.

/* millisecondtick.cpp
 * Creates Millisecond Tick 


#include "millisecondtick.h"

   Running = FALSE;

void* MilliSecond_Tick::runx(void *pMilliSecond_Tick){


int MilliSecond_Tick::start( pFnVoid func ){

pFnVoidVoid  prun;

  prun = runx;
   if (MilliSecond_Tick::Running != FALSE){
     printf("Error MilliSecond_Tick already started, can not start second instance\n");
     return 0 ;

  callback = func;
  pthread_create(&tid, NULL, prun , this);
    Running = TRUE;

  return 0;

void MilliSecond_Tick::stop(){
MilliSecond_Tick::Running = FALSE;
pthread_join(tid, NULL);


void MilliSecond_Tick::tick(){

void* MilliSecond_Tick::run(void * nothing){

    struct sched_param sparam;

    sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
    if (pthread_setschedparam(pthread_self(), SCHED_FIFO, &sparam) == 0) {
                        // success, this application has sufficient privileges
    else {
            // setting priority failed, probably due to insufficient privieges

    for (;;) {                           // for-ever loop of the ticker thread
        static const struct timespec nanowait = {0, 0*1000*1000};    // 1 ms
        nanosleep(&nanowait, (struct timespec *)0);

     if (Running == FALSE){


void tickss( ){
 static int x = 0, y = 0;
  if (x > 1000){
     x = 0;

int main(){

 MilliSecond_Tick cmt;

 cmt.start(&tickss );



// millisecondtick.h


#define TRUE 1
#define FALSE 0 

typedef void(*pFnVoid)();
typedef void*(*pFnVoidVoid)( void *);

class MilliSecond_Tick
    int  Running;
    pFnVoid callback; 
    pthread_t tid;
    static void *runx(void *pMilliSecond_Tick);
    void tick();

  int start( pFnVoid func ) ;
  void stop(); 
  void * run(void * nothing);

Wednesday, September 30, 2009

Virtual Hosting and other hosting. is offering Linux hosting starting at $15 a month. You get to be root on your own virtual server.
starts at 20Gig, disk space seem very expensive from them as you expand.

I am running 2 Co-Lo's now on FreeBSD. They never have problems, but it's an interesting prospect to get a virtual server, one of my friends is moving off the free Colo to one, basically because it offers compartmentalization for his customers.

IPOWERWEB  offers dedicated server hosting for $129 a month

But they offer regular FreeBSD web hosting through there GUI interface for $5.95 a month, I have a program on source forge rtelnet that allows you to open shell access on there web hosting accounts but there isn't much you can do on there boxes. Still it will run FreeBSD binaries that you can compile at home and upload to the CGI dir.
NOTE: I deliberately put a very simple bug in rtelnet to keep out the kiddies. It's really easy to fix. But I just don't want this to get misused by people that are really clueless.

Other interesting crap to put on the virtual server. 

FROM Wiki - Fetchmail  is an open-source software utility for POSIX-compliant operating systems which is used to retrieve e-mail from a remote POP3, IMAP, ETRN or ODMR mail server to the user's local system. It was developed from the popclient program, written by Carl Harris.  Its chief significance is perhaps that its author, Eric S. Raymond, used it as a model to discuss his theories of open source software development in a widely-read and influential essay on software development methodologies, The Cathedral and the Bazaar.

Web GUI mail packages (it's PHP)

Horde is a PHP-based Web application framework.

It offers applications such as the Horde IMP email client, a groupware package (calendar, notes, tasks, file manager), a wiki and a time and task tracking software.