Skip to content

Instantly share code, notes, and snippets.

@tzutalin
tzutalin / nginxproxy.md
Created August 7, 2017 02:51 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@tzutalin
tzutalin / wifiadb.sh
Created November 1, 2017 08:11
Android Scripts
#!/bin/sh
# Author : tzu.ta.lin@gmail.com
# Copyright [2015] <tzu.ta.lin@gmail.com>
PORT=5555
if [ $# -ne 0 ]; then
while [ $# != 0 ]
do
PORT=$1
@tzutalin
tzutalin / deploy.prototxt
Last active May 11, 2018 10:01
Network In Network
name: "nin_imagenet"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 224
dim: 224
}
layers {
bottom: "data"
@tzutalin
tzutalin / install_cv_anaconda.sh
Created June 10, 2018 04:34
Ubuntu install opencv + anacoda
#!/bin/sh
# ubuntu install opencv + anaconda
# anaconda
curl -O https://repo.continuum.io/archive/Anaconda3-4.3.1-Linux-x86_64.sh
sha256sum Anaconda3-4.3.1-Linux-x86_64.sh
bash Anaconda3-4.3.1-Linux-x86_64.sh
# paste the below to bashrc
export PATH=~/anaconda3/bin:$PATH
@tzutalin
tzutalin / settings.json
Created August 31, 2019 19:18
VSCode Global Settings
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
".idea": true,
"bower_components": true,
"dist": true,
"tmp": true
@tzutalin
tzutalin / removeCertainSearchEngine
Last active March 26, 2020 20:43
js script to remove all other search engines in chrome
removedName = ['groupon',
'avg',
'red',
'Jenkins',
'petewarden',
'booking',
'Hudson',
'blog',
'ebay',
@tzutalin
tzutalin / Log.h
Last active October 9, 2020 00:26
Simple Log.h in C++
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
namespace da{
struct nullstream: std::ostream{
nullstream(): std::ostream(0){}
};
@tzutalin
tzutalin / autojump.py
Last active November 6, 2020 07:46
Ranger's settings and plugins
# config/ranger/plugins/autojump.py
import ranger.api
import subprocess
from ranger.api.commands import *
HOOK_INIT_OLD = ranger.api.hook_init
def hook_init(fm):
def update_autojump(signal):
@tzutalin
tzutalin / _readme.md
Created July 28, 2017 05:37 — forked from maxivak/_readme.md
Vagrant with Ubuntu 16.04 in VirtualBox

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
@tzutalin
tzutalin / ffmpeg.md
Created July 12, 2017 02:25 — forked from v5tech/ffmpeg.md
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"