title | subtitle | author | date | source |
---|---|---|---|---|
Docker Compose Cheatsheet |
Quick reference for Docker Compose commands and config files |
Jon LaBelle |
April 7, 2019 |
This file contains 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
#check curl connection speed: https://coderwall.com/p/lwpszg/measuring-download-speed-from-the-command-line-with-curl | |
curl -Lo /dev/null -skw "\ntime_connect: %{time_connect}s\ntime_namelookup: %{time_namelookup}s\ntime_pretransfer: %{time_pretransfer}\ntime_starttransfer: %{time_starttransfer}s\ntime_redirect: %{time_redirect}s\ntime_total: %{time_total}s\n\n" http://foolproofcode.com | |
#example result: | |
#time_connect: 0.074s | |
#time_namelookup: 0.063s | |
#time_pretransfer: 0.103 | |
#time_starttransfer: 0.278s | |
#time_redirect: 0.067s |
This file contains 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
sudo timedatectl set-timezone "Asia/Kuala_Lumpur" | |
# update OS & install necessary stuff | |
sudo apt update -y && sudo apt install byobu multitail htop iftop screen -y | |
#vim environment to be windows friendly colorscheme | |
echo "syntax on | |
colorscheme desert" > ~/.vimrc | |
# check date adn time |
This file contains 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
# SETUP RESOURCE GROUP | |
#reference https://docs.aws.amazon.com/cli/latest/reference/inspector/index.html | |
aws inspector create-resource-group --resource-group-tags key=SecurityScan,value=true | |
#from previous step get resgroupARN | |
aws inspector create-assessment-target \ | |
--assessment-target-name GamesDevTargetGroup \ | |
--resource-group-arn <ResourceGroupARN> | |
#see available rules packages |
This file contains 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
# List virtual machines | |
VBoxManage list vms | |
"MyVM" {wwwwww-4301-4a7d-8af8-fe02fed00451} | |
# Start VM in headless mode | |
VBoxManage startvm MyVM --type headless | |
# Power off VM | |
VBoxManage controlvm MyVM poweroff |
This file contains 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
#become root and add key | |
sudo su - | |
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add - | |
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list | |
apt-get update && apt-get install openvpn | |
#Based Linode Hardened https://www.linode.com/docs/networking/vpn/set-up-a-hardened-openvpn-server/ | |
#require signed HMAC sig file for access | |
openvpn --genkey --secret /etc/openvpn/server/ta.key | |
openssl genpkey -genparam -algorithm DH -out /etc/openvpn/server/dhp4096.pem -pkeyopt dh_paramgen_prime_len:4096 |
I hereby claim:
- I am samqi on github.
- I am samqi (https://keybase.io/samqi) on keybase.
- I have a public key ASD7_P33ddVzD8HeTd0Bjs5VXmVKZrsh6d57Zy_wXAYzSQo
To claim this, I am signing this object:
DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.
In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.
Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud, open source and business](https://blogs.the451group.com/opensource/2010/03/03/devops-mixing-dev-ops-agile-cloud-open-source-and-busi
This file contains 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
#use awk to output history commands without the numbers | |
awk '{print $2,$3,$4,$5,$6,$7}' history.txt >> commands.txt | |
#get the ip addresses https://www.cyberciti.biz/tips/read-unixlinux-system-ip-address-in-a-shell-script.html | |
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' | |
#get private and public IP for linode node via CLI (old version) https://github.com/linode/cli | |
linode show linodenode| grep ips | awk '{ print $2,$3}' |
This file contains 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
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
NewerOlder