Skip to content

Instantly share code, notes, and snippets.

View strongswan ikev2 server on ubuntu 14.04
# 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
```
View Keychain.swift
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
}
View gist:26ca27371f4523339dc3
➜ ~ 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
View UIColor+ColorDef.swift
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)
View gist:6221405
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 Jun 12, 2013
PackageApplication patch which allows keychain specifying for codesign
View PackageApplication.patch
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 Apr 9, 2021
Objective-C implementation of mod97 IBAN checking algorithm
View NSString+Mod97Check.h
#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 Mar 20, 2013
Self-executable .m file
View gist:5201458
/*/../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 Dec 14, 2015
curl https://raw.github.com/gist/5134242 | gcc -framework Foundation -framework Security -o /usr/local/bin/mobileprovision-read -x objective-c -
View gist:5134242
#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("\
View Insert endp.py
pop = 0x5d
ret = 0xc3
doc = Document.getCurrentDocument()
seg = doc.getCurrentSegment()
addr = doc.getCurrentAddress()
seg.writeByte(addr, pop)
seg.markAsCode(addr)