Monthly Archives: November 2011

C character arrays (K&R exercice 1-17)

Back on the K&R book, still working through the ‘Tutorial Introduction’ and in the character array section. Here is my solution to Exercise 1-17: print out all lines with 80 or more characters. #include <stdio.h> #define MAXLINE 1000 // This … Continue reading

Posted in C | Tagged , , , , | Leave a comment

Starting C for Perl coders

In my quest to write an ‘app’ for the iPhone, I’ve been sidetracked into learning ANSI-C from scratch to give me a grounding for C++ and Objective-C. Why you may ask? Well it occurred to me that as FreeBSD in … Continue reading

Posted in C | Tagged , , , , | Leave a comment

C Arrays

Here are some C programs from the K&R book with reference to arrays. This resonated with the Perl hashes as this task is nearly always done with a hash, but as C has no hashes, here we go with an … Continue reading

Posted in C | Tagged , , , | Leave a comment

Objective-C decisions vs Perl descisions

I’m comparing Objective-C decision making with our beloved Perl decision making. Objective-C supports the if, else, else if & switch. Lets write some Objective-C code and write the Perl in parallel. #import <Foundation/Foundation.h> int main (int argc, const char * … Continue reading

Posted in C, Perl | Tagged , , , , | Leave a comment

Objective-C loops

After finding another hour to read some more ‘Objective-C’ instruction, I’ve covered some looping techniques which are all again valid in Perl and ANSI C. My text covers the for, while and do loops, and heres the sample program… #import … Continue reading

Posted in C | Tagged , , , , | Leave a comment

FreeBSD ZFS Deduplication

Time to prove or disprove the ZFS dedup capabilities. First its important to understand that as with compression, if we change the settings on the storage block then only new data written to that area will be de-duped or compressed. … Continue reading

Posted in FreeBSD Administration, ZFS | Tagged , , | Leave a comment

Quick MySQL backups

As a hosting provider we are often asked to provide a backup or dump of a mysql database. The easiest way to do it is to performa MySQLdump into a file into the webspace and the secure it with file … Continue reading

Posted in Apache, FreeBSD Administration, MySQL | Tagged , , , | Leave a comment

FreeBSD ZFS – Connecting an existing zpool to a new OS

Imagine that you have your server with an external RAID array running a ZFS file system, or even a separate internal array on the box and the OS array is trashed. Now you have your nice redundant ZFS partition, but … Continue reading

Posted in FreeBSD Administration, ZFS | Tagged , , , | Leave a comment

ModSecure – exempting a domain

Having installed modSecure2 onto a few web servers, it seems that, even with the base_rules do not get on well with Actinic software. Our options were to start removing rules from within the base_rules set or simply exclude the domain … Continue reading

Posted in Apache, FreeBSD Administration | Tagged , , , | Leave a comment

FreeBSD Jails with EZJail

The last post was a success in that a jail was created and everything worked fine and as expected. However, before I go charging off to the server store and configuring my production server, I’m going to do a bit … Continue reading

Posted in FreeBSD Administration | Tagged , , | Leave a comment