Skip to content

Instantly share code, notes, and snippets.

View lueo's full-sized avatar

Leonard Huang lueo

View GitHub Profile
@burningTyger
burningTyger / docker.gogs.service.md
Last active August 13, 2016 16:39
Docker Gogs systemd script

Starting Gogs as a Docker container on startup via systemd

Gogs is that great Github clone which is also available as a docker image. Works perfectly if started by the user but since you probably want to run it on your server and without interruption you can add a systemd script to start up Gogs on boot. My script looks like this:

# /etc/systemd/system/docker.gogs.service
[Unit]
Description=Gogs container
Requires=docker.service
Require=postgresql.service
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 14, 2024 11:40
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@ba0f3
ba0f3 / compile-emacs.sh
Last active July 19, 2017 02:00
Compile emacs 25.1 on CentOS 6.x
yum install gcc make ncurses-devel giflib-devel libjpeg-devel libtiff-devel
wget http://ftp.twaren.net/Unix/GNU/gnu/emacs/emacs-25.1.tar.xz
tar xJf emacs-*
cd emacs-*
./configure --without-x --without-selinux
make && make install
@xavriley
xavriley / README.md
Last active December 30, 2023 12:17
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

import cv2
import numpy as np
canny = rho = threshold = minLen = maxGap = None
def draw():
lines = cv2.HoughLinesP(canny, rho, np.pi / 180,
threshold, None, minLen, maxGap)
dst = cv2.cvtColor(canny, cv2.COLOR_GRAY2BGR)
@brianredbeard
brianredbeard / syncrepos.sh
Last active January 30, 2024 06:23
Reposync - A better tool than mrepo. Use this to sync down all channels a RHEL system is subscribed to and turn them into locally exposed yum repositories.
#!/bin/bash
# This tool can be used to sync down Red Hat based packages from RHN using only Red Hat shipped tools
# Brian "Red Beard" Harrington <brian@dead-city.org>
# Copyright 2013
#
# To satisfy the pre-reqs for this script install the following two rpms:
# yum-utils
# createrepo_c (in RHEL 8 createrepo and createrepo_c have been combined)
# See https://github.com/rpm-software-management/createrepo_c#differences-in-behavior-between-createrepo_c-and-createrepo
@thitemple
thitemple / dev_setup.ps1
Last active March 22, 2022 05:19
A PowerShell script for installing a dev machine using Chocolatey.
function Add-Path() {
[Cmdletbinding()]
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder)
# Get the current search path from the environment keys in the registry.
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# See if a new folder has been supplied.
if (!$AddedFolder) {
Return 'No Folder Supplied. $ENV:PATH Unchanged'
}
# See if the new folder exists on the file system.
@joefitzgerald
joefitzgerald / Vagrantfile
Last active July 6, 2018 12:33
Windows Vagrantfile - Installs .NET 4.5, VS 2012, VS 2012 Update 3, then a bunch of utilities, then syspreps the machine. Get https://github.com/joefitzgerald/packer-windows for the base box and add it with the name "windows2008r2".
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "vagrant-windows"
config.vm.box = "windows2008r2"
# You should be using the vagrant-windows Vagrant Plugin!
# Admin user name and password
config.winrm.username = "Administrator"
@Edditoria
Edditoria / evernote-clearly.css
Created December 15, 2012 09:15
My customized CSS theme for the Evernote Clearly browser extension
/**
* CSS theme for the Clearly browser extension by Evernote.
* See: www.evernote.com/clearly/
*
* Options used alongside this CSS:
* Body font: "Adelle", Georgia, 微軟正黑體, Helvetica, Arial, sans-serif
* Header font: Soho-condensed, PT Serif, 微軟正黑體, Helvetica
* Monospace font: 微軟正黑體Mono, Inconsolata, Consolas, Droid Sans Mono
* Background: #FFFFFF
* Foregound: #333333
@rhybroy
rhybroy / fetchsub.sh
Created October 28, 2012 06:43 — forked from ravageralpha/fetchsub.sh
shell script get subtitle from shooter.cn
#!/bin/sh
# Author: RA <ravageralpha@gmail.com>
USAGE(){
echo "Usage:fetchsub [eng] file"
}
[ $# -eq 0 -o "$1" = '--help' ] && USAGE && exit 0
ERROR(){