Skip to content

Instantly share code, notes, and snippets.

@weavenet
weavenet / install.sh
Last active October 20, 2022 18:23
Weavnet Dotfiles Auto Install Cpio
#!/bin/bash
set -e
VERSION=0.0.2
#
# Create CPIO Archive, derivitive of tar script for containers that don't have tar https://gist.github.com/weavenet/32b0938e5aea6f3dd18fb98e2bfbdd42
# extract the lastest tar archive
#
@weavenet
weavenet / install.sh
Last active October 20, 2022 17:30
Weavnet Dotfiles Auto Install Tar
#!/bin/bash
set -e
VERSION=0.0.2
DIRECTORY=$HOME/dotfiles_weavenet
echo "Making dotfile directory to '$DIRECTORY'"
mkdir -p $DIRECTORY
# Examples on how to store secret data outside of dotfiles
#
# Encyrpted cipher text created via:
#
# echo SECRET_VALUE | openssl enc -e -aes-256-cbc -a -salt -pass pass:`cat ~/.password`
#
password=`cat ~/.password`
cipher_text=U2FsdGVkX1/OGxV6uRFeFfihJXZ/DU8rOibHL3uKxcY=
export SECRET1=`echo $cipher_text | openssl enc -d -aes-256-cbc -a -salt -pass pass:$password`
@weavenet
weavenet / README.md
Created December 2, 2017 16:49
Python script to delete all chat messages in key base

keybase-chat-cleanup

Simple python script to delete all chat messages in your keybase account.

It shells out to the keybase CLI command to access the keybase api.

It expects you to have logged into the device where it is run with the account you wish to cleanup. It also requires python3 be installed.

Verify it is correctly setup via:

@weavenet
weavenet / console.py
Last active August 5, 2023 17:57
Python script to assume STS role and generate AWS console URL.
#!/usr/bin/env python
import getpass
import json
import requests
import sys
import urllib
import boto3

Keybase proof

I hereby claim:

  • I am weavenet on github.
  • I am weavenet (https://keybase.io/weavenet) on keybase.
  • I have a public key whose fingerprint is F6C4 D180 15CA F8B5 9C60 403F F83F 43F6 6744 510A

To claim this, I am signing this object:

@weavenet
weavenet / trello.sh
Last active August 11, 2017 14:49
Wrapper script to execute trello CLI with arguments read from a dot file
#!/bin/bash
#
# Wrapper script for trello cli that appends default arguments as well as reads
# additional arguments from a file if it exists in the cwd. It is assumed
# the file contains a text string of arguments to append to the command.
#
# See https://github.com/brettweavnet/trello_cli/issues/22 for more details
#
# For example, the file .trellocli existing in a directory with the content:
#
@weavenet
weavenet / delete_all_object_versions.sh
Created May 4, 2015 05:21
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@weavenet
weavenet / dotfiles.md
Last active August 29, 2015 14:12
Why I Made My Dotfiles Private

Private Dotfiles

I recently moved my dotfiles to a private location. This goes against my previous belief in sharing the knowledge and allowing other to read and learn from my configuration.

Below is why:

Privacy

@weavenet
weavenet / storing_sensitive_environment_variables.md
Last active August 5, 2017 13:05
Storing sensitive environment variables

I keep my dot files public, I of course don't want to have my credentials stored in those dotfiles.

To call applications which require credentials to be set as env vars I have the following setup.

Create a file called ~/.run_with_creds with all the secret credentials after an env statement which then calls the input parameters:

env TRELLO_DEVELOPER_PUBLIC_KEY=xxx \
    TRELLO_MEMBER_TOKEN=yyy \
 AWS_ACCESS_KEY_ID=987 \