Skip to content

Instantly share code, notes, and snippets.

View jamesmoriarty's full-sized avatar
🔮
0xc0000005

James Moriarty jamesmoriarty

🔮
0xc0000005
View GitHub Profile
@jamesmoriarty
jamesmoriarty / install.sh
Last active October 11, 2019 00:18
Amazon Linux Workspace Basics - Microsoft Code, Google Cloud SDK, ...
#!/bin/sh
# cat /etc/os-release
# NAME="Amazon Linux"
# ...
sudo yum -y install git docker htop tree golang ruby
sudo systemctl enable docker
button {
margin-left: 5px;
}
input {
margin: 5px;
}
form {
padding-right: 10px;
#!/bin/sh
for arg in "job1" "job2"; do
(
echo $arg
) & pids+=($!)
done
wait "${pids[@]}"
/**
* const typeDefs: ITypeDefinitions = `
* scalar StringOrInt
* ...
* height: StringOrInt
* `
*/
const resolvers: IResolvers = {
StringOrInt: {
// graph hosts by source over time.
_sourceCategory=<source>
| timeslice 1m
| count_distinct(_sourceHost) group by _timeslice, _sourceCategory
| transpose row _timeslice column _sourceCategory
// nginx requests per second.
_sourceCategory=<source>
ffmpeg -r 60 -pattern_type glob -i '*.JPG' -s hd720 -vcodec libx264 -crf 18 -preset slow timelapse.mp4
# Filters
#
# https://ffmpeg.org/ffmpeg-filters.html#eq
#
# ffplay -vf eq=contrast=1.3:saturation=0.25 timelapse.mp4
const crypto = require('crypto');
const sha256 = s => crypto.createHash('sha256').update(s, 'utf8').digest('hex');
// sha256("test") => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
// sha256("abc") => 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'
conky.config = {
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
alignment = 'middle_right',
background = false,
border_width = 1,
cpu_avg_samples = 10,
default_color = '#FFF',
default_outline_color = '#333',
[Varnish:80 -> NC:8080] -> [ELB:80]
vcl 4.0;
backend default {
.host = "${BACKEND_HOST}";
.port = "${BACKEND_PORT}";
}
sub vcl_recv {
if (req.method == "BAN") {
if (req.http.X-Cache-Tags) {