Skip to content

Instantly share code, notes, and snippets.

@maxwellb
maxwellb / README
Created August 8, 2017 01:11
Debian SSH failed attempts
ssh-fails.sh
------------
Greps the journal from the SSH service to report failed attempts to access SSH. This information can be used to apply filtering policies. Examples follow.
root@war:~# ./ssh-fails.sh 2d top 10
17534 42.7.26.60
2933 123.183.209.135
2436 116.31.116.11
167 211.140.199.244
@maxwellb
maxwellb / keybase.md
Last active October 4, 2017 18:16
keybase.md

Keybase proof

I hereby claim:

  • I am maxwellb on github.
  • I am maxwellb (https://keybase.io/maxwellb) on keybase.
  • I have a public key ASCdPn-MaQ_SepDo42FVJthfbw1VGlVXcKdT1U5d6AmYlAo

To claim this, I am signing this object:

@maxwellb
maxwellb / README.md
Last active October 12, 2017 20:17
A Linode Manager on Webtask

The included files are two tasks for Webtask (https://webtask.io/edit). The linode-mgmt task is the manager, and linode-profile an example of calling the Linode API from behind a task.

Getting started:

  • Create the two tasks.
  • Set the ACCESS_KEY secret on both tasks to the same value as each other, chosen at random.
  • Create an API Client in your Linode profile (https://cloud.linode.com/profile/clients) that sets the Redirect URI to "https://*.run.webtask.io/linode-mgmt/login", filling in the appropriate domain for your Webtask.
  • Set the CLIENT_ID and CLIENT_SECRET secrets in the linode-mgmt task to the appropriate values for your new API Client.

Limitations:

  • Linode documentation (as of last edit) directs the use of a parameter called "scope" to specify scopes, but in practice "scopes" appears to be the correct parameter name.
@maxwellb
maxwellb / microfeedback.js
Created November 10, 2017 05:13
Webtask + microfeedback + keybase-encrypt + trello
"use latest";
/*
Copyright (c) 2017 Maxwell Bloch, All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import express from "express";
import { fromExpress } from "webtask-tools";
import bodyParser from "body-parser";
@maxwellb
maxwellb / webpack.config.js
Created November 24, 2017 21:35
A relatively minimal Webpack configuration file
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
app: './entry/app'
},
output: {
path: path.resolve('../MVCApplication1/Scripts/App'),
filename: '[name].js'
@maxwellb
maxwellb / .bash_aliases
Last active September 1, 2018 15:24
Docker .bash_aliases
# CLI helpers
alias ls-docker-image='docker image list | sed -E '\''s/\s+/\t/g'\'' | cut -f 1,2 | sed -E '\''s/(.*)\s+(.*)/\1:\2/'\'' | tail -n+2 | sort | uniq'
alias update-docker-images='ls-docker-image | while read r ; do docker pull $r ; done'
# Docker commands
## az: microsoft/azure-cli
alias az='docker inspect az 2>/dev/null >/dev/null || docker run -dit --name az microsoft/azure-cli >/dev/null && docker inspect az | grep Status | grep -v running >/dev/null && docker start az >/dev/null && false || docker exec -it az az'
@maxwellb
maxwellb / Figure 1
Created November 6, 2018 04:07
Figure captions: Cloud storage for Git with OneDrive on LinkedIn
Screenshot
Command prompt: C:\repos\HelloWorld>
Output of command "git merge section": 1 file changed, 6 insertions.
Output of command "git log --graph": branching history of changes.
Output of command "git status": On branch master. Nothing to commit. Working tree clean.
Output of command "git remote -v": (empty)
@maxwellb
maxwellb / .motd
Created December 20, 2018 21:47
clear-motd
#!/usr/bin/env bash
# To use set the follow alias in your .bash_profile or .bashrc
# and then save this file as ~.motd, and chmod +x on it.
#
# alias clear='clear && ([ -x ~/.motd ] && ~/.motd || true) || ([ -f ~/.motd ] && cat ~/.motd)'
#
# Copyright (c) 2018 Maxwell Bloch, MIT licensed
#
echo `df -h ~ | xargs echo | cut -d' ' -f12` used, `df -h ~ | xargs echo | cut -d' ' -f11` free on \$HOME
@maxwellb
maxwellb / 0 NodeJS-bash starter scripts
Last active January 23, 2019 19:19
NodeJS/bash starter scripts
...
@maxwellb
maxwellb / 0 Gentoo-Prefix chroot for Chrome OS
Last active April 1, 2019 22:56
Gentoo-Prefix chroot for Chrome OS
...