This article is now published on my website: Prefer Subshells for Context.
This file contains 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
# Usage: show <local-port> <subdomain> | |
function show() { | |
DOMAIN=".tekacs.com" | |
REMOTE="$2$DOMAIN" | |
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost" | |
} |
This file contains 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
#!/usr/bin/env python | |
""" | |
Recipe for creating and updating security groups programmatically. | |
""" | |
import collections | |
import boto |
This file contains 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
var page = new WebPage(), | |
address, output, size; | |
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
capture = function(targetFile, clipRect) { | |
var previousClipRect; | |
var clipRect = {top: 0, left:0, width: 40, height: 40}; | |
if (clipRect) { | |
if (!isType(clipRect, "object")) { | |
throw new Error("clipRect must be an Object instance."); |
This file contains 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
# -*- coding: utf-8 -*- | |
from django import forms | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field | |
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions | |
class MessageForm(forms.Form): | |
text_input = forms.CharField() |
This file contains 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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains 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
function New-Symlink { | |
<# | |
.SYNOPSIS | |
Creates a symbolic link. | |
#> | |
param ( | |
[Parameter(Position=0, Mandatory=$true)] | |
[string] $Link, | |
[Parameter(Position=1, Mandatory=$true)] | |
[string] $Target |
This file contains 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
// 1. clone the tunnel-on-dotcloud repo to get the config files | |
git clone git://github.com/3on/tunnel-on-dotcloud.git | |
cd tunnel-on-dotcloud | |
// 2. create a dotCloud app | |
dotcloud create webtunnel | |
// 3. push on dotCloud | |
dotcloud push webtunnel | |
// if you try to access the given url yet you get a 502 error, which normal since you have not opened yet the tunnel |
This file contains 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
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/ | |
$subscription = "[Your Subscription Name]" | |
$service = "[Your Azure Service Name]" | |
$slot = "staging" #staging or production | |
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg" | |
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg" | |
$timeStampFormat = "g" | |
$deploymentLabel = "ContinuousDeploy to $service v%build.number%" | |
Write-Output "Running Azure Imports" |
- Update HISTORY.md
- Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
- Update version number (can also be minor or major)
bumpversion patch
OlderNewer