Skip to content

Instantly share code, notes, and snippets.

View wilrnh's full-sized avatar

William Hutson wilrnh

View GitHub Profile
@jagrosh
jagrosh / Growing A Discord Server.md
Last active July 22, 2024 17:55
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background

@rafaeltuelho
rafaeltuelho / linux-shell-docker-cli.sh
Last active July 12, 2024 09:30
Some useful shell aliases and function for Docker command line
# Docker aliases
alias di='sudo docker images'
alias dps='sudo docker ps -a'
# useful Docker functions
dock-run() { sudo docker run -i -t --privileged $@ ;}
dock-exec() { sudo docker exec -i -t $@ /bin/bash ;}
dock-log() { sudo docker logs --tail=all -f $@ ;}
dock-port() { sudo docker port $@ ;}
dock-vol() { sudo docker inspect --format '{{ .Volumes }}' $@ ;}
@Frick
Frick / fixssh.sh
Last active April 9, 2019 14:48
Quick way of fixing host SSH changes without flat out disabling StrictHostKeyChecking
function fixssh {
local hostname=""
local ip=""
for arg in $@; do
local hostout=$(host "$arg" 2>/dev/null)
if [ $? -eq 0 ]; then
local out=$(echo "$hostout" | grep -o "has address .*$" | grep -Eo "[0-9.]{7,15}")
if [ $? -eq 0 ]; then
local hostname="$arg"
local ip="$out"
@Frick
Frick / listening.sh
Last active May 29, 2022 14:11
A function I keep in my .bashrc for quickly determining what processes are listening on what ports, protocols and interfaces - sorted by port number.
function listening {
if [ "${1}" = "-h" ]; then
echo "Usage: listening [t|tcp|u|udp] [ps regex]"
return
fi
DISP="both"
NSOPTS="tu"
if [ "${1}" = "t" -o "${1}" = "tcp" ]; then
DISP="tcp"
NSOPTS="t"
@Frick
Frick / openfiles.sh
Last active July 29, 2020 06:28
A function I keep in my .bashrc for quickly finding what files a process has open.
function openfiles {
if [ "${1}" = "-h" ]; then
echo -e "Usage: openfiles [r|w|m|R|W] regex\n -r opened for reading or read/write\n -w opened for writing or read/write\n -m accessed from memory (includes running command)\n -R opened for reading only\n -W opened for writing only"
return
fi
if [ "$#" = "0" ]; then
echo "Process signature/regex required."
return
fi
MODE="(w|u)"
@chalmerj
chalmerj / gist:1492384
Created December 18, 2011 04:39
Init script for Graphite carbon-cache
#! /bin/sh
### BEGIN INIT INFO
# Provides: carbon-cache
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: carbon-cache init script
# Description: An init script for Graphite's carbon-cache daemon.
### END INIT INFO