Skip to content

Instantly share code, notes, and snippets.

@corywright
corywright / screen-ssh-agent-env
Created January 3, 2011 18:34
This script populates ~/.screen-ssh-agent-env to pass ssh-agent information into a screen session. Source the file inside a screen session.
#!/bin/sh
SSH_SESSION_FILE=$HOME/.screen-ssh-agent-env
SSHV="SSH_CLIENT SSH_TTY SSH_AUTH_SOCK SSH_CONNECTION DISPLAY"
## For Bash environment variables:
for x in ${SSHV}; do
(eval echo $x=\$$x) | sed 's/=/="/
s/$/"/
s/^/export /'
@corywright
corywright / ssh-agent-with-screen
Created January 3, 2011 20:41
Source this code in your .profile, then use `reattach` and `restore-agent`
#!/bin/sh
# source this file in your ~/.profile and then start screen as normal.
# run: reattach [optional name]
# then, inside your screen windows run restore-agent
SSH_SESSION_FILE=$HOME/.screen-ssh-agent-env
reattach() {
SSHV="SSH_CLIENT SSH_TTY SSH_AUTH_SOCK SSH_CONNECTION DISPLAY"

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@corywright
corywright / A- problem description
Last active December 19, 2015 19:58
I am having trouble with the 'directory overlay' feature of file_roots.
I am having trouble with the 'directory overlay' feature of `file_roots`.
I want to deploy Salt in multiple regions, however most of the configuration
files will be the same with minor differences being populated via pillar data.
I have three file scenarios:
1. files that are common across all nodes in all regions (ex: /etc/sudoers)
2. files that are specific to certain types of nodes (ex: database configs)
3. files that are specific to a certain region (ex: /etc/hosts.allow)
team-aptrepo:
pkgrepo.managed:
- order: 1
- name: deb http://10.10.10.100/ precise main
- file: /etc/apt/sources.list.d/team.list
aptget-update:
cmd.wait:
- name: apt-get update
client_acl:
cwright:
- .*
@corywright
corywright / repositories.sls
Created October 9, 2013 15:14
After upgrading from Salt 0.16.4 to 0.17.0 my pkgrepo.managed stopped working.
api02.example.com:
----------
State: - pkgrepo
Name: deb http://packages.example.com/ precise main
Function: managed
Result: False
Comment: Failed to confirm config of repo deb http://packages.example.com/ precise main: repo "deb http://packages.example.com/ precise main" was not found
Changes:
{% for dc in 'region1', 'region2', 'region3' %}
{{ dc }}:
'dc:{{ dc }}':
- match: grain
- common
- common.repositories
- common.users
- common.packages
- common.files
- common.services
#!/usr/bin/env python
import collections
import datetime
from os import path
import pickle
import sys
if len(sys.argv) < 2:
print('Usage: bindify.py zonefile')

Keybase proof

I hereby claim:

  • I am corywright on github.
  • I am corywright (https://keybase.io/corywright) on keybase.
  • I have a public key whose fingerprint is 615A 0BC3 FEEF 9B56 A22C 66B7 6040 D4F1 6B01 0042

To claim this, I am signing this object: