Skip to content

Instantly share code, notes, and snippets.

View jpopesculian's full-sized avatar

Julian Popescu jpopesculian

View GitHub Profile
@jpopesculian
jpopesculian / Dockerfile
Last active June 28, 2019 09:02
Failing SCONE ECKeyPair generator
FROM openjdk:8-alpine
COPY HelloEc.java .
RUN javac -g HelloEc.java
CMD ["java", "HelloEc"]
@jpopesculian
jpopesculian / Makefile
Created May 22, 2019 14:19
PKCS11 play
CFLAGS=-Wall
LDFLAGS=-leprimus -lprimusP11 -I/usr/local/primus/include -L/usr/local/primus/lib -lsodium
CC = gcc
SRC = pkcs11_play.c
OUT = pkcs11_play.o
LOG = /tmp/primus.log
.PHONY:all clean watch build
@jpopesculian
jpopesculian / .env
Last active May 14, 2019 12:27
evan create identity test
PRIVATE_KEY="PARENT PRIVATE KEY"
ACTIVE_PROFILE_ID="PARENT ACTIVE PROFILE ID"
ACCOUNT_ID="PARENT ACCOUNT ID"
CHILD_ACCOUNT="CHILD ACCOUNT ID (generated by register-identity.js)"
CHILD_PRIVATE_KEY="CHILD PRIVATE KEY (generated by register-identity.js)"
DBCP_LOGLEVEL="debug"
@jpopesculian
jpopesculian / sprint
Created June 5, 2017 15:21
Get current sprint using node-jira
#!/bin/bash
CACHE=$HOME/.sprintcache
function updatecache {
sprint=$(jira sprint \
| grep ACTIVE \
| awk '{split($0,a,"│"); gsub(/^[ \t]+/, "", a[3]); gsub(/[ \t]+$/, "", a[3]); print a[3]}')
echo "Updated Active Sprint -> $sprint"
echo -n $sprint > $CACHE
}
#!/bin/bash
primary="$( xrandr -q | awk '/ connected primary/{split($0,a," "); print a[1]}' | head -n 1 )"
secondary="$( xrandr -q | awk '!/primary/{print}' | awk '/ connected/{split($0,a," "); print a[1]}' | head -n 1 )"
hi () {
xrandr --output $primary --mode '3200x1800' --pos '0x1040'
xrandr --output $secondary --mode '3840x2160' --pos '3200x0' --rotate 'left'
gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"
@jpopesculian
jpopesculian / serve-prod
Created November 1, 2016 19:26
Helpful script to get rails app branch up and running in production mode
#!/bin/bash
PORT=8080
DIR=$HOME/Development/single-ops-prod
rm -rf $DIR
git worktree add --detach $DIR
cd $DIR
RAILS_ENV=production
@jpopesculian
jpopesculian / migration-patch
Last active April 24, 2017 00:49
Simple script to create and apply a patch file to deal with misaligned migrations / databases
#!/bin/bash
scriptname="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
patch="$dir/migration.patch"
read -r -d '' help << EOM
Usage:
$scriptname command [file]
@jpopesculian
jpopesculian / git-umatm
Last active June 16, 2016 15:15
Git utility to update master and test merge
#!/bin/bash
# Add to bashrc to alias as "git sync":
# git() { if [[ $@ == 'sync' ]]; then command git-umatm; else command git "$@"; fi }
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
REMOTE_NAME=${1:-"origin"}
MASTER_BRANCH_NAME=${2:-"master"}
print_header() {
@jpopesculian
jpopesculian / jpopesculian.key
Created May 20, 2016 01:07
Keybase Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Keybase OpenPGP v2.0.49
Comment: https://keybase.io/crypto
xsFNBFZQ3yMBEACZaXMiCCpCJMxmJ43r2Gq4CwhJE2qD+UDeoDTqJgWi1o8NjrtT
qLUSHLFcvONJ6ESYSDEbBQmbh9+HuwCq8uat5lbICk4wGeNIFVmn5RGeQVbmtvH0
m3ZDhzmLcL3sHvKx43YrbpPzU/sJryhnq/VzS/Rcmr7G/dZvGmXYx0MTZ6q5AoGl
69/lIrT/v+shnBcj9QHfcQar/ODRTUnLn2lJq4Ty4S11B5UIhfA/FWmMuCNof2Za
ic9ZbQvT2szgwfTHN2HnYjNwzgSEQ5phpzMqesJA8p6AAcRULjEk8/N0CYYLyETH
yAGGLD5gdJWQgkO/+n0DWbREruUWyFxgDMH99uA1/J7zzeJ6dBhKyM4DUTREaaLA
<template name="example">
<button id="button">{{buttonName}}</button>
</template>