Skip to content

Instantly share code, notes, and snippets.

@zellio
zellio / rebuild_appscript_files.rb
Created July 9, 2020 21:53
Rebuild AppScript files from JSON export blob
#!/usr/bin/env ruby
# Download the json blob from here: https://script.google.com/feeds/download/export?format=json&id=[fileId]
require 'json'
path = ARGV[1]
str = File.open(path) { |fh| fh.read }
data = JSON.parse(str, symbolize_names: true)
#!/usr/bin/env bash
docker ps --all | awk '{print $1}' | xargs docker rm
docker images | awk '{print $3}' | xargs docker rmi
@zellio
zellio / gentrusty.sh
Created October 22, 2015 20:32
Generate Ubuntu Trusty container that will boot under systemd-nspawn
#!/usr/bin/env bash
function __main
{
local -r path="$(realpath "${1:-.}")"
debootstrap --variant=buildd trusty "$1" http://archive.ubuntu.com/ubuntu/
patch --unified "$path/etc/init/console.conf" <<'EOF'
@@ -3,7 +3,8 @@
# This service maintains a getty on console from the point the system is
# started until it is shut down again.
@zellio
zellio / PKGBUILD
Created May 4, 2015 15:52
Correction to rpm-utils PKGBUILD file
# Maintainer: Alan Brault <extrarius.aur@incruentatus.net>
# Contributor: Thomas Dziedzic < gostrc at gmail >
pkgname=yum-utils
pkgver=1.1.31
pkgrel=2
pkgdesc="A collection of utilities and plugins extending and supplementing yum in different ways."
arch=('any')
license=('GPLv2')
url="http://yum.baseurl.org/wiki/YumUtils"
@zellio
zellio / block_tor.sh
Last active August 29, 2015 14:16
Short script to block tor on centos
#!/usr/bin/env sh
set -f
function error {
echo -en "\e[1;31m>>> ERROR: "
echo -en $1
echo -e "\e[0m "
}
@zellio
zellio / httpd.conf
Last active August 29, 2015 14:07
mod_fastcgi php-fpm php apache config
LoadModule actions_module modules/mod_actions.so
LoadModule fastcgi_module modules/mod_fastcgi.so
LoadModule rewrite_module modules/mod_rewrite.so
FastCgiIpcDir /var/run/php-fpm/ipc
FastCgiExternalServer /var/run/php-fpm/fcgi -appConnTimeout 3 -user apache \
-group apache -idle-timeout 10 -pass-header Authorization \
-socket /var/run/php-fpm/socket
@zellio
zellio / video-brightness.sh
Last active December 27, 2015 22:43
Video Brightness Control for acpid
#!/usr/bin/env bash
bl_dir='/sys/class/backlight/intel_backlight/'
bl_dev="$bl_dir/brightness"
bl_index='/var/acpi/backlight/index'
max_brightness="$(<"${bl_dir}/max_brightness")"
min_brightness=82
min_index=0
@zellio
zellio / orjf
Last active August 29, 2015 14:02
#!/usr/bin/env bash
### orjf --- Oracle Java RPM Fixer
## Copyright (c) 2014 Zachary Elliott
##
## Authors: Zachary Elliott <zach@nyu.edu>
## URL:
## Version: 0.1.0

Keybase proof

I hereby claim:

  • I am zellio on github.
  • I am zellio (https://keybase.io/zellio) on keybase.
  • I have a public key whose fingerprint is 3082 B846 4434 D474 15BC 4A91 15C8 50D6 B0E3 D275

To claim this, I am signing this object:

@zellio
zellio / go-mode.el
Created November 22, 2013 18:13
Copy of the go-mode.el file from the golang distribution. This is for easier vendoring to my emacs config.
;;; go-mode.el --- Major mode for the Go programming language
;; Copyright 2013 The Go Authors. All rights reserved.
;; Use of this source code is governed by a BSD-style
;; license that can be found in the LICENSE file.
(require 'cl)
(require 'ffap)
(require 'url)