# get list of your projects
gcloud projects list
# set current project
gcloud config set project gribdown
# set compute-zone
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
SHELL := /bin/bash | |
.PHONY: pushify.js test clean package | |
bin: pushify.js | |
pushify.js: Pushify.elm | |
@elm make Pushify.elm --optimize --output pushify.js || notify-send "elm compilation failed" | |
@cp pushify.js ../api/web/static/pushify.js | |
watch: |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/influxdata/influxdb/client/v2" | |
"strings" | |
"flag" | |
) |
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
version: '3' | |
services: | |
autr: | |
build: . | |
ports: | |
- "8080:8080" | |
prometheus: | |
image: "prom/prometheus:v2.0.0" |
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
#1: install nginx | |
#2: install certbot and follow instructions to generate certificate: https://certbot.eff.org/ | |
#3: configure nginx with the content below(replace references to bytecode.no with your domain(s) | |
#4: add a cronjob as root: | |
0 1 */15 * * certbot renew >/dev/null 2>&1 | |
#5: submit request to be sts preloaded in chrome here: https://hstspreload.org/ | |
server { | |
server_name bytecode.no www.bytecode.no; |
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 bash | |
urldate=`date +%Y%m%d%H` | |
mkdir -p "data/gfs/$urldate" | |
cd "data/gfs/$urldate" | |
for no in `seq -f "%03g" 0 3 30`; | |
do | |
echo " Fetching log for date $urldate, no $no" |
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/bash | |
failing=0 | |
while : | |
do | |
go test > /dev/null | |
if [ "$?" = "1" ]; then | |
if [ "$failing" = "1" ]; then | |
echo "Continuing failure!" |
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
package main | |
import ( | |
"github.com/Shopify/sarama" | |
"log" | |
"time" | |
"fmt" | |
"strings" | |
) |
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
package main | |
import ( | |
"fmt" | |
"github.com/Shopify/sarama" | |
"os" | |
"os/signal" | |
"strings" | |
) |
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
sudo apt-get install tshark | |
sudo ifconfig wlp2s0 down | |
sudo iwconfig wlp2s0 mode monitor | |
sudo ifconfig wlp2s0 up | |
tshark -i wlp2s0 -N m -T fields -e eth.addr_resolved -e eth.addr |