Skip to content

Instantly share code, notes, and snippets.

View toringe's full-sized avatar

Tor Inge Skaar toringe

  • Oslo, Norway
View GitHub Profile
@toringe
toringe / get_price.py
Last active February 14, 2022 22:33
Boto3 Pricing API simplification v1
import boto3
import json
from pkg_resources import resource_filename
# Search product filter. This will reduce the amount of data returned by the
# get_products function of the Pricing API
FLT = '[{{"Field": "tenancy", "Value": "shared", "Type": "TERM_MATCH"}},'\
'{{"Field": "operatingSystem", "Value": "{o}", "Type": "TERM_MATCH"}},'\
'{{"Field": "preInstalledSw", "Value": "NA", "Type": "TERM_MATCH"}},'\
'{{"Field": "instanceType", "Value": "{t}", "Type": "TERM_MATCH"}},'\
@toringe
toringe / cidr.py
Created October 22, 2015 10:28
Merge CIDR blocks into super blocks if possible
#!/usr/bin/env python
#
# Example 1: All blocks in list.txt, one CIDR per line
# cat list.txt | cidr.py
#
# Example 2: Echo CIDR blocks to stdout
# echo 1.2.3.0/25 1.2.3.128/25 | cidr.py
import sys
from netaddr import *
@toringe
toringe / jcurl
Last active August 29, 2015 14:27
prettify and colorize JSON output from cURL, useful when interacting with REST API from console.
#!/bin/bash
#------------------------------------------------------------------------------#
# JSON cURL - prettify and colorize JSON output from cURL, useful when #
# interacting with REST API from console. #
# #
# Requirements: cURL, Python (JSON module) and Pygmentize #
# #
# Author: Tor Inge Skaar #
#------------------------------------------------------------------------------#
@toringe
toringe / .vimrc
Last active October 22, 2015 10:36
My VIM configuration
call pathogen#infect() " Use Pathogen manager
syntax on " Enable syntax highlighting
set t_Co=256 " Terminal is 256 color capable
set background=dark " Light colors
colorscheme gruvbox " Color scheme
set fileformat=unix " Always use unix line endings
set noerrorbells " Don't make any noise
set number " Show line numbers
set ts=4 " Set TABs to have 4 spaces
set autoindent " Auto indent
@toringe
toringe / rwallformats-all.pl.patch
Created July 1, 2015 12:19
SiLK rwconvert tests patch by Mark Thomas (CERT)
diff --git a/src/rwconvert/tests/rwallformats-all.pl b/src/rwconvert/tests/rwallformats-all.pl
--- a/src/rwconvert/tests/rwallformats-all.pl
+++ b/src/rwconvert/tests/rwallformats-all.pl
@@ -637,3 +637,7 @@ de98d83fa8969ae3e26af2ebfe85abf2 FT_RWW
8fffb563e2eb43257450e25f098afe7b FT_RWWWW-v4-c2-L.dat
b0d369d8c9ba2d73dda356fb9abdd35e FT_RWWWW-v5-c2-B.dat
a5bb40388a14669608958dcec52e9b11 FT_RWWWW-v5-c2-L.dat
+
+# LZO-2.06 on 32-bit Ubuntu gives different results for two files
+eec70dcca953c0dcefeeafbffae6bd97 FT_RWIPV6ROUTING-v3-c2-B.dat

Keybase proof

I hereby claim:

  • I am toringe on github.
  • I am toringe (https://keybase.io/toringe) on keybase.
  • I have a public key whose fingerprint is B1D7 9928 47B5 F9FB 20B6 4C8C 7326 30BD 60EB 312E

To claim this, I am signing this object: