Skip to content

Instantly share code, notes, and snippets.

View andykais's full-sized avatar

Andrew Kaiser andykais

View GitHub Profile
@andykais
andykais / dns_check.sh
Created August 26, 2015 02:00
check every hour if my dns manager has allowed github pages redirect, send a text message if it has
#!/bin/bash
#one hour (in seconds)
wait=$((60 * 60))
while true
do
dns=$(dig andykais.com +nostats +nocomments +nocmd)
if [[ $dns == *"github"* ]]
then
@andykais
andykais / roc.sh
Last active May 18, 2016 17:37
autorun a command when a file is saved
#!/bin/sh
FORMAT=$(echo -e "\033[1;33m%w%f\033[0m written at $(date +'%r')")
clear
while true
do
clear\
&& echo "[Running \"$@\" on files changes in $(pwd) at $(date +'%r')]"\
&& echo ""\
&& echo "$@" > /home/andrew/bin/data/lastroc.sh\
&& bash /home/andrew/bin/data/lastroc.sh 0>/dev/null \
@andykais
andykais / zcomic.sh
Created October 2, 2015 16:29
save images as rar file, then rename as .cbr
#!/bin/bash
comicdir=$1
if [ -d "$comicdir" ]
then
outname=$(echo $comicdir | sed -e 's/\///')
outname=$(echo $outname | sed -e 's/\ /_/g')

possible topics

humans are just a new balance to the ecosystem

  • we destabilize ecosystems
  • open areas for new growth
    • like phosphorous plankton
  • also talk about resources that we use that cannot be put back into the environment

will populating mars solve earths over population?

  • talk about our population's growing capacity
  • water found on mars
@andykais
andykais / cocaine.sh
Created December 11, 2015 23:26
prevents ubuntu screen from shutting off
#!/bin/bash
case "$1" in
"on")
xset -dpms
xset s noblank
xset s off
;;
"off")
@andykais
andykais / nightphototips.md
Last active February 7, 2016 16:23
astrophotography quick guide

Supplies Needed:

(essential are in bold)

  • Manual Control Camera (aperture, shutter, iso)
  • Lens (wider the better)
  • Tripod (heavier the better)
  • remote shutter

Setup

Location

Pick an area with as little light pollution as possible, including light you can see over the horizon from neighboring civilization.

@andykais
andykais / remote_shutter.md
Created March 20, 2016 15:25
my tips for better remote shuttering
selector definition
DELAY how long to wait before first shot
LONG how long to shutter is open for
INTVL how long to wait between shots
N number of shots to take

Lock/Unlock

Press light + SET

@andykais
andykais / .gitignore
Created May 4, 2016 11:19
.gitignore file for my home directory
#blacklist top level folder
/*
#whitelist files & folders
!.gitignore
!README.md
!.i3/
!.i3status.conf

Keybase proof

I hereby claim:

  • I am andykais on github.
  • I am andykais (https://keybase.io/andykais) on keybase.
  • I have a public key whose fingerprint is F786 85F5 86CB 5D59 4316 9903 8DE2 6E2C 149A 2F85

To claim this, I am signing this object:

@andykais
andykais / code.erl
Last active October 27, 2016 20:59
merge(A, []) -> {A, 0};
merge([], B) -> {B, 0};
merge([Ha|Ta], [Hb|Tb]) ->
if
Ha < Hb -> {MergedList, N}=merge(Ta, [Hb|Tb]),
{[Ha | MergedList], N};
true -> {MergedList, N}=merge([Ha|Ta], Tb),
{[Hb | MergedList], N + 1}
end.