Skip to content

Instantly share code, notes, and snippets.

View mraaroncruz's full-sized avatar
🏃‍♂️

Aaron Cruz mraaroncruz

🏃‍♂️
View GitHub Profile
@mraaroncruz
mraaroncruz / README-setup-tunnel-as-systemd-service.md
Created February 2, 2018 14:47 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@mraaroncruz
mraaroncruz / wol_via_dhcp.go
Last active February 1, 2018 15:38
Read MAC addresses from your dhcp.leases file and send them Magic Packets to Wake On LAN
package main
// Core code borrowed from the cmd/ files in http://github.com/sabhiram/go-wol
import (
"bufio"
"errors"
"flag"
"fmt"
"os"
@mraaroncruz
mraaroncruz / autossh.service
Created January 25, 2018 21:03 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
@mraaroncruz
mraaroncruz / ethminer_ubuntu_nvidia.md
Created January 10, 2018 11:16 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware

@mraaroncruz
mraaroncruz / cmd.sh
Created December 30, 2017 10:42 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@mraaroncruz
mraaroncruz / george.rb
Created December 10, 2017 20:10
george is down
require "typhoeus"
loop do
puts "In Loop"
res = Typhoeus.get("https://george.sparkasse.at/")
if res.success?
unless res.body =~ /George arbeitet an sich/
`say "George is back online!"`
return
end
@mraaroncruz
mraaroncruz / crawl.rake
Created December 9, 2017 21:42 — forked from tansengming/crawl.rake
Rake task to crawl you rails app for broken links
# Use this to look for broken links in your app.
# crawls the development server http://localhost:3000
# Suggestion: Also check to make sure that intentional 404s
# are handled gracefully by app.
task :crawl => :environment do
require 'anemone'
root = 'http://localhost:3000'
options = {:discard_page_bodies => true, :verbose => true}
@mraaroncruz
mraaroncruz / dokku.md
Last active December 8, 2017 11:30
Some docker

Deploy to Dokku Steps

  • Create droplet on DIGIOCEAN
  • Update DNS
  • install dokku
wget https://raw.githubusercontent.com/dokku/dokku/v0.10.5/bootstrap.sh;
sudo DOKKU_TAG=v0.10.5 bash bootstrap.sh
@mraaroncruz
mraaroncruz / circle.yml
Created December 1, 2017 12:35 — forked from tompesman/circle.yml
CicleCI config for Elixir with Phoenix Framework and deployment to Heroku
machine:
node:
version: 6.2.0
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
MIX_ENV: "test"
services:
- postgresql
database:
@mraaroncruz
mraaroncruz / docker-compose.yml
Created November 25, 2017 22:11
docker compose for discourse
# https://github.com/indiehosters/discourse
# https://github.com/indiehosters/docker-discourse/blob/master/Dockerfile
version: '2'
networks:
lb_web:
external: true
back:
driver: bridge
services: