This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$docker run -m 200MB openjdk:8u131-jre-alpine java -XshowSettings:vm -version | |
VM settings: | |
Max. Heap Size (Estimated): 444.50M | |
Ergonomics Machine Class: server | |
Using VM: OpenJDK 64-Bit Server VM | |
openjdk version "1.8.0_131" | |
OpenJDK Runtime Environment (IcedTea 3.4.0) (Alpine 8.131.11-r1) | |
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SD_CARD="/dev/disk1000" | |
LOCAL="~/Desktop/2013-09-25-wheezy-raspbian-minimal.img" | |
# First, unmount the disk | |
diskutil unmountDisk ${SD_CARD} | |
# If you are writing from SD card to Mac, calculate the number of bytes to skip as well as the size to pipe to pv. | |
# 5785600 bytes (count) * 512 (default bs) = 2962227200 bytes == 2825 Megabytes | |
dd if=${SD_CARD} count=5785600 | pv -s 2825M | dd of=${LOCAL} count=5785600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# cliv - Execute commands using a specific .env and directory | |
set -eu | |
_err () { printf "%s\n" "$0: Error: $*" ; exit 1 ; } | |
HOME="${HOME:-$(getent passwd $(id -u) | cut -d : -f 6)}" | |
[ -d "$HOME/.cliv" ] || mkdir -p "$HOME/.cliv" | |
if [ $# -lt 1 ] || [ "$1" = "-h" ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias -g subl=subl | |
PATH=$PATH:/usr/local/bin/; export PATH | |
export PATH=/usr/local/heroku/bin | |
# Exports {{{ | |
export GITHUB_USER="yourgithubusername" | |
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin # Reorder PATH so local bin is first | |
export PATH=$PATH:$HOME/anaconda/bin | |
export GREP_OPTIONS='--color=auto' | |
export GREP_COLOR='1;32' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Security groups that contain 0.0.0.0/0 rules | |
aws ec2 describe-security-groups --filters Name=ip-permission.cidr,Values=0.0.0.0/0 --output=text | grep SECURITYGROUPS | |
# Security groups for ElasticSearch | |
aws ec2 describe-security-groups --filters Name=ip-permission.from-port,Values=9200 --output=text | grep SECURITYGROUPS | |
# Search last 10,000/1MB of CloudTrail logs for 'AccessDenied' (removed AWS account number from stream name) | |
aws logs get-log-events --log-group-name CloudTrail/DefaultLogGroup --log-stream-name 000000000000_CloudTrail_eu-west-1 | grep AccessDenied | |
# Get number of AWS API calls in time period (assumes a Cloudwatch Logs 'catch-all' filter and metric has been created against CloudTrail logs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Remove Facebook sponsored posts | |
!facebook.com##div[data-pagelet^="FeedUnit"]:has(a[role^=button]:has(> span > span:matches-css(position: relative):has-text(S))) | |
!facebook.com##div[data-pagelet^="FeedUnit"]:has(div[role^=button]:has(> span > span:matches-css(position: relative):has-text(S))) | |
!facebook.com##div[data-pagelet^="FeedUnit"]:has(a[aria-label="Sponsored"]) | |
facebook.com##div[role="feed"] div > span > span > a > span:upward(div[role="feed"] > div) | |
! Remove Facebook "Suggested for You" | |
!facebook.com##div[data-pagelet^="FeedUnit"]:has(div[role="article"]:has(span > span > span:has-text(Suggested for You))) | |
! Remove Facebook "New Message" | |
facebook.com##span:has(div[aria-label="New Message"]) | |
! Remove Facebook "Create Room" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import argparse | |
import re | |
import csv | |
from datetime import datetime as dt | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import PDFPageAggregator | |
from pdfminer.layout import LTPage, LTChar, LTAnno, LAParams, LTTextBox, LTTextLine | |
from pdfminer.pdfpage import PDFPage |
OlderNewer