Skip to content

Instantly share code, notes, and snippets.

@hanxue
hanxue / Clone-Github-Wiki-Pages.sh
Created January 18, 2014 10:21
Cloning Github Wiki Pages
hanxue-mac:Github hanxue$ git clone https://github.com/AppScale/appscale.wiki.git
Cloning into 'appscale.wiki'...
remote: Counting objects: 1745, done.
remote: Compressing objects: 100% (1733/1733), done.
remote: Total 1745 (delta 1089), reused 10 (delta 4)
Receiving objects: 100% (1745/1745), 267.93 KiB | 35.00 KiB/s, done.
Resolving deltas: 100% (1089/1089), done.
Checking connectivity... done
hanxue-mac:Github hanxue$ ls appscale.wiki/
.git/

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@hanxue
hanxue / embed-gist-in-blogger.js
Created January 18, 2014 10:48
Embed Gists in Blogger
At the end of your Blogger post , using HTML editor, append this
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
In the content of your blog post, simply add this:
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div>
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves.
@hanxue
hanxue / google_trends_query.js
Created December 19, 2012 13:29
Google Apps Script for querying Google trends
@hanxue
hanxue / Dockerfile
Last active April 17, 2023 14:15
Petalinux 2019.1 Docker
FROM ubuntu:18.04
#RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y tofrodos
RUN apt-get install -y iproute2
RUN apt-get install -y gawk
RUN apt-get install -y xvfb
RUN apt-get install -y gcc-4.8
RUN apt-get install -y git
@hanxue
hanxue / # node - 2018-11-27_17-44-50.txt
Created November 27, 2018 10:59
node on macOS 10.10.5 - Homebrew build logs
Homebrew build logs for node on macOS 10.10.5
Build date: 2018-11-27 17:44:50
@hanxue
hanxue / contents-of-lib-directory.txt
Last active June 10, 2022 18:28
scalatest sbt NoClassDefFoundError: sbt/testing/Framework
$ find . -name "*jar"
./lib/ant-1.7.1.jar
./lib/ant-launcher-1.7.1.jar
./lib/antlr-2.7.7.jar
./lib/aopalliance-1.0.jar
./lib/asm-4.1.jar
./lib/asm-all-4.1.jar
./lib/asm-analysis-4.1.jar
./lib/asm-tree-4.1.jar
./lib/asm-util-4.1.jar
@hanxue
hanxue / Proxy.scala
Created February 12, 2014 09:12
Proxy implemented using Play Framework
package controllers
import play.api.mvc.{Action, Controller}
import play.api.libs.ws.WS
import play.api.libs.concurrent.Execution.Implicits._
object Proxy extends Controller {
def index(url: String) = Action.async {
WS.url(url).get().map(resp => Ok(resp.body).as("text/html"))
}
@hanxue
hanxue / api.py
Last active August 19, 2021 07:26
Flask-restful with POST and PATCH methods
from flask import Flask
from flask_restful import Resource, Api, reqparse
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
class PostAndPatch(Resource):
def post(self):
@hanxue
hanxue / vitis_ai_1.3_ami.sh
Created February 3, 2021 18:31
Vitis AI 1.3 AMI
export TZ=America/Denver
sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
export VAI_ROOT=/opt/vitis_ai
export VAI_HOME=/vitis_ai_home
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_ALL=en_US.UTF-8
sudo chmod 1777 /tmp