Skip to content

Instantly share code, notes, and snippets.

View rbsgn's full-sized avatar

Roman Busygin rbsgn

  • Dodo Engineering
  • Moscow
  • X @rbsgn
View GitHub Profile
@rbsgn
rbsgn / openssl-build_libs-bug.diff
Created October 25, 2011 21:06
A patch for openssl source that fixes bug with "make build_libs && make install_sw" scenario
diff -Naur openssl-1.0.0e-orig/Makefile.org openssl-1.0.0e/Makefile.org
--- openssl-1.0.0e-orig/Makefile.org 2010-01-27 19:06:58.000000000 +0300
+++ openssl-1.0.0e/Makefile.org 2011-10-26 01:01:52.000000000 +0400
@@ -559,13 +559,14 @@
echo ''; \
sed -e '1,/^$$/d' doc/openssl-shared.txt; \
fi; \
- fi
- cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
- chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
Binary files .DS_Store and .DS_Store differ
diff -rupN Makefile.am Makefile.am
--- Makefile.am 2011-10-23 21:33:41.000000000 +0400
+++ Makefile.am 2011-10-23 21:35:09.000000000 +0400
@@ -145,6 +145,15 @@ openvpn_SOURCES = \
tun.c tun.h \
win32.h win32.c \
cryptoapi.h cryptoapi.c
+
+if APPLE
@rbsgn
rbsgn / openvpn-keychain-(without man page diff).diff
Created October 23, 2011 17:24
Modified version of https://gist.github.com/1307595 gist but without changes made in openvpn.8. They were thrown away because of conflicts with release-2.1 branch in openvpn.
From 96eb48310d85ff107e2c46c80488d89598f248cf Mon Sep 17 00:00:00 2001
From: Roman Busyghin <nskboy@gmail.com>
Date: Sun, 23 Oct 2011 21:12:55 +0400
Subject: [PATCH] Ability to lookup OS X keychain to load VPN certificate
This patch is created by Brian Raderman <brian@irregularexpression.org> and modified a bit in order to be compiled with make instead of Xcode
---
Makefile.am | 9 +
cert_data.c | 631 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cert_data.h | 44 ++++
@rbsgn
rbsgn / openvpn-keychain.diff
Created October 23, 2011 17:17
Openvpn patch that allows loading of VPN certificate from Mac OS X keychain. Originally created by Brian Raderman (<brian@irregularexpression.org>).
From a53d19a34be1301c4f4c37e9767ca698885b84fb Mon Sep 17 00:00:00 2001
From: Roman Busyghin <nskboy@gmail.com>
Date: Sun, 23 Oct 2011 20:37:52 +0400
Subject: [PATCH] Ability to lookup OS X keychain to load VPN certificate
This patch is created by Brian Raderman <brian@irregularexpression.org> and modified a bit in order to be compiled with make instead of Xcode
---
Makefile.am | 9 +
cert_data.c | 631 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cert_data.h | 44 ++++
@rbsgn
rbsgn / blame.rb
Created May 13, 2011 14:18 — forked from soffes/blame.rb
Find the number of lines of code per person in a repository
# Put this file in the root of your git repository then run `ruby blame.rb`.
# You will need gsed. You can install gsed with `brew install gsed`.
# Crazy shell script taken from http://stackoverflow.com/questions/4589731/git-blame-statistics
input = `git ls-tree -r HEAD|gsed -re 's/^.{53}//'|while read filename; do file "$filename"; done|grep -E ': .*text'|gsed -r -e 's/: .*//'|while read filename; do git blame "$filename"; done|gsed -r -e 's/.*\\((.*)[0-9]{4}-[0-9]{2}-[0-9]{2} .*/\\1/' -e 's/ +$//'|sort|uniq -c`
aggregated = {}
input.lines.each do |line|
line.strip!
@rbsgn
rbsgn / CALayer-YXDebug.h
Created March 19, 2011 16:57
Debugging mode for CALayers: highlights borders and dumps sublayers as images
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface CALayer (YXDebug)
- (UIImage *)snapshot;
- (void)dumpSublayerImagesToFolder:(NSString *)folderPath;
- (void)highlightSublayerBorders;
@end
@rbsgn
rbsgn / UIView-YXDebug.h
Created March 19, 2011 16:44
Debugging mode for UIViews: Dumps subviews description to console
#import <UIKit/UIKit.h>
@interface UIView (YXDebug)
- (NSString *)subtreeDescription;
@end
#import <Foundation/Foundation.h>
@interface NSObject (YXDebug)
- (NSString *)yx_description;
@end
@rbsgn
rbsgn / gist:839347
Created February 22, 2011 20:41 — forked from Machx/gist:838075
// NSURLConnection wrapper
// like NSURLConnection, requires a runloop, callbacks happen in runloop that set up load
@interface LDURLLoader : NSObject
{
NSURLConnection *_connection;
NSTimeInterval _timeout;
NSTimer *_timeoutTimer;
NSURLResponse *_response;
long long _responseLengthEstimate;
NSMutableData *_accumulatedData;
/*
* Adds the serialNumber property to the UIDevice class
*
* The implementation uses undocumented (for iOS) IOKit functions,
* so handle with caution and be prepared for nil.
*/
#import <UIKit/UIDevice.h>
@interface UIDevice (serialNumber)