Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@jamesarosen
jamesarosen / two-travis-builds.md
Last active June 5, 2021 18:39
Running Two Very Different Travis Builds

I have a project that's been happily chugging along on Travis for a while. Its .travis.yml looks something like

script:
  - node_modules/ember-cli/bin/ember test

I wanted to add a second parallel build that did something very different. I didn't want to run ember test with a different Ember version or some other flag. I wanted to run a completely different command. Specifically, I wanted to run LicenseFinder's audit.

Travis has great docs on customizing parallel builds, but nothing describes how to do two completely different commands.

@joeblau
joeblau / OSX Secure Disk Wipe.md
Last active June 12, 2023 07:37
Securely erase an external disk using dd on OSX

Securely erase an external disk using dd on OSX

  1. Plug in your SD card, HDD, or other block device and then use the following command to see which /dev/diskN node it's located on:
diskutil list
  1. Unmount the disk where “N� is the number of the disk taken from the above command:
@nk9
nk9 / largestFiles.py
Last active November 14, 2023 09:47
Python script to find the largest files in a git repository.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
#
@tomer-ben-david
tomer-ben-david / gist:1f2611db1d0851a65d43
Created May 27, 2014 10:36
write bytes to file in scala
val byteArray: Array[Byte] = Array(1,2)
val bos = new BufferedOutputStream(new FileOutputStream(filename))
Stream.continually(bos.write(byteArray))
bos.close() // You may end up with 0 bytes file if not calling close.
@dmouse
dmouse / Dockerfile
Last active August 29, 2015 14:01
Dockerfile to build a image with conscript and n8han/giter8 for Scala application
FROM centos
MAINTAINER David Flores "dmousex@gmail.com"
RUN yum update -y
RUN yum install java-1.7.0-openjdk.x86_64 -y
RUN yum install wget unzip which -y >/dev/null
ENV HOME /root
RUN cd /tmp && wget https://raw.githubusercontent.com/n8han/conscript/master/setup.sh
RUN sh /tmp/setup.sh