#!/bin/bash | |
# Force outbound traffic through the attached floating IP | |
# Script must be run as root | |
NET_INT="eth0" | |
CURL_TIMEOUT=3 | |
echo -n "Setting floating IP as the default gateway: " | |
# Check there's a floating IP attached to this droplet |
## | |
## HTTP Router benchmarks -- Nov 29, 2020 with Go 1.15.5 on Linux AMD 3950x | |
## | |
## This benchmark suite is based on https://github.com/julienschmidt/go-http-routing-benchmark | |
## using the most up-to-date version of each pkg as of today. Each router has their own | |
## pros and cons, so consider the designs of each router to suit your application. | |
## | |
## *NOTE*: the memory reports below by the go benchmark tool look quite wrong, as there must | |
## be a bug somewhere in the go bench tool with the Go version I'm running. I will re-run | |
## with future versions and report back. However, in general you'll want to look at the "ns/op" |
#!/bin/bash | |
# Force outbound traffic through the attached floating IP | |
NET_INT="eth0" | |
CURL_TIMEOUT=3 | |
echo -n "Setting floating IP as the default gateway: " | |
# Check there's a floating IP attached to this droplet | |
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
# en1 for WLAN | |
# en0 for Ethernet | |
sudo ifconfig en1 down | |
sudo route flush | |
sudo ifconfig en1 up |
Go has excellent build tools that mitigate the need for using make
.
For example, go install
won't update the target unless it's older
than the source files.
However, a Makefile can be convenient for wrapping Go commands with
specific build targets that simplify usage on the command line.
Since most of the targets are "phony", it's up to you to weigh the
pros and cons of having a dependency on make
versus using a shell
script. For the simplicity of being able to specify targets that
can be chained and can take advantage of make
's chained targets,
#!/bin/bash | |
# Flushing all rules | |
iptables -F FORWARD | |
iptables -F INPUT | |
iptables -F OUTPUT | |
iptables -X | |
# Setting default filter policy | |
iptables -P INPUT DROP | |
iptables -P OUTPUT DROP | |
iptables -P FORWARD DROP |
This CSS stylesheet allows you to preview markdown files in VSCode using GitHub's mardown theme. This CSS was taken directly from the official GitHub Markdown repo. I replaced their top-level .markdown-body
class with the body
tag so it would work in VSCode, and added styling for the html
tag to match GitHub's fixed-width container.
-
Copy the CSS file to your computer
Copy thegithub-markdown.css
file below to your computer. You can put it anywhere you want, but I chose to put it in the same folder as my VSCode settings file. -
Edit your VSCode settings
If you want to use this theme for all of your projects, then edit your User Settings file. If you just want to use this them