This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
killall Docker && open /Applications/Docker.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
csplit -k inputfile '/<loc>/' {*} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST -H "Content-Type: application/json" -d '{ "message": "Test SMS service", "phoneNumber": "0946301719" }' http://localhost:8080/cmc-sms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ports: destination, source | |
ssh -R 0.0.0.0:8080:localhost:80 -N [email protected] | |
# sshd needs GatewayPorts set to 'yes' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |