sudo apt-get install xserver-xorg-video-dummy
Create / Edit xorg.conf file Rename file if already exists for backup
[global] | |
workgroup = WORKGROUP | |
min protocol = SMB3_00 | |
server string = %h server (Samba, Ubuntu) | |
server role = standalone server | |
log file = /var/log/samba/log.%m |
#!/bin/sh | |
# install docker | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common |
#!/bin/sh | |
# install pyenv | |
sudo apt-get update | |
sudo apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ | |
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | |
cd ~ || exit |
# Set up AWS CLI, we don't use Amazon Linux so we need this | |
export AWS_REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}') | |
mkdir -p /root/.aws | |
echo -e "[default]\nregion=$AWS_REGION" | tee /root/.aws/config | |
# Get tags from the API | |
export FQDN=$(aws ec2 describe-tags --filters "Name=resource-id,Values=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" "Name=key,Values=fqdn" --output=text | cut -f 5) | |
# Set hostname | |
if [ -n "$FQDN" ]; then |
(defn response | |
([status body] | |
{:status status | |
:headers {} | |
:body body})) | |
(defmacro http-status [code sym] | |
`(def ~sym (partial response ~code))) | |
(defmacro http-statuses [& pairs] |
# diff the string "foo" with the string "baz" | |
diff <(echo foo) <(echo bar) |
#!/bin/bash -e | |
# Prints the name of the container inside which the process with a PID on the host is. | |
# https://stackoverflow.com/a/42009937 | |
function getName { | |
local pid="$1" | |
if [[ -z "$pid" ]]; then | |
echo "Missing host PID argument." | |
exit 1 |
nginx -T 2>/dev/null | \
sed -r -e 's/[ \t]*$//' -e 's/^[ \t]*//' -e 's/^#.*$//' -e 's/[ \t]*#.*$//' -e '/^$/d' | \
sed -e ':a;N;$!ba;s/\([^;\{\}]\)\n/\1 /g' | \
grep -P 'server_name[ \t]' | grep -v '\$' | \
grep '\.' | \
sed -r -e 's/(\S)[ \t]+(\S)/\1\n\2/g' -e 's/[\t ]//g' -e 's/;//' -e 's/server_name//' | \
sort | uniq | xargs -L1