Skip to content

Instantly share code, notes, and snippets.

2017-01-16 08:40:53,218 [DEBUG @ msgpack_stream.py:send:33] 28705 - sent [0, 1, b'vim_get_api_info', ()]
2017-01-16 08:40:53,219 [DEBUG @ base.py:send:113] 28705 - Sending 'b'\x94\x00\x01\xb0vim_get_api_info\x90''
2017-01-16 08:40:53,219 [DEBUG @ base.py:run:138] 28705 - Entering event loop
2017-01-16 08:40:53,219 [DEBUG @ msgpack_stream.py:_on_data:54] 28705 - waiting for message...
2017-01-16 08:40:53,219 [DEBUG @ msgpack_stream.py:_on_data:56] 28705 - received message: [0, 1, b'poll', []]
2017-01-16 08:40:53,219 [DEBUG @ async_session.py:_on_request:86] 28705 - received request: b'poll', []
2017-01-16 08:40:53,219 [DEBUG @ msgpack_stream.py:_on_data:54] 28705 - waiting for message...
2017-01-16 08:40:53,219 [DEBUG @ msgpack_stream.py:_on_data:59] 28705 - unpacker needs more data...
2017-01-16 08:40:53,220 [DEBUG @ msgpack_stream.py:_on_data:54] 28705 - waiting for message...
2017-01-16 08:40:53,220 [DEBUG @ msgpack_stream.py:_on_data:56] 28705 - received message: [1, 1, None, [1, {b'error_types': {b'Valida
#!/usr/bin/env zsh
# from http://unix.stackexchange.com/a/141496/159078
#dependencies: pdftk, ImageMagick, gpg, wipe, openssl
signature=~/Drive/personal/sig-no-underline-cleaner.png
f=${1%.pdf}
page=$2
density=144
⟩ iex
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.4.0-rc.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> dt = DateTime.
compare/2 from_iso8601/1 from_naive!/2 from_naive/2
from_unix!/1 from_unix!/2 from_unix/1 from_unix/2
to_date/1 to_iso8601/1 to_naive/1 to_string/1
to_time/1 to_unix/1 to_unix/2 utc_now/0
@jc00ke
jc00ke / pipe.ex
Last active December 14, 2016 19:51
def call(conn, _options) do
config_info =
conn
|> get_jwt_from_header
|> verify_jwt
|> get_data
|> get_configuration
handle_authentication(conn, config_info)
end
@jc00ke
jc00ke / arch-linux-install
Last active April 2, 2023 19:10 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# This assumes a wifi only system...
require "json"
require "kemal"
macro build_routes(hash)
{% for route, info in hash %}
{{info[:method].id}} {{route}} do |env|
# originally I had info[:method] but that would kick out "put"
# but changing to info[:method].id kicked out put, which worked.
env.response.status_code = {{info[:status_code]}}
env.response.content_type = "application/json"
@jc00ke
jc00ke / openvpn_installer
Created July 18, 2016 15:13 — forked from mrrooijen/openvpn_installer
Installs OpenVPN
#!/bin/bash
# OpenVPN Installer
#
# This installer was designed to work with Ubuntu 14.04. It installs
# an OpenVPN server, generates an associated OpenVPN client configuration file,
# configures a firewall, and enables automatic security updates.
#
# Once the installer finishes, the `/root/client.ovpn` file will have been generated.
# Download this file to your local machine and open it in an OpenVPN client and you'll
@jc00ke
jc00ke / pre-push
Created June 16, 2016 23:35
pre-push git hook that runs Credo
#!/bin/sh
mix credo -i PipeChainStart
def call(%Plug.Conn{req_headers: [{"authorization", token}]} = conn, _options) when is_binary(token) do
# I want this to match
conn
end
# this ends up matching
def call(conn, _), do: halt(conn)
conn = %{conn(:get, "/ping") | req_headers: [{"authorization", "asdf"}]}
call(conn) # matches the first, cool
@jc00ke
jc00ke / user_data_hardening.sh
Last active February 11, 2016 01:22 — forked from bunchc/user_data_hardening.sh
Script for hardening a box via user-data
#!/bin/bash
# user-data-hardening.sh
# Authors: Cody Bunch ([email protected])
#
# Script intended to be supplied as userdata to a cloud of some flavor.
# Enables some sane sysctl defaults, turns up iptables, and
# installs a HIDS / NIDS package
# Supply your email here
echo "What's your email address?"