Skip to content

Instantly share code, notes, and snippets.

View u1i's full-sized avatar

Uli u1i

View GitHub Profile
@u1i
u1i / start-private-registry.sh
Created September 20, 2017 10:16
Run a private Docker registry
# Run a private registry
docker run -d -p 80:5000 --restart=always --name my_registry registry:2
# Run a private registry with SSL cert and Basic Auth
# you should generate the certs and htpasswd file before
docker run -d -p 443:5000 --restart=always --name registry \
-v /etc/ssl-certs:/certs \
@u1i
u1i / gist:0f4718a21c19c75082a2fa3495f1cd5e
Last active December 21, 2017 01:47
Appcelerator Start Project
appc new
cd new-project
appc install connector/appc.arrowdb
appc install connector/appc.mysql
appc run --port=8088
appc cloud domain --set api.mydomain.com
appc publish
import os
from docker import Client
from docker.utils import kwargs_from_env
kwargs = kwargs_from_env()
client = Client(**kwargs)
containers = client.containers()
builders = [c for c in containers if c['Image'] == 'u1ih/builder-runtime']
ids = [s['Id'] for s in builders]
@u1i
u1i / selenium.py
Created September 24, 2017 00:58
selenium screenie
import time
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME)
driver.get('http://httpbin.org/anything');
time.sleep(5) # Let the user actually see something!
@u1i
u1i / gist:c4926e424ac77df628fa69693b614fe0
Created September 24, 2017 13:04
Restart docker on MacOS
killall Docker && open /Applications/Docker.app
csplit -k inputfile '/<loc>/' {*}
curl -XPOST -H "Content-Type: application/json" -d '{ "message": "Test SMS service", "phoneNumber": "0946301719" }' http://localhost:8080/cmc-sms
@u1i
u1i / gist:dbc5250d268776df248d9703ca22fe65
Created October 15, 2017 13:54
Forward local port to remote public port via SSH
# Ports: destination, source
ssh -R 0.0.0.0:8080:localhost:80 -N [email protected]
# sshd needs GatewayPorts set to 'yes'
@u1i
u1i / gist:53d2c31e5ec4ef4dfc3d6b0fea6af3bf
Created October 26, 2017 08:18
Install CA on ubuntu
Installing a root/CA Certificate
Given a CA certificate file foo.crt, follow these steps to install it on Ubuntu:
Create a directory for extra CA certificates in /usr/share/ca-certificates:
sudo mkdir /usr/share/ca-certificates/extra
Copy the CA .crt file to this directory:
sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt
Let Ubuntu add the .crt file's path relative to /usr/share/ca-certificates to /etc/ca-certificates.conf:
sudo dpkg-reconfigure ca-certificates
# install
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-cache policy docker-ce
apt-get install -y docker-ce
systemctl status docker
# add access for non priv user