Skip to content

Compiling CURL on OS X as a Static + Universal binary.

I’ve taken the liberty of adapting the given framework script to produce static libraries. Keep in mind that on Mac OS X 10.6 and > there is no ppc64 support so in order to use this script on that OS you’d first remove that support.


#!/bin/bash
# This script performs all of the steps needed to build a static
# universal binary libcurl.a for Mac OS X 10.5 or greater.

cd curl

VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`

SDK32='/Developer/SDKs/MacOSX10.5.sdk'

MINVER32='-mmacosx-version-min=10.5'

ARCHES32='-arch ppc -arch i386'

SDK64='/Developer/SDKs/MacOSX10.5.sdk'

MINVER64='-mmacosx-version-min=10.5'

ARCHES64='-arch ppc64 -arch x86_64'

echo "----Creating 32 bit ..."

if test -d $SDK32; then
echo "----Configuring libcurl for 32 bit universal ..."
./configure --disable-dependency-tracking --disable-shared \
CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32" \
CC=$CC

echo "----Building 32 bit libcurl..."
make

cp lib/.libs/libcurl.a lib/libcurl32.a

echo "----Creating 64 bit ..."

if test -d $SDK64; then
popd
make clean
echo "----Configuring libcurl for 64 bit universal ..."
./configure --disable-dependency-tracking --disable-shared \
CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64" \
CC=$CC

echo "----Building 64 bit libcurl..."
make

cp lib/.libs/libcurl.a lib/libcurl64.a

echo "----Merging 32 bit and 64 bit ..."

lipo lib/libcurl32.a lib/libcurl64.a -create -output lib/libcurl.a

fi

lipo -info lib/libcurl32.a
lipo -info lib/libcurl64.a
lipo -info lib/libcurl.a

echo "libcurl.a is built and can now be included in other projects."
else
echo "Building libcurl.a requires Mac OS X 10.5 or later with the MacOSX10.5.sdk installed."
fi


CURL

Apps: A handheld revolution.

Tomorrow January 7th at 10PM EST a one hour documentary will air on CNBC and affiliate stations. Some of my work is to be featured such as my iPhone and iPod Touch app dubbed “Cannabis”.

POA_Intro

More information may be found on the official website here.

More information about the “Cannabis” app may be found on the official website here.

Cannabis running in simulator:

Screen shot 2010-01-06 at 11.41.28 AM

The Cannabis App Website

Adam Fisk of LittleShoot Bounces Checks and Tosses Legal Threats.

I began work in December of 2008 with former Limewire engineer Adam Fisk on his new project LittleShoot. We cut a deal that was fairly simple 100 USD per hour for 50% of profits up until my contributed time has been paid off. The problem is that I had worked and earned some $52,000 USD but was only paid several thousand dollars of the entirety. This isn’t entirely because Adam didn’t pay, he attempted, but quickly began bouncing checks when he had depleted the company funds. I doubt I will ever see another dime from this Adam Fisk and the five to six months I so diligently worked with him on LittleShoot.

Below is Adam’s response to a Cease and Desist letter he received from me when I began to receive rubber checks.

Hi Julian-

As someone who I’ve worked very closely with in the recent past, it
saddens me things have gotten to this point. Given all that has taken
place, however, it’s unlikely I’ll communicate with you again except
through my lawyers and except through sending you checks as per our
initial contract. I want to make several points crystal clear,
however, as I don’t think any of this is in either of our interests.
Here goes:

1) As we’ve explicitly written time after time, our initial contract
was for you to receive 50% of LittleShoot profits up until you
received $100 per hour for the time you contributed. There was never
any ambiguity in this very simple and straightforward contract.
Unfortunately for both of us, LittleShoot has not made any revenue,
let alone profit. Even so, LittleShoot has compensated you as best it
could with checks of $1400, $1700, $2000, with the last two checks
paid on credit and clearly stretching the company beyond its financial
limit to provide you with income for your contributions despite still
never making a profit.

2) All of the code in the LittleShoot code base is licensed under the
GPL, as is clearly stated on our web site and as you were abundantly
aware in our many conversations as well as in our written
communications dating back to your first days working on LittleShoot.
Hundreds of developers have since downloaded and used the LittleShoot
code base under the GPL, and the GPL cannot be revoked.

3) LittleShoot owns the copyright to all of the code you contributed.
As someone I still consider a friend despite the many unfortunate
courses our relationship has taken, I will tell you my source for this
is none other than my longtime adviser on these matters, Eben Moglen,
former lead counsel for the FSF and chief enforcer of the GPL. I have
also consulted several other very knowledgeable copyright lawyers on
this subject. Because we compensated you for your work on LittleShoot
under your contract, your work falls under “work for hire.” This
means LittleShoot LLC owns the copyright, beyond it clearly being
licensed under the GPL. Note that I don’t need to tell you this, and
it may not be in my legal interest, but you should know your copyright
claims will not hold up in court before spending hundreds of thousands
of dollars you don’t have in an unsuccessful claim in addition to
paying any bills LittleShoot pays in the process (see item #6).

4) Extortion or threats of defamation will not persuade LittleShoot
and are of course illegal.

5) As I have stated countless times, LittleShoot will continue to
abide by its initial contract with you. As noted above, LittleShoot
has gone above and beyond in adhering to this contract since we
initially made it, and we will obviously continue to do so under
standard contract law.

6) You should also be aware the unsuccessful claimant in copyright
litigation can be ordered to pay all the defendant’s legal fees.

7) The potential LittleShoot angel investors are already abundantly
aware of you and your claims and have been for some time, as is the
LittleShoot advisory board. While it’s clearly not ideal, experienced
investors know potential litigation between early contributors is a
common obstacle for startups.

I know you have come to view me as your mortal enemy because you have
not received the money you hoped we would make in profit sharing and
are unlikely to take any advice from me as a result. Nevertheless, I
strongly urge you to seek knowledgeable counsel on this subject before
proceeding, particularly because you seem to think our series of
e-mails depicts some reality different from what I have just
described. To be very explicit, your Generalized Anxiety Disorder is
not your friend in this case, and it should not influence your legal
decisions. You should have a knowledgeable copyright lawyer you
really trust look at all of this before proceeding — look at every
e-mail and at every angle. You will undoubtedly view this as some
attempt at a trick, but bear in mind I am not like you and do not
think like you. I am generally far to open with information and far
too trusting. I will tell you your case is extremely weak despite
what you seem to think, and I have had the best people in the business
look at your case in particular very carefully. I am lucky enough to
have good friends with that knowledge, and hopefully you are too.

You can feel free to go public with whatever you like within the
bounds of defamation and extortion law. I say this because the more
the reality of what has occurred comes to light, the better
LittleShoot looks. You seem to think we should have paid you for your
work with money we don’t have and outside of your very clear and
explicit contract. I’m not exactly sure why you think this, but
you’re on very weak ground both legally and in the field of potential
public opinion.

Again, I am unlikely to respond to any future communications from you
except for through my lawyers, Julian, so I’ll just say best of luck
to you in everything, I still think of our time working together as
overall a positive one, and hopefully this will all be behind us
someday. Hopefully LittleShoot will also make a profit sooner rather
than later, in which case your initial contract clearly entitles you
to more compensation beyond what LittleShoot has already paid. You
can make it minimally more difficult for LittleShoot to make that
profit through your continued efforts, but I feel confident we will
make it no matter what occurs and will ultimately compensate you for
every minute you worked on LittleShoot.

All the Best,

-Adam Fisk
Founder
LittleShoot

Clearly this email isn’t about the “lack of ability to pay” but more about “don’t tell anyone I won’t pay”. It is clearly a threat and nothing more.

For the wall of shame here is one of Adam Fisk’s worthless rubber checks.

Note from bank: “This check deposited to your account was returned unpaid. Please contact the maker of the check for more information.”

Even though the note from the bank is what it is they closed that account due to “fraud”. Yes, depositing a check that isn’t “good” is now considered “fraud” in the eyes of “some” banks.

The economy is tight right now so remember don’t give something for nothing or at least obtain a retainer if you intend on doing contract work as apparently word of mouth doesn’t hold much water even with the once well respected people.

LittleShoot Website

Rudolph the Red-Nose Reindeer – Illuminati, Misfits

Oh, is this your snowbank? No, who are you? Well actually I am a dentist. A dentist? Well, I want to be someday. Right now I am just an elf. But I don’t need anybody. I’m independent. Yea? Me too! I’m whatever you said, uh, independent. Hey, what do you say we both be independent together?

Why must we still live a country where people lean to the left or right simply to argue? Is it not too simple to say the “pyramid” on the one dollar bill with the “illumination” also known as the “illuminati” is simply held vertical by fighting? Once the people stand still the pyramid will fall and the illumination will come crashing down.

The people are becoming more aware of this. The incrementalism has clamped them into uncomfortable positions no longer bearable. The utter nature of this pressure will lead to resistance. The republic has become too strong to fall at the hands of tyranny.

Rudolph the Red-Nose Reindeer

We are a couple of misfits. Whats a matter with misfits? That is where we fit in!

ClimateGate Dating Game

I’m going to be quick and to the point. I’ve never believed that Mammals were in any way shape or form related to global cooling/warming. I’d even go as far as to say that the entire “Green” movement is “mostly” built on the foundation of lies that is Anthropogenic Global Warming.

As a seasoned programmer with some 20 languages under my belt I do understand Fortran.

Some suspect code from briffa_sep98_d.pro that I have commented with inline C-Style for display purposes.


/* Lets cook the books between 1400 and 1938 some 19 times. */
yrloc=[1400,findgen(19)*5.+1904]

/* build date based array to manipulate (adjust) input data */
valadj=[0.,0.,0.,0.,0.,

/* begin hiding temperature declines */
-0.1,-0.25,-0.3,0.,- 0.1
/* end hiding temperature declines */

/* begin faking temperature rise */
,0.3,0.8,1.2,1.7,2.5,2.6,2.6,$2.6,2.6,2.6
/* end faking temperature rise */ ]*0.75 ; fudge factor

/**
* The fudge factor here will throw up a hockey stick for values equal to or greater than 1.2f.
*/

/**
* This is just a programmer error. What they are looking for is that the elements in each array are the "same" count. There is no failure protection here, simply a useless output message.
*/
if n_elements(yrloc) ne n_elements(valadj) then message,'Oooops!'
;
/**
* Complete the fraud.
*/
yearlyadj=interpol(valadj,yrloc,timey)

What it does:

This code adjusts input value (temperature) and by date so that it hides declines/rises from the 1400’s until 1948 with a sharp rise at the end.

The end result is a hockey stick graph:
hockey_crected

Fudge Factors:
These are commonly used depending on the code’s purpose. However in this case it is clear that it is used to alter the input values to “normalize” the data to “what they want” completely disregarding the “real” values.

I’ve found that other programmers have figured this out also:
here
As well about the code “in general” here on YouTube: here

Apple’s App Store, more delays

I just got a rejection on an iPhone and iPod Touch app because it now crashes according to Apple on iPhone OS 3.1.2.

Here is part of the email:

Hello Julian,

At this time, App cannot be posted to the App Store because it is crashing on iPhone 3G running iPhone OS 3.1.2

Steps:
1. Launch application.
2. Select “Don’t Allow” when the application asks if its ok to use Core Location.
3. Select the icon in top left corner to attempt to locate the user.
4. Application crashes.

Crash logs have been attached for your reference.

Ok thanks Apple but what about the backtrace?

Crashed Thread:  0

Thread 0 Crashed:

0   libSystem.B.dylib             0×31a279ac 0×319a9000 + 518572
1   libSystem.B.dylib             0×31a2799c 0×319a9000 + 518556
2   libSystem.B.dylib             0×31a2798e 0×319a9000 + 518542
3   libSystem.B.dylib             0×31a3c63a 0×319a9000 + 603706
4   libstdc++.6.dylib             0×3361d3b0 0×335d8000 + 283568
5   libobjc.A.dylib               0×32401858 0×323fc000 + 22616
6   libstdc++.6.dylib             0×3361b776 0×335d8000 + 276342
7   libstdc++.6.dylib             0×3361b7ca 0×335d8000 + 276426
8   libstdc++.6.dylib             0×3361b896 0×335d8000 + 276630
9   libobjc.A.dylib               0×32400714 0×323fc000 + 18196
10  CoreFoundation                 0×3253ed96 0×32511000 + 187798
11  MapKit                         0×33644b38 0×33633000 + 72504

Anyone that understands programming can see that the crash occured in Apple’s libraries and not in my code.
The culprit is this function in the MapKit library.
Crashed Thread:  0
Thread 0 Crashed:
0   libSystem.B.dylib             0×31a279ac 0×319a9000 + 518572
1   libSystem.B.dylib             0×31a2799c 0×319a9000 + 518556
2   libSystem.B.dylib             0×31a2798e 0×319a9000 + 518542
3   libSystem.B.dylib             0×31a3c63a 0×319a9000 + 603706
4   libstdc++.6.dylib             0×3361d3b0 0×335d8000 + 283568
5   libobjc.A.dylib               0×32401858 0×323fc000 + 22616
6   libstdc++.6.dylib             0×3361b776 0×335d8000 + 276342
7   libstdc++.6.dylib             0×3361b7ca 0×335d8000 + 276426
8   libstdc++.6.dylib             0×3361b896 0×335d8000 + 276630
9   libobjc.A.dylib               0×32400714 0×323fc000 + 18196
10  CoreFoundation                 0×3253ed96 0×32511000 + 187798
11  MapKit                         0×33644b38 0×33633000 + 72504

setRegion:animated:

Also this is not a crash outright. Apple’s code is raising an exception under what I see as an invalid condition and leading to a crash. The region can no longer be -180.0f, -180.0f. This feature was introduced in OS 3.1.2.

The fix:

if (region.center.latitude == -180.0f && region.center.longitude == -180.0f)

This will take ~14 days to make it through Apple’s system and be approved.

GigaOm deletes informational posts

I posted yesterday here detailed information about the closure of Skype on GigaOm. This post was deleted and the information I posted is today in the New York Times!

I posted again on GigaOm today this:

I posted yesterday that N/J and Skype were closing this deal and GigaOM deleted it. This is now in the NYT here:

http://www.nytimes.com/2009/11/04/technology/companies/04skype.html

Why did you delete my post? Why are you holding back information on purpose? Why are you not discussing the fact that Volpi’s career has ended permanently?

Listen everyone, Skype and N/J began talks last week with Skype to do a joint deal and take a portion with board membership. They are attempting to push this through this week and then it’s holiday for the legal teams next week.

Lets see if it stays or goes.

[update] I made a duplicate post here which remains a full TWO days before the NYT reported on it.

Bypass Skype SoftICE & Integrity Check

With all the political mess around Skype, Joltid, Joost, Index Ventures and others it would be nice to call out the liars. Yes Volpi I am talking to you and more than two handfuls of co-conspirators and at least seven companies. However doing so requires proving without a doubt that Skype contains code that it was not licensed to use or is to be considered as intellectual property theft. Keep in mind that this isn’t all about Skype as we will dive into Joost and others down the road.

Firstly in order to prove that some code exists in the Skype binary we need a non-obfuscated, non-compressed and most importantly a non-integrity checking version of Skype that will run under the context of the SoftICE debugger.

Unfortunately the code changes with each revision however each subsequent bypass is a minor headache at most.

The version of Skype I am working with employs two SoftICE checks with a single binary integrity check in between the operations.

Bypass first softice check:

Change:


02 00 00 01 74 1c 6a 00

To:


02 00 00 01 [74 ==> eb] 1c 6a 00

Bypass crc check:

Change:


71 ff 84 c0 75 1d 6a 30

To:


71 ff 84 c0 [75 ==> eb] 1d 6a 30

Bypass second softice check:

Change:


e8 94 6e 6b ff 84 c0 74 1a

To:

e8 94 6e 6b ff 84 c0 [74 ==> eb] 1a

Run the final patched Skype without problem.

This is a demonstration of how to use the JMP command to breakdown the autonomous barriers of object code.

Localized phone number formatting from string or number.

Apple didn’t give us much help when it comes to formatting phone numbers however they do have their own API to do this. We cannot use their private API’s so we must duplicate the work. Here is a small example of how you can subclass NSFormatter and format a phone number from an NSString or NSNumber object.


- (NSString *)formattedPhoneNumberFromString:(NSString *)aNumber
{
if (!aNumber || !aNumber.length)
{
return aNumber;
}

NSString * ret = nil;

BOOL enUS = [[self.locale localeIdentifier] compare:@"en_US"] == NSOrderedSame;

if (enUS)
{
NSRange range = NSMakeRange(3, 3);

NSString * part1 = [aNumber substringToIndex:3];
NSString * part2 = [aNumber substringWithRange:range];
NSString * part3 = [aNumber substringFromIndex:6];

ret = [NSString stringWithFormat:@"(%@) %@-%@", part1, part2, part3];
}
else
{
ret = aNumber;
}

return ret;
}

and

- (NSString *)formattedPhoneNumberFromNumber:(NSNumber *)aNumber
{
if (!aNumber)
{
return @"";
}

return [self formattedPhoneNumberFromString:[aNumber stringValue]];
}

As you may notice you can utilize device locale specifics to add international support.

NSOperation and NSOperationQueue are a Godsend

I’ve been a bit detached from Cocoa and Objective-C for the last year or so with lower level cross platform libraries like boost and mainly boost::asio. Concurrency has always been an issue with me as I despise threads and ever moreso hate locks. Granted they are needed under certain conditions or programming models.

The NSOperation and NSOperationQueue classes are a godsend and have been needed for a very long time. I’ve always said that if you can asynchronously create an object and pass it off to the kernel to perform it’s process and return on a user defined callback that it’s the best option.

My reasoning for feeling this way about threads is that under no condition does an application know how many threads it should be using at any given time and therefore is an issue in it’s own right.

Below I give an example of an NSOperation subclass that downloads arbitrary data from an NSURL and then calls it’s delgate when the operation has completed in the NSOperationQueue.

The Interface:


@interface JCNetworkDataOperation : NSOperation
{
id _delegate;

NSURL * _url;
}

@property (nonatomic, assign) id __weak delegate;
@property (nonatomic, retain) NSURL * url;

@end

The implementation:

@implementation JCNetworkDataOperation

@synthesize delegate = _delegate;
@synthesize url = _url;

- (void)main
{
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];

NSError * err = nil;

NSData * data = [[NSData alloc]
initWithContentsOfURL:self.url options:NSUncachedRead error:&err
];

if (err)
{
JCLog([err localizedDescription]);
}
else
{
if ([self.delegate
respondsToSelector:@selector(networkDataOperationDidComplete:)]
)
{
[self.delegate
performSelectorOnMainThread:@selector(
networkDataOperationDidComplete:) withObject:data
waitUntilDone:NO
];
}
}
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}

- (void)dealloc
{
[_url release];
[super dealloc];
}

@end

Use case:

JCNetworkDataOperation * networkDataOperation = [[
JCNetworkDataOperation alloc] init
];

networkDataOperation.delegate = self;

networkDataOperation.url = url;

[appDelegate.operationQueue addOperation:networkDataOperation];

[networkDataOperation release];

And the delegate method:

- (void)networkDataOperationDidComplete:(NSData *)aData
{
if (aData.length)
{
}
}

This is a very simple example of using NSOperation with NSOperationQueue, however it’s only limits are in your imagination.