Skip to content

Instantly share code, notes, and snippets.

@sheldonh
sheldonh / assault-light.js
Last active December 28, 2015 00:19
bf4 emblem
emblem.emblem.load({
"objects": [
{
"opacity": 1,
"angle": 0,
"flipX": false,
"flipY": false,
"top": 133.1395637074,
"height": 256.5208603782,
"width": 178.7589664376,
@sheldonh
sheldonh / gist:7335178
Last active December 27, 2015 13:39
neutron issues

Doc bugs

  • dnsmasq service needs to be debootstrapped on the controller
  • Public IP needs to be moved to br-ex. Note, if this is done on the command-line, instead of in /etc/network/interfaces, keep in mind that you'll lose your default gateway when you do it.
  • openvswitch-datapath-dkms must be installed on all nodes.
  • Replace %SERVICE_TENANT_NAME%, %SERVICE_USER% and %SERVICE_PASSWORD% in /etc/neutron/metadata_agent.ini with the real values from the keystone_authtoken section of /etc/neutron/neutron.conf. See this bug for more. By the way, that same bug makes me think neutron_admin_auth_url in /etc/nova/nova.conf should be http://controller:5000/v2.0 instead of http://controller:35357/v2.0. Indeed, someone on IRC with working neutron says he uses 5000, and 5000 works for me too.
  • Set auth_region to regionOne (not RegionOne) in /etc/neutron/metadata_agent.ini.
  • Set service_neutron_metadata_proxy=true in /etc/nova/nova.conf.

Critical

TASK: [debug msg="shell ssh root@{% if ansible_ssh_host is defined %}{{ansible_ssh_host}}{% else %}{{inventory_hostname}}{% endif %} whoami"] ***
<192.168.1.54> ESTABLISH CONNECTION FOR USER: fedora
ok: [192.168.1.54] => {"msg": "shell ssh [email protected] whoami"}
TASK: [Debuggery] *************************************************************
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p /tmp/ansible-1383122690.76-147711850800446 && chmod a+rx /tmp/ansible-1383122690.76-147711850800446 && echo /tmp/ansible-1383122690.76-147711850800446']
<127.0.0.1> REMOTE_MODULE command ssh [email protected] whoami #USE_SHELL
<127.0.0.1> PUT /tmp/tmpWTEnNX TO /tmp/ansible-1383122690.76-147711850800446/command
<127.0.0.1> EXEC ['/bin/sh', '-c', 'chmod a+r /tmp/ansible-1383122690.76-147711850800446/command']
<127.0.0.1> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=buekuitwvxmniwezfrqcczcmzwwrbjkm] password: " -u rack /bin/sh -c '"'"'/usr/bin/python /tmp/ansible-1383122690.76-147711850800446/command
@sheldonh
sheldonh / gist:7229042
Created October 30, 2013 08:33
Holy crap!
TASK: [Rsync local repo to server] ********************************************
failed: [192.168.1.54] => {"failed": true, "parsed": false}
invalid output was: [sudo via ansible, key=lwtfdjeriloittrxzexhobtnxsxiiclm] password:
From the entirely innocent:
-
name: Deploy rack application
hosts: rack-servers
tags: deploy
---
-
hosts: localhost
connection: local
tasks:
name: Create server instance
local_action:
module: nova_compute
state: present
login_username: "{{ lookup('env', 'OS_USERNAME') }}"
@sheldonh
sheldonh / local_wait.yml
Last active July 27, 2023 21:02
Wait for SSH to come up in an Ansible playbook
---
- hosts: demo
tags: wait
gather_facts: no
tasks:
- name: Wait for SSH
local_action: wait_for port=22 host={% if ansible_ssh_host is defined %}{{ ansible_ssh_host }}{% else %}{{ inventory_hostname }}{% endif %}
<body></body>
<script src="http://gamingJS.com/Three.js"></script>
<script src="http://gamingJS.com/ChromeFixes.js"></script>
<script>
// This is where stuff in our game will happen:
var scene = new THREE.Scene();
// This is what sees the stuff:
var aspect_ratio = window.innerWidth / window.innerHeight;
var camera = new THREE.PerspectiveCamera(75, aspect_ratio, 1, 10000);
@sheldonh
sheldonh / merge.coffee
Last active February 29, 2024 15:51
CoffeeScript Object.merge
merge = (xs...) ->
if xs?.length > 0
tap {}, (m) -> m[k] = v for k, v of x for x in xs
tap = (o, fn) -> fn(o); o
console.log merge {foo: '1', bar: 'baz'}, {bar: 'bis'} , {wombat: 'fishpaste'}
###
{ foo: '1', bar: 'bis', wombat: 'fishpaste' }
@sheldonh
sheldonh / gist:6075402
Last active December 20, 2015 04:59
waterfall.coffee
waterfall = (i, fs, callback) ->
if fs.length is 0 then callback()
else if fs.length is 1 then fs[0] i, callback
else
p = 0
scroll = (e, o) ->
if e then callback(e)
else
p += 1
if p is fs.length - 1
@sheldonh
sheldonh / gist:6062341
Created July 23, 2013 13:28
casperjs PUT example
casper = require('casper').create()
casper.start().thenOpen('http://localhost:9005/', {
method: 'put'
data:
username: 'foo'
password: 'bar'
}, -> @echo "PUT sent")
casper.run()