#cloud-config | |
# Enable automatic package updates and upgrades during cloud-init execution | |
package_update: true | |
package_upgrade: true | |
packages: | |
# Security and Hardening | |
- ufw | |
- fail2ban |
sed -E -f solver.sed input
where input
is a file containing the maze.
For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p
.
The solver assumes the following:
- The maze only contains the characters
# \nSE
- Every line has the same number of characters
- There is only one start (
S
) and end (E
)
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
%% ETS CIDR Benchmark (nested blocks, IPv4 and IPv6) | |
%% | |
%% Written in 2015 by Adam Cammack <[email protected]> | |
%% | |
%% To the extent possible under law, the author have dedicated all copyright and | |
%% related and neighboring rights to this software to the public domain | |
%% worldwide. This software is distributed without any warranty. | |
%% | |
%% See <http://creativecommons.org/publicdomain/zero/1.0/> |
about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar.
Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and
rendering normally. Some settings may also make firefox unstable.
I am not liable for any damages/loss of data.
Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions
(HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".
awsargs="--profile aws-dev --region us-east-1" | |
now=$(date -j -f "%a %b %d %T %Z %Y" "$(date)" "+%s" 2>/dev/null); | |
oneweekago=$(expr $now - 604800); | |
aws elasticbeanstalk describe-application-versions $awsargs | \ | |
jq -r '.ApplicationVersions[] | .ApplicationName + " " + .VersionLabel + " " + .DateCreated'| \ | |
while read line ; do | |
fields=( $line ) | |
utime=$(date -j -f %Y-%m-%dT%H:%M:%S "${fields[2]};" "+%s" 2>/dev/null); | |
if [[ $utime -lt $oneweekago ]]; then | |
if [ -n "$(aws elasticbeanstalk describe-environments $awsargs \ |
NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good
This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.
My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.
Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class WMStats { | |
private static final String FILE_NAME = "pagecounts-20141029-230000"; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Keen IO ♥ Histograms!</title> | |
</head> | |
<body> | |
<div id="histogram"></div> | |
<script src="http://d26b395fwzu5fz.cloudfront.net/latest/keen.min.js"></script> | |
<script> | |
!function(){ |