-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Evan Thomas
committed
Aug 18, 2020
1 parent
161cb63
commit 34910ec
Showing
12 changed files
with
111 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function! MakeHeader() | ||
let l:text = trim(getline('.')) | ||
let l:textlen = strlen(l:text) | ||
let l:headerlen = 79 | ||
let l:row1 = repeat(join(['#'], ''), l:headerlen) | ||
let l:row2BeginLen = (l:headerlen - l:textlen - 2 + 1) / 2 | ||
let l:row2EndLen = (l:headerlen - l:textlen - 2) / 2 | ||
let l:row2 = repeat(join(['#'], ''), l:row2BeginLen) . | ||
\ ' ' . l:text . ' ' . | ||
\ repeat(join(['#'], ''), l:row2EndLen) | ||
|
||
call append(line('.'), l:row1) | ||
call append(line('.'), l:row2) | ||
call append(line('.'), l:row1) | ||
" for some reason internet says not to use normal in vimscript | ||
normal! dd | ||
endfunction | ||
|
||
command! -nargs=0 Header call MakeHeader() |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
#!/bin/bash | ||
|
||
/home/evan/.pyenv/shims/python3.8 -m venv venv | ||
echo "source venv/bin/activate" > .envrc | ||
echo "source venv/bin/activate" >> .envrc | ||
source venv/bin/activate | ||
pip install flake8 | ||
pip install mypy | ||
pip install black | ||
pip install jedi | ||
|
||
cat <<EOF >> pyproject.toml | ||
[tool.black] | ||
line-length = 79 | ||
EOF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# https://hub.docker.com/r/diginc/pi-hole/ | ||
|
||
# IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" # May not work for VPN / tun0 | ||
# IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')" # May not work for VPN / tun0 | ||
# IP="${IP:-$IP_LOOKUP}" # use $IP, if set, otherwise IP_LOOKUP | ||
# IPv6="${IPv6:-$IPv6_LOOKUP}" # use $IPv6, if set, otherwise IP_LOOKUP | ||
# DOCKER_CONFIGS="$(pwd)" # Default of directory you run this from, update to where ever. | ||
|
||
ServerIP=$(curl api.ipify) | ||
WEBPASSWORD=muttley1 | ||
DOCKER_CONFIGS=$(pwd) | ||
|
||
echo "### Make sure your IPs are correct, hard code ServerIP ENV VARs if necessary\nIP: ${IP}\nIPv6: ${IPv6}" | ||
docker run -d \ | ||
--name pihole \ | ||
-p 53:53/tcp -p 53:53/udp \ | ||
-p 67:67/udp \ | ||
-p 80:80 \ | ||
-p 443:443 \ | ||
-v "${DOCKER_CONFIGS}/pihole/:/etc/pihole/" \ | ||
-v "${DOCKER_CONFIGS}/dnsmasq.d/:/etc/dnsmasq.d/" \ | ||
-e ServerIP="${IP}" \ | ||
# -e ServerIPv6="${IPv6}" \ | ||
--restart=unless-stopped \ | ||
--cap-add=NET_ADMIN \ | ||
diginc/pi-hole:latest | ||
|
||
echo -n "Your password for https://${IP}/admin/ is " | ||
docker logs pihole 2> /dev/null | grep 'password:' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
docker run --rm -it \ | ||
-e POSTGRES_PASSWORD=password -e POSTGRES_USER=evan -e POSTGRES_DB=evan \ | ||
-p 5432:5432 \ | ||
postgres:12.2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
import random | ||
|
||
lines = [line.strip() for line in sys.stdin.readlines()] | ||
random.shuffle(lines) | ||
for line in lines: | ||
print(line) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# stolen from https://stackoverflow.com/questions/37986523/how-can-i-create-a-stopwatch-in-bash | ||
now=$(date +%s)sec; watch -n0.1 -p TZ=UTC date --date now-$now +%H:%M:%S.%N |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
now=$(date +%s)sec; watch -n0.1 -p TZ=UTC date --date now-$now +%H:%M:%S.%N |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
date +%Y%m%d |