Skip to content

Instantly share code, notes, and snippets.

@touhonoob
touhonoob / transcode.sh
Last active July 4, 2020 12:00
Transcode h265 to h264 using ffmpeg cuda. Lowering 28 results in better quality & bigger file size
ffmpeg -loglevel verbose -hwaccel cuda -i input.mkv -c:v h264_nvenc -pix_fmt yuv444p -rc vbr -cq 28 -qmin 28 -qmax 28 -tune animation output.mp4
### Keybase proof
I hereby claim:
* I am touhonoob on github.
* I am peterchung (https://keybase.io/peterchung) on keybase.
* I have a public key ASBjWyzGyzWUntaPHYYgpq2am1GnrxpimimzsW6O-j968Qo
To claim this, I am signing this object:
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
)
func main() {
right := "3187c721dc9913aef26a6cf1677a29a0c1c24229730911e68091eadf8839873"
@touhonoob
touhonoob / plot.p
Created November 15, 2016 16:38 — forked from garethrees/plot.p
Graphing apache benchmark results with gnuplot
# Output to a jpeg file
set terminal jpeg size 1280,720
# Set the aspect ratio of the graph
set size 1, 1
# The file to write to
set output "timeseries.jpg"
# The graph title
@touhonoob
touhonoob / benchmark.sh
Created November 15, 2016 16:37 — forked from emersonmoretto/benchmark.sh
Apache bench + Gnuplot Script
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'
@touhonoob
touhonoob / gs.nginx.conf
Created June 6, 2015 13:35
Nginx as Google Cloud Storage Cache
# Cache 10GB for 1 Month
proxy_cache_path /var/cache/nginx keys_zone=GS:10m inactive=720h max_size=10240m;
upstream gs {
server 'storage.googleapis.com:80';
keepalive 100;
}
server {
set $my_domain "yourdomain.com";
/*
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
'use strict';
@touhonoob
touhonoob / unstar.js
Created May 23, 2015 19:16
Unstar All Github Starred Repos
var github = require('github');
var util = require('util');
const TOKEN = "";
const USER = "";
var g = new github({version: "3.0.0"});
g.authenticate({
type: "oauth",