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
#Gently: | |
ps -ef | grep terraform | grep -v grep | awk '{print $2}' | xargs -n 1 kill | |
#Forcefully: | |
ps -ef | grep terraform | grep -v grep | awk '{print $2}' | xargs -n 1 kill -9 |
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 | |
# make sure to run this with /bin/bash, NOT /bin/sh | |
echo | |
echo This script will help you setup ssh public key authentication. | |
host=dummy |
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
import hudson.model.* | |
import jenkins.model.Jenkins | |
for (job in Jenkins.instance.items) { | |
if( job.getFullName().contains('my folder') ){ | |
stopJobs(job) | |
} | |
} |
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
#!/usr/bin/env python3 | |
import os | |
import glob | |
import shutil | |
from pathlib import Path | |
import math | |
dirs = [ | |
'/Volumes/Storage4', | |
'/Volumes/Storage3', |
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
registry: | |
restart: always | |
image: registry:latest | |
ports: | |
- 443:5000 | |
environment: | |
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt | |
REGISTRY_HTTP_TLS_KEY: /certs/domain.key | |
REGISTRY_AUTH: htpasswd | |
REGISTRY_AUTH_HTPASSWD_PATH: /var/lib/registry/passfile |
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
package utilities | |
import ( | |
"path/filepath" | |
"os" | |
"sync" | |
"io/ioutil" | |
"time" | |
"github.com/vmihailenco/msgpack" | |
) |
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
# put this file in /etc/systemd/system/ as root | |
# below paths assume solr installed in /opt/solr, SOLR_PID_DIR is /data | |
# and that all configuration exists in /etc/default/solr.in.sh which is the case if previously installed as an init.d service | |
# change port in pid file if differs | |
# note that it is configured to auto restart solr if it fails (Restart=on-faliure) and that's the motivation indeed :) | |
# to switch from systemv (init.d) to systemd, do the following after creating this file: | |
# sudo systemctl daemon-reload | |
# sudo service solr stop # if already running | |
# sudo systemctl enable solr | |
# systemctl start solr |
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
# filter by request host header | |
varnishlog -q 'ReqHeader ~ "Host: example.com"' | |
# filter by request url | |
varnishlog -q 'ReqURL ~ "^/some/path/"' | |
# filter by client ip (behind reverse proxy) | |
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"' | |
# filter by request host header and show request url and referrer header |
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
#!/usr/bin/env bash | |
set -eo pipefail | |
READ_LINK=$([[ "$OSTYPE" == "darwin"* ]] && echo greadlink || echo readlink) | |
cd "$(dirname $(${READ_LINK} -f "${BASH_SOURCE[0]}"))/.." | |
IP=$(hcloud server list --selector "name=$1" --output noheader --output columns=IPV4) | |
echo Connecting to $1 IP: $IP |
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
version: "3.3" | |
services: | |
postgres: | |
image: postgres:latest | |
restart: always | |
environment: | |
POSTGRES_PASSWORD: postgres | |
volumes: | |
- ./docker/containers/postgresql/data:/var/lib/postgresql/data | |
ports: |