Skip to content

Instantly share code, notes, and snippets.

@letiemble
letiemble / openssl-maker.sh
Last active April 23, 2023 11:33
A bash script to generate "all-in-one" OpenSSL static libraries for OS X and iOS. The script produces fat static libraries (i386, x86_64 for OS X) and (i386, x86_64, armv7, armv7s, arm64 for iOS) suitable for integration in both OS X and iOS project.
#!/bin/bash
###############################################################################
## ##
## Build and package OpenSSL static libraries for OSX/iOS ##
## ##
## This script is in the public domain. ##
## Creator : Laurent Etiemble ##
## ##
###############################################################################
@letiemble
letiemble / receigen4xcode.sh
Created August 23, 2013 19:21
When developing inside Xcode, use this script inside a "Run Script" build phase and place it before the "Compile Sources" one.
# Receigen binary
RECEIGEN="/Applications/Receigen.app/Contents/MacOS/Receigen"
# Extract Info.plist information
INPUT="$INFOPLIST_FILE"
BUNDLE_ID=`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "$INPUT"`
BUNDLE_VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INPUT"`
# Expand information if needed
EXPANDED_BUNDLE_ID=`eval "echo $BUNDLE_ID"`
@letiemble
letiemble / runtime.xcscheme
Created August 1, 2013 13:55
A Xcode scheme used to unit test the Monobjc runtime.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@letiemble
letiemble / btsync
Last active December 16, 2015 18:20 — forked from mendelgusmao/btsync
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
@letiemble
letiemble / rtorrent-XXX
Last active May 3, 2023 13:20
Init.d script for rtorrent. The script creates a screen session and launch rtorrent as the given user. The user is taken from the script name; the script must follow the namnig convention "rtorrent-<user>".
#!/bin/sh
### BEGIN INIT INFO
# Provides: rtorrent-XXX
# Required-Start: $local_fs $remote_fs $portmap
# Required-Stop: $local_fs $remote_fs $portmap
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daemonized version of rtorrent.
@letiemble
letiemble / receigen4QT_main.cpp
Created January 16, 2013 19:54
Pseudo entry point that is called by Receigen validation code.
extern "C" {
int main_(int argc, const char *argv[])
{
QApplication a(argc, (char**) argv);
// Create and show main window here
return a.exec();
}
}
@letiemble
letiemble / receigen4QT_main.m
Created January 16, 2013 19:53
Main entry point to use when integrating Receigen generated code.
int main_(int argc, const char *argv[]);
#define RUNNER (&main_)
#import "receigen.h"
int main(int argc, char *argv[])
{
return CheckReceiptAndRun(argc, (const char**)argv);
}
@letiemble
letiemble / receigen_dump.sh
Last active October 6, 2015 09:38
Receigen dumper shell script to help diagnose receipt validation issues
#!/bin/bash
#
# Copyright (c) 2011-2014 Laurent Etiemble (laurent dot etiemble at gmail dot com)
#
# This script is provided as-is without any warranties. Use it at your own risks.
#
# Get parameter
APP_BUNDLE=$1