Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / README.md
Last active March 24, 2024 07:57 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@dragon788
dragon788 / chromebox.md
Created August 26, 2017 00:47
Hacking an ASUS chromebox

ASUS makes a pretty handy Chromebox, and it's handy not just because it's running ChromeOS, it's handy because of everything you can do to the box itself.

The ASUS Chromebox is easily upgradeable, and capable of running just about any linux distribution.

The model I picked up, the M004U has the following specs:

  • Celeron 2955U (1.4GHz) 64 bit Dual core processor with 2MB L3 Cache
  • 2GB DDR3 1600 RAM with 2 slots
  • 16GB SSD HDD
  • 802.11 b/g/n dual-band wireless, Bluetooth 4.0, and gigabit ethernet
@dragon788
dragon788 / build.sh
Created February 16, 2018 21:38 — forked from Forst/build.sh
Ubuntu ISO with preseed.cfg generation script
#!/bin/bash
## FORSTWOOF UBUNTU PRESEED :: BUILD SCRIPT
# Quit on first error
set -e
# Temporary directory for the build
TMP="/var/tmp/ubuntu-build"
@dragon788
dragon788 / README.md
Created June 27, 2017 15:26 — forked from pdanford/README.md
Applescript to launch iTerm2 Version 3+ from OS X Finder via keyboard shortcut or Toolbar

Description

Based on info from http://peterdowns.com/posts/open-iterm-finder-service.html but with modified behavior and fixed to work with iTerm2 version 3 or later. It will not work with older versions of iTerm. The modified behavior is to open a new terminal window for each invocation instead of reusing an already open window. Update - The original author released a build script for the newer iTerm2 versions at https://github.com/peterldowns/iterm2-finder-tools that keeps the original behavior of reusing an open iTerm2 window.

To open iTerm2 at selected folder with keyboard shortcut

  1. Run Automator, select a new Service
  2. Select Utilities -> Double click ‘Run AppleScript’
  3. Service receives selected 'folders' in 'finder.app'
  4. Paste script:
@dragon788
dragon788 / f_hjkl_movements.json
Created September 16, 2019 18:07 — forked from pirj/f_hjkl_movements.json
Karabiner complex modiications: Vi'ish mode
{
"title": "F + HJKL",
"rules": [
{
"description": "Vi'ish Mode [F as Trigger Key]",
"manipulators": [
{
"type": "basic",
"parameters": {
"basic.to_delayed_action_delay_milliseconds": 150,
@dragon788
dragon788 / HumanOps-mantra.rst
Created November 17, 2017 00:03 — forked from morekid/HumanOps-mantra.rst
HumanOps Mantra
  1. Humans build and fix systems.
  2. Humans get tired and stressed, they feel happy and sad.
  3. Systems don't have feelings yet. They only have SLAs.
  4. Humans need to switch off and on again.
  5. The wellbeing of human operators impacts the reliability of systems.
  6. Alert Fatigue == Human Fatigue
  7. Automate as much as possible, escalate to a human as a last resort.
  8. Document everything. Train everyone. Save time.
  9. Kill the shame game.
  10. Human issues are system issues.
@dragon788
dragon788 / chocolatey.repository.build
Last active November 3, 2017 21:08 — forked from RichHopkins/chocolatey.repository.build
Setup Chocolatey.Server simply and easily by getting and configuring the IIS requirements (for IIS7.5 and higher) and replacing the default site.
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Unrestricted is only good for testing, don't use that in production
Update-ExecutionPolicy RemoteSigned
Disable-InternetExplorerESC
Disable-UAC
#Enable-RemoteDesktop
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles
@dragon788
dragon788 / gopass.md
Created October 18, 2017 17:21
GoPass #security #build

Build

# requires chocolatey
# iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
cinst golang git

$go_path = "c:\projects\go"
$env:GOPATH += ";$go_path"
go get -u github.com/justwatchcom/gopass
@dragon788
dragon788 / openvpn_gen.py
Created May 31, 2017 20:51 — forked from Justasic/openvpn_gen.py
This is a python script to generate client OpenVPN configuration files. This is based mostly on the easyrsa script and is much simpler to understand.
import os
import socket
from OpenSSL import crypto, SSL
# OpenVPN is fairly simple since it works on OpenSSL. The OpenVPN server contains
# a root certificate authority that can sign sub-certificates. The certificates
# have very little or no information on who they belong to besides a filename
# and any required information. Everything else is omitted or blank.
# The client certificate and private key are inserted into the .ovpn file
# which contains some settins as well and the entire thing is then ready for
@dragon788
dragon788 / git-get-files-by-size.py
Created March 28, 2017 19:06 — forked from punkdata/git-get-files-by-size.py
Git this script lists the files that are larger than the size you specify. Example use: python git-find-big-files.py fix-remove-files 1000000 (file size in MBs)
#!/usr/bin/python
# run the script: python git-find-big-files.py <the branch> <file size>
# Example use: python git-find-big-files.py fix-remove-files 1000000 (this value equals 1 Megabyte)
# the Fix-remove-files specifies the branch that you are cleaning
import os, sys
def getOutput(cmd):
return os.popen(cmd).read()