Skip to content

Instantly share code, notes, and snippets.

@mexisme
mexisme / archival-langoliers.rb
Created February 8, 2023 11:15 — forked from robinsloan/archival-langoliers.rb
Tweet delete script using your Twitter archive as an index
require "rubygems"
require "twitter"
require "json"
require "csv"
#require "date"
# things you must configure
TWITTER_USER = "your_twitter_username"
MAX_AGE_IN_DAYS = 7 # anything older than this is deleted
@mexisme
mexisme / get-image.sh
Created February 27, 2020 22:23
Download an AWS ECR image using Skopeo instead of Docker (e.g. running within a container)
#!/usr/bin/env bash
set -eu
# set -o pipefile
docker_version=${REPO_TAG}
docker_image=${REPO_IMAGE}
# docker_creds=$(aws ecr get-authorization-token --output json |jq -r '.authorizationData[].authorizationToken' |base64 -d)
docker_creds="AWS:$(aws ecr get-login-password)"
@mexisme
mexisme / crd.nix
Created January 18, 2020 10:20 — forked from balsoft/crd.nix
chrome-remote-desktop on nixos/nix
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.crd;
in {
options = {
services.crd = {
enable = mkEnableOption ''
chrome remote desktop, a service which allows for remote control of your desktop from anywhere.
'';
@mexisme
mexisme / org-to-gfm.el
Created May 1, 2019 00:13 — forked from benley/org-to-gfm.el
org-to-gfm.el
;;; org-to-gfm --- Export a org-mode file to Github-flavored Markdown
;;;
;;; Commentary:
;;; To convert INPUT_FILE.org and produce OUTPUT_FILE.md, run something like:
;;;
;;; emacs -q --no-splash --no-x-resources --batch --script org-to-gfm.el INPUT_FILE.org OUTPUT_FILE.md
;;;
;;; Code:
(unless (require 'use-package nil t) (package-install 'use-package))
@mexisme
mexisme / scylla.nix
Created April 24, 2019 07:43 — forked from teburd/scylla.nix
scylla.nix
with import <nixpkgs> {};
#{stdenv, fetchFromGitHub, python, ninja}:
stdenv.mkDerivation rec {
name = "scylla-${version}";
version = "2.1.0";
src = fetchgit {
url = "https://github.com/scylladb/scylla";
@mexisme
mexisme / foundation.go
Created April 23, 2019 01:32 — forked from 13k/foundation.go
Accessing Foundation Framework from Go with cgo
// How to build: "CC=clang go build"
package main
import (
"fmt"
"net/url"
"strconv"
"unsafe"
)
@mexisme
mexisme / Dockerfile
Last active August 21, 2018 09:26
Multistage build for Golang binaries
# You should override $PARENT at build-time to name the upper-level container
# e.g. node:7-alpine
# You may need to override $DOCKER_BASE if you're using this repo as a Submodule of another builder repo
# Override $CONFIG_FILE to use a different config. file
# Note: This will only work for recent versions of Docker
# Note: Your $PARENT base OS/Distribution (Debian or Alpine) must be compatible with the Golang builder base.
# A Golang binary built with Debian won't usually work on Alpine out-of-the-box, for example
# Debian-based image:
@mexisme
mexisme / logger.js
Created August 15, 2018 21:12
Simple log-library, Node-4 friendly
/*
Logging module
*/
'use strict'
const Logger = function(options) {
this.init(options)
}
@mexisme
mexisme / alpine_ruby-2.2.dockerfile
Last active September 21, 2022 16:54
Alpine Linux Dockerfile, adds Ruby 2.2 using ruby-install
# Alpine with Ruby 2.2
FROM alpine:3.7
RUN apk upgrade --no-cache --update && \
apk add --no-cache --update ca-certificates make bash build-base
RUN cd /tmp && \
wget -O - https://github.com/postmodern/ruby-install/archive/v0.6.1.tar.gz | tar xzvf - && \
( cd ruby-install-0.6.1 && \
make install ) && \
PACKAGE = build-it
DATE ?= $(shell date +%FT%T%z)
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || \
cat $(CURDIR)/.version 2> /dev/null || echo v0)
GOPATH = $(CURDIR)/.gopath~
BIN = $(GOPATH)/bin
BASE = $(GOPATH)/src/$(PACKAGE)
PKGS = $(or $(PKG),$(shell cd $(BASE) && env GOPATH=$(GOPATH) $(GO) list ./... | grep -v "^$(PACKAGE)/vendor/"))
TESTPKGS = $(shell env GOPATH=$(GOPATH) $(GO) list -f '{{ if .TestGoFiles }}{{ .ImportPath }}{{ end }}' $(PKGS))