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/sh | |
LOGPATH="/usr/share/nginx/website/log" | |
PRODLOG="$LOGPATH/production.log" | |
TMPLOG="$LOGPATH/nginx_prod_$(date +"%Y_%m_%d_%H_%M_%S")" | |
cp "$PRODLOG" "$TMPLOG.log" | |
tar -P -czf "$TMPLOG.tar.gz" "$TMPLOG.log" |
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
var fs = require('fs'); | |
var markov = require('markov'); | |
var m = markov(2); | |
var s = fs.createReadStream(__dirname + '/input.txt'); | |
m.seed(s, function() { | |
var line = ''; | |
var res = m.respond(line.toString()).join(' '); | |
console.log(res); |
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
# creates a new post and starts the hugo server | |
if [ -z $1 ] | |
then | |
echo 'please supply a name for the new post in the form this-is-a-long-name.md' | |
else | |
echo "Created new post at posts/$1" | |
if [[ ${1:${#1}-3} == '.md' ]] | |
then | |
#Create new post |
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
#builds site | |
echo 'Building Hugo Site' | |
hugo | |
#optimize images | |
echo 'Optimizing Images' | |
node optimize_images.js -c -vv static/Uploads/ public/Uploads/ | |
while true; do |
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 node | |
const sharp = require('sharp'); | |
const fs = require('fs'); | |
const program = require('commander'); | |
const chalk = require('chalk'); | |
function increaseVerbosity(v, total) { | |
return total + 1; | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am joebasirico on github. | |
* I am joebasirico (https://keybase.io/joebasirico) on keybase. | |
* I have a public key whose fingerprint is 642C 85E7 1A6F 451F 8ECE A832 1DBA F07A 53AF 0E57 | |
To claim this, I am signing this object: |
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 python | |
## Attempts to get a domain transfer from the nameservers for the given domain | |
## Requires dnspython http://www.dnspython.org/ | |
import sys | |
import socket | |
from dns import resolver, query, exception | |
def do_axfr(nameserver, domain): | |
ns = str(resolver.query(nameserver, 'A')[0]) |