Skip to content

Instantly share code, notes, and snippets.

View justlaputa's full-sized avatar
:octocat:
coding 🐾🐾

Han Xiao justlaputa

:octocat:
coding 🐾🐾
View GitHub Profile
@justlaputa
justlaputa / configure option
Created January 18, 2012 09:30
Configuration options for installing some software form source code
FFmpeg:
Requirement:
yasm faad2-devel faac-devel lame-devel opencore-amr-devel openjpeg-devel libtheora-devel libvpx-devel libvorbis-devel xvidcore-devel
Configure:
Medium configuration:
$ ./configure --prefix=/usr --disable-static --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
With debug:
$ --enable-debug=gdb3 --disable-stripping
@justlaputa
justlaputa / StreamerDemo.java
Created March 10, 2012 04:03
LiveStreamer API demo
package com.mmg.mlive.media;
import java.io.IOException;
import com.mmg.mlive.activity.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
@justlaputa
justlaputa / CameraUtil.java
Created March 10, 2012 04:16
Camera interface
package com.mmg.mlive.media;
import android.hardware.Camera;
import android.view.SurfaceHolder;
public class CameraUtil {
public CameraUtil getInstance() {
return null;
}
@justlaputa
justlaputa / LiveStreamer.java
Created March 10, 2012 04:23
LiveStreamer API
package com.mmg.mlive.media;
import android.view.SurfaceHolder;
public class StreamerDemo {
public void setVideoFormat(int width, int height, int frameRate) {
}
/**
@justlaputa
justlaputa / hello.rb
Created October 9, 2012 15:30
test pom file to use jruby-maven-plugin
require 'rubygems'
require 'zip/zip'
puts "hello from ruby "*20
@justlaputa
justlaputa / jenkins-api.md
Last active May 17, 2024 14:53
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

@justlaputa
justlaputa / bower-check.js
Created June 3, 2013 10:42
js library to check component version before running `bower install`
/*global module:false,process:false*/
/**
* helper script for Grunt bower task
* this script is used to compare javascript libraries versions
* installed by bower, and run `bower install` only when necessary
*/
var fs = require('fs');
var bower = require('bower');
var components = require('./bower.json');
@justlaputa
justlaputa / primary.sql
Created April 11, 2014 09:24
find primary key of table
SELECT
cols.table_name,
cols.column_name,
cols.position,
cons.status,
cons.owner
FROM all_constraints cons,
all_cons_columns cols
WHERE cols.table_name = 'TABLE_NAME'
AND cons.constraint_type = 'P'
#!/bin/bash
#
# Prepends a date string in front of the Maven output.
# A workaround for http://jira.codehaus.org/browse/MNG-519 "Timestamps on messages"
[ -z "${AWK}" ] && AWK="$(which gawk 2>/dev/null)" || AWK="$(which awk 2>/dev/null)" || { echo "Error: Could not find AWK tool."; exit 1; }
"${AWK}" 'BEGIN { print strftime("%Y-%m-%d %H:%M:%S"); }' 2>&1 > /dev/null || { echo "Error: your AWK version does not support strftime() function." && exit 1; }
mvn "${@}" 2>&1 |"${AWK}" '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
# see comp.unix.shell FAQ: (http://cfajohnson.com/shell/cus-faq-2.html)
@justlaputa
justlaputa / setup-single-node-mesos.sh
Created December 8, 2015 10:37
setup single node mesos cluster by using docker
#!/bin/bash
HOST_IP=`ip -4 addr show eno1 | grep inet | awk -F'[ /]' '{print $6}'`
docker run -d \
-p 2181:2181 \
-p 2888:2888 \
-p 3888:3888 \
garland/zookeeper