(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| #!/usr/bin/env python | |
| """ | |
| Example of unbalanced binary tree in Python, with pretty printing of the tree | |
| """ | |
| from __future__ import division, absolute_import, print_function | |
| __author__ = 'Anthony Dervish' | |
| import logging | |
| import argparse | |
| import weakref |
| OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org | |
| USAGE: clang -cc1 [options] <inputs> | |
| OPTIONS: | |
| -### Print the commands to run for this compilation | |
| --analyze Run the static analyzer | |
| --migrate Run the migrator | |
| --relocatable-pch Build a relocatable precompiled header | |
| --serialize-diagnostics <value> |
| Some useful Python one-liners taken from http://www.reddit.com/r/Python/comments/fofan/suggestion_for_a_python_blogger_figure_out_what/ | |
| All modules listed are part of the standard library and should work with Python 2.6+ | |
| How to use: | |
| $ python -m [module] [arguments] | |
| calendar - does default to displaying a yearly calendar, but it has a bunch of options (args are year or year month, options are HTML output, calendar locale, encoding, and some type-specific stuff, see python -m calendar -h) | |
| cgi, dumps a bunch of information as HTML to stdout |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <!-- iOS 10, macOS Sierra, and friends bring a new logging subsystem that's | |
| supposed to scale from the kernel, up to frameworks, and up to apps. It defaults | |
| to a more regimented, privacy-focused approach that large apps and complex | |
| systems need. | |
| It, along with Activity Tracing introduced in iOS 8 and macOS Yosemite and the | |
| Console app in macOS Sierra, hope to help you graduate from caveman debugging to |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include <Security/Security.h> | |
| // Compile with: | |
| // gcc -o ourpath -framework CoreFoundation -framework Security main.c |
| private func example1() { | |
| let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
| for i in 0..<10 { | |
| dispatch_async(queue) { | |
| NSLog("Start: \(i)") | |
| sleep(3) | |
| NSLog("End: \(i)") | |
| } | |
| } | |
| } |
| from dateutil import rrule | |
| import datetime | |
| # Generate ruleset for holiday observances on the NYSE | |
| def NYSE_holidays(a=datetime.date.today(), b=datetime.date.today()+datetime.timedelta(days=365)): | |
| rs = rrule.rruleset() | |
| # Include all potential holiday observances | |
| rs.rrule(rrule.rrule(rrule.YEARLY, dtstart=a, until=b, bymonth=12, bymonthday=31, byweekday=rrule.FR)) # New Years Day |
| #!/bin/bash -ex | |
| # Set some local variables | |
| PRIVATE_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4` | |
| PUBLIC_IP=`curl -s http://169.254.169.254/latest/meta-data/public-ipv4` | |
| VPN_DNSHOST=`grep -o "nameserver.*" /etc/resolv.conf | awk '{print $2}'` | |
| yum install -y libreswan ppp xl2tpd | |
| # Setup IPSEC Tunnel |
Wes Winham winhamwr@gmail.com
There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.