CentOS Git server and OS X Client

Screen Shot 2012 01 07 at 11.41.36 CentOS Git server and OS X Client

Why?

One of the things we needed to establish for Cistec App Development was some sort of remote version control. Up until now we’d been using the world renowned Dropbox for working on our projects but it had several issues (updated in realtime, so if you attempted to compile after a colleague made a typo..).

After some googling to decide between the two version control systems Xcode will integrate with (SVN and Git) we went with Git thanks to some strong opinions on StackOverflow.

Read more

Launched an App Development Company

CistecNoShadowWhite 300x126 Launched an App Development Company

What

A colleague and I have setup Cistec App Development for your app development needs.

Why?

The reasons are two fold:

  1. We enjoy app development. There’s some little bit of magic to good app development, even a small piece of clever UI design can make people smile.
  2. The company we were previously employed at doing iOS development didn’t want to reassign resources to all the app development requests that were coming in.

So, drop us a line if you’re thinking of having an app developed.

Reduce search engine bot load without sacrificing all indexing

Recently we had an overworked machine with around 60% of the traffic coming from search engine indexing bots. We needed to stabilise the load but didn’t want to sacrifice all indexing and thus our SEO entirely.

This is the solution we came up with.
Read more

Use a SSH tunnel as a (Mac) system-wide SOCKS proxy to secure your traffic or bypass firewalls.

Alright, so before you push on through this post lets cover some basic scenarios where-by this might be useful:

  1. You’re on an insecure network and want to prevent your traffic being snooped on.
    All your traffic will be sent over SSH so it’ll all be encrypted to the point that it leaves your tunnel end.
  2. You want to get local access to a work or home network that’s behind a firewall.
    By tunnelling all your traffic through a host internal to that network requests will appear to come from it’s local address within that network, allowing you to access things you usually wouldn’t be able to remotely as if you were internal to the network.

Amusingly this was actually the best explanatory image on the subject of SSH tunnelling I could find, courtesy of an Engadget post here.

ssh tunnel diagram ht Use a SSH tunnel as a (Mac) system wide SOCKS proxy to secure your traffic or bypass firewalls.

Read more

Set decimal places from variable in Objective C

I recently needed to create a function that took an NSString as the input number and then another to specify the number of decimal places it was to be returned with and I thought I’d share. (in reality it expanded to also handle any multiplication and division I needed also).

It’s quite short but the awkwardness was in getting StringWithFormat to output what I needed.

+(NSString *) returnNumber:(NSString *)numberIn toDecimalPlaces:(NSString *)decimalPlaces
{
    // Assign the right number of decimal places:
    decimalPlaces = [NSString stringWithFormat:@"%%.%@f", decimalPlaces];
    NSString* result = [NSString stringWithFormat:decimalPlaces, numberIn];
 
    return result;
}

Here’s the expanded function managing everything I needed at the time:

+(NSString *) multiplyThenDivide:(NSString *)numberIn by:(NSString *)multiplicationFactorIn divideBy:(NSString *)divisionFactor toDecimalPlaces:(NSString *)decimalPlaces
{
    // Make arguments into floats so we can do operations on them:
    float numberInFloat = [numberIn floatValue];
    float multiplicationInFloat = [multiplicationFactorIn floatValue];
 
    // Do those operations:
    float resultFloat = numberInFloat * multiplicationInFloat;
    resultFloat = resultFloat / 100;
 
    // Assign the right number of decimal places:
    decimalPlaces = [NSString stringWithFormat:@"%%.%@f", decimalPlaces];
    NSString* result = [NSString stringWithFormat:decimalPlaces, resultFloat];
 
    return result;
}

By no means a master class, but hopefully it’ll help someone at some point.

Courier-imap and Outlook”s idle errors

We had a staff member that was intermittently seeing the error:

Your IMAP server closed the connection. This can occur if you leave the connection idle for too long.

This was rather tedious as it grabbed focus and had to be acknowledged before you could use Outlook again. I edited imapd which I found at /usr/lib/courier-imap/etc/imapd and changed the following:

IMAP_ENHANCEDIDLE=1
IMAP_USELOCKS=1

I also made sure that IMAP_CAPABILITY had IDLE in it”s list and that appeared to fix it. Apparently it”s something to do with shared mailboxes, IDLE and some email clients not playing nice.

Yum – Install a specific version that’s not in the repos

Long story short, I needed PHP 5.2.17. The CentOS repos still had 5.1.x and all third partys seemed to be way up at 5.3.x.

In the end I located a web repository that contained the PHP RPM I needed (php-5.2.17-1.el5.i386.rpm) but when I did;

yum local install php-5.2.17-1.el5.i386.rpm

It told me that I needed some other dependencies:

Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-soap-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-mbstring-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-xml-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-gd-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-mysql-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-ldap-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-imap-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-xmlrpc-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-mcrypt-5.2.16-jason.1.i386 (installed)
Error: Missing Dependency: php-common = 5.2.16-jason.1 is needed by package php-pdo-5.2.16-jason.1.i386 (installed)

Read more

Run multiple dropbox instances on Mac OS X

dropbox coverflow 300x266 Run multiple dropbox instances on Mac OS X

I threw this process together because I was already an avid dropbox user and needed to start doing some joint iOS development with a friend and suggested we make use of dropbox as a centralized project store. Naturally I wanted to keep mine and ours separate so I needed to run dual instances because I didn’t want to be logging in and out all the time.

Please don’t just use this to get around the 2GB free limit.
Read more

Generate arbitrary network traffic

We recently wanted to do some network tinkering but we needed to generate large volumes of traffic to test how it behaved.

After some searching I came across hping which allowed me to generate large packets quickly. I yum installed hping, from RPM forge I believe.

The below command then generated about 25Mbit per second until it was stopped:

hping2 targethost -d 65400 --faster

Using ClamAV to find php shells and other nasties

I was recently suprised at how efficient ClamAV is at detecting PHP shells, something shared hostings are plagued with. I thought I’d share how to install and search for them.

clam 300x300 Using ClamAV to find php shells and other nasties

Read more

Return top