Skip to content

Instantly share code, notes, and snippets.

View rikkuness's full-sized avatar
🇬🇧
👀

Darrian rikkuness

🇬🇧
👀
View GitHub Profile
@rikkuness
rikkuness / README.md
Last active December 14, 2022 14:23
Restore DynamoDB exported data to Localstack

Restore a DynamoDB export to Localstack

Download the .json.gz file from S3, decompress it with gzip -d and then push it with the below:

You'll need to modify "MyTable" to match your destination table name and data.json to whatever input file you're using.

jq -c -s '_nwise(25)|{"MyTable":map({"PutRequest":.})}' < data.json | while read item 
do 
  echo $item > a && awslocal dynamodb batch-write-item --request-items file://a && rm a
done
@rikkuness
rikkuness / .zshrc
Last active April 6, 2022 16:53
.zshrc
export GOPATH=/$HOME/Code/go
PATH="$PATH:/usr/local/bin/"
PATH="$PATH:$HOME/homebrew/bin"
PATH="$PATH:$HOME/bin"
PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH=$PATH
export EDITOR=/usr/bin/vim
export PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# '
@rikkuness
rikkuness / notes.md
Last active May 25, 2020 17:16
Raspbian Setup

Enabling the Tontec LCD

raspi-config Interfacing > SPI enable Edit /boot/cmdline.txt and add fbcon=map:10 to the end

Installing Go

wget https://dl.google.com/go/go1.14.3.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.14.3.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
@rikkuness
rikkuness / index.html
Created December 20, 2019 23:28
GIF Scroller Loader Thing
<html>
<head>
<link rel='stylesheet' type='text/css' href='style.css' />
</head>
<body>
<div class='parent'>
<div id='infinite-div'></div>
</div>
@rikkuness
rikkuness / bond_config.yml
Created July 29, 2019 22:31
Ansible Bonds
- name: Debugger
debug:
msg: "{{ bond }}"
- name: Bond config {{ bond.name }}
template:
src: ifcfg-bond.j2
dest: "/tmp/ifcfg-{{ bond.name }}"
mode: 0644
@rikkuness
rikkuness / example.go
Created September 5, 2018 14:43
Go Unmarshall JSON by Type
package main
import (
"encoding/json"
"fmt"
"log"
)
type Requests []request
@rikkuness
rikkuness / service-check.js
Created August 8, 2017 23:56
Service Status Check
const dns = require('dns')
const net = require('net')
let checks = [
{ name: 'NA Login Servers', dns: 'auth1.101.arenanetworks.com', port: 6112 },
{ name: 'EU Login Servers', dns: 'auth2.101.arenanetworks.com', port: 6112 },
]
const getStatus = (item) => {
return new Promise((resolve, reject) => {
@rikkuness
rikkuness / express-ibac.js
Last active August 2, 2017 22:47
expressldapibac
// Groups as they return from LDAP etc..
let groups = [
'ABC-123-12345-padm',
'ABC-123-cadm',
'ABC-456-12345-padm',
'ABC-456-54321-padm',
'ABC-DOG-SPADE-pmon',
'ABC-DOG-cadm',
]
var async = require('async');
var request = require('request');
var influx = require('influx');
var humanizeDuration = require('humanize-duration')
// Config
var endpoint = 'https://api.guildwars2.com/v2';
var DbHost = 'localhost';
var ShipSize = 200;
var QueueSize = 10;
@rikkuness
rikkuness / .bash_profile
Created August 10, 2016 09:54
bash profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management