Skip to content

Instantly share code, notes, and snippets.

# Basic Strongswan ikev2 server setup
* paltform: atlantic.net ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
```
apt-get install strongswan
apt-get install iptables iptables-persistent
```
import Foundation
import Security
private let keychainQueue = dispatch_queue_create("networking.keychain", DISPATCH_QUEUE_CONCURRENT)
public class Keychain {
private let service: String
public init(service: String) {
self.service = service
}
➜ ~ pod --version
0.33.1
➜ ~ pod spec lint https://raw.githubusercontent.com/iAsync/iAsyncLite/master/podspecs/iAsyncLiteScheduler.podspec --verbose
> iAsyncLiteScheduler
iAsyncLiteScheduler (0.3.1) - Analyzing on iOS 6.0 platform.
Analyzing dependencies
import UIKit
typealias ColorDef = UInt32
extension UIColor {
convenience init(_ colorDef: ColorDef) {
self.init(colorDef: colorDef)
}
convenience init(colorDef: ColorDef) {
self.init(colorDef: colorDef, alpha: 1.0)
static __attribute__((always_inline)) CCCryptorStatus AES128Run(CCOperation operation, NSData *inData, NSData *key, NSData *__autoreleasing *outData) {
CCCryptorStatus status = kCCParamError;
if (outData != NULL) {
CCCryptorRef cryptor = NULL;
//correct key length
NSMutableData *correctedKey = [key mutableCopy];
if ([key length] <= kCCKeySizeAES128) {
[correctedKey setLength:kCCKeySizeAES128];
@0xc010d
0xc010d / PackageApplication.patch
Created June 12, 2013 22:18
PackageApplication patch which allows keychain specifying for codesign
24a25
> "keychain|k=s",
156a158,162
> if ( $opt{keychain} ) {
> push(@codesign_args, '--keychain');
> push(@codesign_args, $opt{keychain});
> }
>
268c274
< PackageApplication [-s signature] application [-o output_directory] [-verbose] [-plugin plugin] || -man || -help
@0xc010d
0xc010d / NSString+Mod97Check.h
Last active April 9, 2021 13:57
Objective-C implementation of mod97 IBAN checking algorithm
#import <Foundation/Foundation.h>
@interface NSString (Mod97Check)
- (BOOL)passesMod97Check; // Returns result of mod 97 checking algorithm. Might be used to check IBAN.
// Expects string to contain digits and/or upper-/lowercase letters; space and all the rest symbols are not acceptable.
@end
@0xc010d
0xc010d / gist:5201458
Created March 20, 2013 00:44
Self-executable .m file
/*/../bin/ls > /dev/null
COMPILED=${0%.*}
clang $0 -o $COMPILED -framework Foundation;
$COMPILED; rm $COMPILED; exit;
*/
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
@0xc010d
0xc010d / gist:5134242
Last active December 14, 2015 19:09
curl https://raw.github.com/gist/5134242 | gcc -framework Foundation -framework Security -o /usr/local/bin/mobileprovision-read -x objective-c -
#import <Foundation/Foundation.h>
#import <Security/Security.h>
int main(int argc, const char *argv[]) {
NSUserDefaults *arguments = [NSUserDefaults standardUserDefaults];
NSString *file = [arguments stringForKey:@"f"];
NSString *option = [arguments stringForKey:@"o"];
if (!file) {
printf("\
@0xc010d
0xc010d / Insert endp.py
Created March 5, 2013 23:59
Insert endp
pop = 0x5d
ret = 0xc3
doc = Document.getCurrentDocument()
seg = doc.getCurrentSegment()
addr = doc.getCurrentAddress()
seg.writeByte(addr, pop)
seg.markAsCode(addr)