brew install openssl
git clone git://anongit.mindrot.org/openssh.git
cd openssh
# ./configure script does not exist, so we have to build it
autoreconf
mkdir dist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <netinet/tcp.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <sys/socket.h> | |
| int main(int argc, char **argv) { | |
| int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo apt-get install linux-headers-$(uname -r) | |
| $ sudo add-apt-repository ppa:wireguard/wireguard | |
| $ sudo apt-get update | |
| $ sudo apt-get install wireguard | |
| $ sudo modprobe wireguard | |
| $ sudo mkdir /etc/wireguard | |
| $ (umask 077 && printf "[Interface]\nPrivateKey = " | sudo tee /etc/wireguard/wg0.conf > /dev/null) | |
| $ wg genkey | sudo tee -a /etc/wireguard/wg0.conf | wg pubkey | sudo tee /etc/wireguard/publickey | |
| $ sudo nano /etc/wireguard/wg0.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # CORS header support | |
| # | |
| # One way to use this is by placing it into a file called "cors_support" | |
| # under your Nginx configuration directory and placing the following | |
| # statement inside your **location** block(s): | |
| # | |
| # include cors_support; | |
| # | |
| # As of Nginx 1.7.5, add_header supports an "always" parameter which |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| i386 : iPhone Simulator | |
| x86_64 : iPhone Simulator | |
| iPhone1,1 : iPhone | |
| iPhone1,2 : iPhone 3G | |
| iPhone2,1 : iPhone 3GS | |
| iPhone3,1 : iPhone 4 | |
| iPhone3,2 : iPhone 4 GSM Rev A | |
| iPhone3,3 : iPhone 4 CDMA | |
| iPhone4,1 : iPhone 4S | |
| iPhone5,1 : iPhone 5 (GSM) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import JavaScriptCore | |
| extension JSContext { | |
| subscript(key: String) -> Any { | |
| get { | |
| return self.objectForKeyedSubscript(key) | |
| } | |
| set{ | |
| self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Cocoa | |
| @objc | |
| class SomeTextStorage: NSTextStorage { | |
| private var storage: NSMutableAttributedString | |
| override init() { | |
| storage = NSMutableAttributedString(string: "", attributes: nil) | |
| super.init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Similar to defer in Swift | |
| #define pspdf_defer_block_name_with_prefix(prefix, suffix) prefix ## suffix | |
| #define pspdf_defer_block_name(suffix) pspdf_defer_block_name_with_prefix(pspdf_defer_, suffix) | |
| #define pspdf_defer __strong void(^pspdf_defer_block_name(__LINE__))(void) __attribute__((cleanup(pspdf_defer_cleanup_block), unused)) = ^ | |
| #pragma clang diagnostic push | |
| #pragma clang diagnostic ignored "-Wunused-function" | |
| static void pspdf_defer_cleanup_block(__strong void(^*block)(void)) { | |
| (*block)(); | |
| } | |
| #pragma clang diagnostic pop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem | |
| chmod 700 id_rsa.pem |