Skip to content

Instantly share code, notes, and snippets.

Allan Ralph Hutalla aputs

Block or report user

Report or block aputs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aputs
aputs / keybindings.json
Created Sep 21, 2019
vscode keybindings for terminal resizing
View keybindings.json
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+shift+q",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "ctrl+shift+down",
"command": "workbench.action.terminal.resizePaneDown",
"when": "terminalFocus"
@aputs
aputs / devserver.py
Last active Sep 10, 2019
django runserver with asyncio
View devserver.py
"""
replacement runserver for django with asyncio support
"""
import errno
import os
import sys
import socket
import asyncio
import aiomonitor
@aputs
aputs / redis_sentinel.py
Created Sep 15, 2018
add support for redis sentinel on django-redis
View redis_sentinel.py
# -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from redis.sentinel import Sentinel
from django_redis.client import DefaultClient
@aputs
aputs / create-smartos-vm.sh
Created Nov 20, 2016 — forked from twobitfool/create-smartos-vm.sh
Create a SmartOS VM in VirtualBox
View create-smartos-vm.sh
#!/bin/sh
#
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed)
#
# This script will:
# * Download the latest live ISO image of SmartOS
# * Create a VirtualBox VM, or update an existing VM with the latest ISO
# * Configure the VM with a zones disk, and boot it!
#
#
View docker-lvm-arch
lvcreate --wipesignatures y -n thinpool arch -L 100G
lvcreate --wipesignatures y -n thinpoolmeta arch -L 1G
lvconvert -y --zero n -c 512K --thinpool arch/thinpool --poolmetadata arch/thinpoolmeta
cat <<EOF | tee /etc/lvm/profile/docker-thinpool.profile
activation {
thin_pool_autoextend_threshold=80
thin_pool_autoextend_percent=20
}
@aputs
aputs / boot.properties
Created Sep 29, 2016
re-natal reagent figwheel repl with boot-clj
View boot.properties
#http://boot-clj.com
#Wed Sep 28 14:53:54 PHT 2016
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0-alpha12
BOOT_VERSION=2.6.0
@aputs
aputs / jwt.cljs
Created Sep 21, 2016
clojurescript JWT encode/decode (SHA version only)
View jwt.cljs
(ns cljsjs.jwt
(:require
[clojure.spec :as s]
[clojure.string :as str]
[goog.json :as json]
[goog.crypt.base64 :refer [encodeString decodeString]]))
;; https://github.com/Caligatio/jsSHA
;; goog.crypt.hmac produces different signature than nodejs version
(def jssha (js/require "jssha"))
@aputs
aputs / centos7-kickstart-iso.sh
Last active Sep 15, 2017
centos7 kickstart iso creation
View centos7-kickstart-iso.sh
# Mandatory Files: copied from Centos7 ISO installer (minimal/full dvd)
#
# $ROOT/cdroot/.discinfo
# $ROOT/cdroot/LiveOS/squashfs.img
# $ROOT/cdroot/isolinux/boot.cat
# $ROOT/cdroot/isolinux/initrd.img
# $ROOT/cdroot/isolinux/isolinux.bin
# $ROOT/cdroot/isolinux/vmlinuz
#
@aputs
aputs / pacman.conf
Created Nov 9, 2014
minimal pacman config
View pacman.conf
[options]
NoUpgrade = etc/passwd etc/group etc/shadow
NoUpgrade = etc/pacman.conf
NoExtract = usr/share/doc/*
NoExtract = usr/share/info/*
NoExtract = usr/share/man/*
NoExtract = usr/share/locale/[a-d,f-k,m-z]*
NoExtract = usr/share/locale/e[a-m,o-z]*
NoExtract = usr/share/locale/l[a-n,p-z]*
NoExtract = usr/share/locale/lo
@aputs
aputs / nspawn-docker-image
Created Nov 7, 2014
run systemd-nspawn on btrfs docker image snapshot
View nspawn-docker-image
docker_root=/var/lib/docker/btrfs
subvolumes=subvolumes
docker_image=aputs/archlinux
tar_file=/tmp/image.tar.gz
dest_dir=/var/lib/container/archlinux
btrfs subvolume snapshot $docker_root/$subvolumes/$(docker inspect --format='{{.Id}}' $docker_image) $dest_dir
systemd-nspawn -D $dest_dir
You can’t perform that action at this time.