RAM Disk: A Very Interesting Idea…

Ξ June 29th, 2010 | → 0 Comments |
Tools |, , , |

Simply run:

$ mkfs -q /dev/ram1 8192   # 8192 = 8MB disk capacity
$ mkdir -p /mnt/ramcache
$ mount /dev/ram1 /mnt/ramcache
$ df -H | grep ramcache

to mount your own mini ramdisk.

For more details, here and here are some references I found on the subject.

You might ask yourself “Why does this guy needs a ramdisk?… What a geek!”, and wouldn’t mind. It was kind of a epiphany, when I remembered to use a ramdisk to run a “‘Lack of space’ Test Case” on the application I’m building right now.
After running the application, I just had to copy a mp3 album to occupy the remaining disk space… et voilá, welcome the expected “error message”. No, not a SIGSEGV, a real error dialog!…

 

Getting help…

Ξ November 3rd, 2009 | → 0 Comments |
Development |, , , |


There is nothing that provides more help to a Linux SW developer than the manual pages. Here’s how to install them in a Debian based system (i.e. my desktop ubuntu system):

sudo aptitude install manpages manpages-dev manpages-posix-dev

 

Windows Doesn’t Have a Shell

Ξ June 13th, 2009 | → 0 Comments |
Tools |, , , , |

Being a Linux fan doesn’t mean that all my work gets done in Debian, Ubuntu, Red Hat, Fedora or Suse. Most of the times a simple execution of the Virtual Box is enough to write that document in Word or prepare that presentation in Powerpoint. But some times, work demands a true change of pace and there I go back to Windows (usually the stable XP version, available in any dual boot machine near you…). For example when you need to use Microsoft Visual Studio, DOORS (a requirements management system, for those how never has the pleasure) or even Enterprise Architect, you’ll need the good ol’ Windows operating system.

This is not a complaint about developing software in a Windows environment, but there are somethings you grow accustomed after a while developing in Linux. For me the greatest difference is the shell, or the lack of it in Windows. The shell is my favorite tool to inspect the details of my build artifacts.

I make a few searches on the web but couldn’t find a real replacement for the simple bash shell available at any basic Linux system. There are some possibilities, but none of them are the same as running the “real thing”:

- install Cygwin
you might have this already installed  if you need an XServer to run remote DISPLAY applications, although XMing is a better (lighter) choice for that matter

- install andLinux, but I felt the system performance degrading by the minute

- install Portable Ubuntu [1,2] (my favorite choice!)

 

Fortune

Ξ May 12th, 2008 | → 0 Comments |
Humor |, , , |

A Tale of Two Cities LITE(tm)
– by Charles Dickens

A lawyer who looks like a French Nobleman is executed in his place.

The Metamorphosis LITE(tm)
– by Franz Kafka

A man turns into a bug and his family gets annoyed.

Lord of the Rings LITE(tm)
– by J. R. R. Tolkien

Some guys take a long vacation to throw a ring into a volcano.

Hamlet LITE(tm)
– by Wm. Shakespeare

A college student on vacation with family problems, a screwy
girl-friend and a mother who won’t act her age.

by fortune(6)

 

Handling SIGSEGV Signal

Ξ May 9th, 2008 | → 0 Comments |
Development |, , , , |

Soon or later, your Linux developed C/C++ code will generate a SISEGV signal and your application will miserably crash. This signal is generated when a program tries to read or write outside the memory that is allocated for it, or to write memory that can only be read. (Actually, the signals only occur when the program goes far enough outside to be detected by the system’s memory protection mechanism.) The name is an abbreviation for “segmentation violation”.

In order to improve your program, and terminate in a controlled way, you can register a custom function to handle such signal. The following example shows the leave function that is called whenever a SIGSEGV signal is launched.

    #include

    #include

    void leave( int s ) {
        std::cout << "FATAL: Leaving due to SIGSEGV." << std::endl;
        exit( s );
    }

    int main() {
        // Register SIGSEGV handler!
        signal( SIGSEGV, leave );

        // originate a SIGSEGV
        double array[20];
        std::cout << array[10000] << std::endl;

        return 0;

    }

 

On the nightstand...


    The Art of Agile Development


    Beautiful Architecture


    Modern C++ Design


    Large Scale C++ Software Design

Personal

Friends


Interesting


Shared Readings