Skip to content

Instantly share code, notes, and snippets.

View WooodHead's full-sized avatar

WooodHead

  • Hangzhou
View GitHub Profile
@igoralves1
igoralves1 / loadbalancer.conf
Last active August 8, 2020 08:47
Using NGINX as HTTP load balancer, Load Balancing
upstream web_backend{
server 192.168.1.11:3000;
server 192.168.1.12:3000;
}
server {
listen 3000;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@markwylde
markwylde / create-swarm-cluster.sh
Last active December 10, 2021 13:06
Create a Docker Swarm cluster with a configuration amount of workers on Digital Ocean or using Virtual Box
# How many swarm workers do you want?
WORKER_COUNT="${WORKER_COUNT:-5}"
# What would you like to prefix all your VM's with?
CLUSTER_NAME="${CLUSTER_NAME:-mycluster}"
# Set this to true to use virtualbox instead of digitalocean driver
LOCAL_VIRTUALBOX="${LOCAL_VIRTUALBOX:-true}"
# Virtualbox Configuration
@akashkahalkar
akashkahalkar / startUpScript.scpt
Created June 6, 2019 15:37
Apple script to automatically start items after login
set apps to {"safari", "itunes"}
repeat with appToStart in apps
tell application appToStart to launch
delay 2
end repeat
delay 5
tell application "Safari"
if it is not running then
launch
end if
@johndevs
johndevs / get-all-files.gql
Last active March 19, 2022 20:54
Github GraphQL - Get all file contents in repository
# Provide $query as a variable.
# The query is the same as you would enter into the search field e.g. "org:johndevs in:name feedreader"
query GetFilesQuery($branch: GitObjectID, $query: String!) {
search(first: 1, type: REPOSITORY, query: $query) {
edges {
node {
... on Repository {
object(expression: "master:", oid: $branch) {
... on Tree {
version: "3"
services:
web:
image: project
restart: always
command: gunicorn conf.wsgi:application -c /opt/project/tools/docker/provision/gunicorn/production.py
expose:
- "8000"
volumes:
- .:/opt/project
@admerzeau
admerzeau / docker-compose.yml
Last active September 22, 2022 04:58
Docker compose file
version: "3"
services:
web:
image: project
restart: always
command: gunicorn conf.wsgi:application -c /opt/project/tools/docker/provision/gunicorn/production.py
expose:
- "8000"
volumes:
- .:/opt/project
@ianwesterfield
ianwesterfield / kube-master.sh
Created September 23, 2018 23:31
Kubernetes Digital Ocean Setup
# adapted from https://www.linode.com/docs/applications/containers/how-to-deploy-nginx-on-a-kubernetes-cluster/
# swap
swapoff -a
# hosts modify this to match the environment including all other cluster workers
echo '<PRIVATE IP> test-kube-master' >> /etc/hosts
echo '<PRIVATE IP> test-kube-worker-1' >> /etc/hosts
echo '<PRIVATE IP> test-kube-worker-2' >> /etc/hosts
@blackcater
blackcater / diagrams.md
Created July 6, 2018 16:45
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@tsukhu
tsukhu / queries.js
Last active June 29, 2018 08:59
react-git-explorer-gql
import { gql } from 'apollo-boost';
const GET_CURSOR_ORG_DATA = gql`
query($cursor: String, $org: String = "") {
organization(login: $org) {
repositories(
first: 50
after: $cursor
orderBy: { field: PUSHED_AT, direction: DESC }
) {
@donhenton
donhenton / docker-compose.yml
Last active April 8, 2025 14:37
Redis/Redis-commander Docker Compose with Persistence
version: '3'
services:
redis:
container_name: redis
hostname: redis
image: redis
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ~/redis/data:/data
ports: