Skip to content

Instantly share code, notes, and snippets.

View yeukhon's full-sized avatar

Yeuk Hon Wong yeukhon

  • TikTok USDS / ByteDance
  • New York, NY
  • 19:18 (UTC -04:00)
View GitHub Profile
@yeukhon
yeukhon / gist:4743318
Last active December 12, 2015 08:19
Install with_items: {list} with extra-vars from cml
- hosts: $hosts
user: $user
sudo: True
tasks:
- name: install
action: apt pkg=$item force=yes install_recommends=yes
with_items: ${my_list}
---------------
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
location / {
proxy_pass http://10.10.0.56;
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
from mock import Mock
from functools import wraps
class AuthenticationRequiredError(Exception):
pass
def authentication_required(fn):
@wraps(fn)
def wrapper(self, *args, **kwargs):
username = hasattr(self, 'username')
# template
{% for hosts in groups['live-condor-m'] %}
{{ hosts }} {{ condor_name }}
{% endfor %}
# inventory
[live-condor-m]
10.10.0.56 condor_name=master0
10.10.0.63 condor_name=master1
TASK: [Execute setup.sh] ******************************************************
<192.168.1.46> ESTABLISH CONNECTION FOR USER: vagrant
<192.168.1.46> EXEC ['sshpass', '-d5', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/tmp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '192.168.1.46', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1366416011.71-249037134189745 && chmod a+rx $HOME/.ansible/tmp/ansible-1366416011.71-249037134189745 && echo $HOME/.ansible/tmp/ansible-1366416011.71-249037134189745'"]
<192.168.1.46> REMOTE_MODULE command /opt/ideapis/repoapi/./setup.sh
<192.168.1.46> PUT /tmp/tmpb1Bki1 TO /home/vagrant/.ansible/tmp/ansible-1366416011.71-249037134189745/command
<192.168.1.46> EXEC ['sshpass', '-d5', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/tmp/ansible-s
#setup.yml
- hosts: webservers
tasks:
- pause: seconds=1
- include: tests.yml
# tests.yml
- hosts: $inventory_hostname
(my1)vagrant@precise64:~/minion-backend/tests/functional/plugins$ sudo apt-get install libcurl4-openssl-dev -s
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
libcurl3-dbg
The following packages will be REMOVED:
libcurl4-gnutls-dev
The following NEW packages will be installed:
libcurl4-openssl-dev
scan = { "id": str(uuid.uuid4()),
"state": "CREATED",
"created": now,
"queued": None,
"started": None,
"finished": None,
"plan": { "name": plan['name'], "revision": 0 },
"configuration": configuration['configuration'],
"sessions": [],
"meta": { "owner": None, "tags": [] } }
@yeukhon
yeukhon / quit()
Last active December 18, 2015 18:50
vagrant@precise64:~/mozilla-central/js/src/obj-debug-ubsan$ ./js
js> quit()
../assembler/assembler/AssemblerBuffer.h:121:13: runtime error: store to misaligned address 0x7ffff8d0d2bb for type 'int', which requires 4 byte alignment
0x7ffff8d0d2bb: note: pointer points here
50 48 81 ec 00 00 00 00 00 e0 d2 d0 f8 ff 7f 00 00 20 d8 d0 f8 ff 7f 00 00 68 d8 d0 f8 ff 7f 00
^
../assembler/assembler/AssemblerBuffer.h:128:13: runtime error: store to misaligned address 0x7ffff8d0d374 for type 'int64_t' (aka 'long'), which requires 8 byte alignment
0x7ffff8d0d374: note: pointer points here
63 48 49 bb 5e 7f 00 00 00 00 00 00 00 00 00 00 b0 d3 d0 f8 00 00 00 00 01 00 00 00 00 00 00 00
^
@yeukhon
yeukhon / demo.py
Created July 19, 2013 17:17
run.py
#!/usr/bin/python
import time
time.sleep(30)