Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
JSON=`jq -n ".auth.passwordCredentials.password = \"$OS_PASSWORD\" | .auth.passwordCredentials.username = \"$OS_USERNAME\" | .auth.tenantName = \"$OS_TENANT_NAME\""`
CREDS=`curl -s "$OS_AUTH_URL/tokens" -X POST -H "Content-Type: application/json" -d "$JSON"`
TOKEN=`echo $CREDS | jq -r .access.token.id`
#echo $TOKEN
TENANT_ID=`echo $CREDS | jq -r .access.token.tenant.id`
ENDPOINT=`echo $CREDS | jq -r '.access.serviceCatalog[] | select(.type == "compute").endpoints[0].publicURL'`
#NET="98a334b9-59fe-417c-8230-7a89a85b4701"
@dalitun
dalitun / ansible-bootstrap-ubuntu-16.04.yml
Created July 7, 2017 14:39 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@dalitun
dalitun / github_repo.py
Created July 7, 2017 14:13 — forked from toast38coza/github_repo.py
An Ansible module for managing github repos
#!/usr/bin/python
DOCUMENTATION = '''
---
module: github_repo
short_description: Manage your repos on Github
'''
EXAMPLES = '''
- name: Create a github Repo
@dalitun
dalitun / github_repo.py
Created July 7, 2017 14:13 — forked from toast38coza/github_repo.py
An Ansible module for managing github repos
#!/usr/bin/python
DOCUMENTATION = '''
---
module: github_repo
short_description: Manage your repos on Github
'''
EXAMPLES = '''
- name: Create a github Repo
sync; echo 3 > /proc/sys/vm/drop_caches
import random
def random_walk(n):
"""Return coordinates after 'n' block random walk."""
x=0
y=0
for i in range(n):
step = random.choice(['N','S','E','W'])
if step == 'N':
y = y + 1
#!/bin/bash
sudo apt-get update
sudo apt-get -y install libssl0.9.8
wget http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
sudo tar zxvf utorrent-server-3.0-25053.tar.gz -C /opt/
sudo chmod -R +x /opt/utorrent-server-v3_0/
/opt/utorrent-server-v3_0/utserver -settingspath /opt/utorrent-server-v3_0/ &
#!/bin/bash
#https://www.unixmen.com/install-openvpn-asaccess-server-on-ubuntu-debian/
VERSION=2.1.4
wget http://swupdate.openvpn.org/as/openvpn-as-$VERSION-Ubuntu12.amd_64.deb
sudo dpkg -i openvpn-as-$VERSION-Ubuntu12.amd_64.deb
sudo su - root -c "echo openvpn:$1 | chpasswd"
heat_template_version: 2014-10-16
description: A simple server to run Jenkins
parameters:
key_name:
type: string
default: honey
description: Name of an existing key pair to enable SSH access to the instance.
NetID:
default: 335662a3-2d21-40f0-9c59-93f1f123f33f
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.