-
In
~/.ssh/config
, include the lines:Host * ControlPath ~/.ssh/sockets/%r@%h-%p
const generateUpdateQuery = (fields) => { | |
let exp = { | |
UpdateExpression: 'set', | |
ExpressionAttributeNames: {}, | |
ExpressionAttributeValues: {} | |
} | |
Object.entries(fields).forEach(([key, item]) => { | |
exp.UpdateExpression += ` #${key} = :${key},`; | |
exp.ExpressionAttributeNames[`#${key}`] = key; | |
exp.ExpressionAttributeValues[`:${key}`] = item |
# Install tmux on rhel/centos 7 | |
# What do we want? | |
libeventversion=2.1.11 | |
tmuxversion=3.1 | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL |
- name: DO | |
hosts: localhost | |
vars: | |
project_name: "PUT A NAME FOR YOUR PROJECT HERE" | |
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens" | |
repository: "PUT YOUR REPOSITORY URL HERE" | |
tasks: | |
- name: LOCAL | Generate SSH key | |
shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N "" |
import jenkins.model.* | |
import hudson.remoting.Launcher | |
import hudson.slaves.SlaveComputer | |
def expectedVersion = Launcher.VERSION | |
for (computer in Jenkins.instance.getComputers()) { | |
if (! (computer instanceof SlaveComputer)) continue | |
if (!computer.getChannel()) continue | |
def version = computer.getSlaveVersion() |
node { | |
// https://registry.hub.docker.com/_/maven/ | |
def maven32 = docker.image('maven:3.2-jdk-7-onbuild'); | |
stage 'Mirror' | |
// First make sure the slave has this image. | |
// (If you could set your registry below to mirror Docker Hub, | |
// this would be unnecessary as maven32.inside would pull the image.) | |
maven32.pull() | |
// We are pushing to a private secure docker registry in this demo. |
package main | |
import "fmt" | |
type F func(i int) int | |
func (f F) compose(inner F) F { | |
return func(i int) int { return f(inner(i)) } | |
} |
from rest_framework.parsers import JSONParser | |
from django.conf import settings | |
import re | |
import json | |
first_cap_re = re.compile('(.)([A-Z][a-z]+)') | |
all_cap_re = re.compile('([a-z0-9])([A-Z])') | |
def camel_to_underscore(name): | |
s1 = first_cap_re.sub(r'\1_\2', name) |
#!/bin/bash | |
# Setup | |
# | |
# - Create a new Jenkins Job | |
# - Mark "None" for Source Control Management | |
# - Select the "Build Periodically" build trigger | |
# - configure to run as frequently as you like | |
# - Add a new "Execute Shell" build step | |
# - Paste the contents of this file as the command |
package main | |
import ( | |
"fmt" | |
) | |
type Stack struct { | |
top *Element | |
size int | |
} |