Skip to content

Instantly share code, notes, and snippets.

View twang2218's full-sized avatar

Tao Wang twang2218

  • Sydney, Australia
View GitHub Profile
@twang2218
twang2218 / prepare-openvpn-service.sh
Created July 12, 2016 15:51
Script to create an OpenVPN service
#!/bin/sh
# Before run this script, a docker host in a public cloud should be available
# The host can be created by the following commands:
#
# docker-machine create -d digitalocean dev
# eval $(docker-machine env dev)
#
# Then you can run this command simply by :
#
@twang2218
twang2218 / create-swarm-by-run.sh
Created July 6, 2016 04:50
Create a Docker Swarm cluster with `docker run` (without using docker-machine)
#/bin/bash
DOCKER_MACHINE_DRIVER=virtualbox
function create_kvstore {
echo
echo "Preparing Key-Value store: etcd ..."
echo
docker-machine create -d ${DOCKER_MACHINE_DRIVER} swarm-kvstore
@twang2218
twang2218 / Dockerfile
Last active June 30, 2016 16:46
ElasticSearch Cluster + Logstash + Kibana in Docker
FROM elasticsearch:2
MAINTAINER Tao Wang <twang2218@gmail.com>
RUN set -xe \
&& ./bin/plugin install mobz/elasticsearch-head \
&& ./bin/plugin install AIsaac08/bigdesk
@twang2218
twang2218 / build-overlay-with-swarm.sh
Last active June 14, 2020 03:18
Docker Multi-host Example
#!/bin/bash
#set -xe
SIZE=3
# or 'digitalocean'
DM_DRIVER=virtualbox
function usage {
NAME=$1
nginx:
image:
- {}:/app
- {}:/cache
- {}:/tmp/nginx
- {}:/var/log/nginx
volumes-from: php
container:
- /opt/nginx:/opt/nginx
- /data/cache/nginx:/cache
@twang2218
twang2218 / debug-command_06_up_down.log
Last active January 21, 2016 13:32
Test for command group 06
Debug messaging is now enabled.
./pktriggercord-cli 0.82.05
model (null)
device (null)
[C] plsr_init()
Checking drive: sg0 ATA
VBOX HARDDISK
Checking drive: sg1 RICOHIMG
DSC_K-3
@twang2218
twang2218 / PentaxScsiProtocol.md
Last active February 25, 2020 20:09
This is the Pentax SCSI protocol

Pentax Camera SCSI protocol

  1. General

To control the Pentax camera, the camera has to be set to Mass Storage (MSC) mode, rather than PTP mode.

Vendor specific SCSI command is used to communicate with Pentax camera.

@twang2218
twang2218 / debug-cli-Av-k5-vs-k3.diff
Created January 5, 2016 05:57
pktriggercord K-3, K-5, CLI, GUI, Av, Bulb debug logs
--- debug-cli-k5-Av.log 2015-12-21 18:34:36.000000000 +1100
+++ debug-cli-k3-Av.log 2015-12-21 18:23:22.000000000 +1100
@@ -9,11 +9,11 @@
Checking drive: sg1 ATA
VBOX HARDDISK
- Checking drive: sg2 PENTAX
- DSC_K-5
+ Checking drive: sg2 RICOHIMG
+ DSC_K-3
➜ ~ gphoto2 --debug --capture-image-and-download
0.000240 main (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.006834 main (2): gphoto2 2.5.8
0.006938 main (2): gphoto2 has been compiled with the following options:
0.010747 main (2): + gcc (C compiler used)
0.010880 main (2): + popt (mandatory, for handling command-line parameters)
0.011017 main (2): + exif (for displaying EXIF information)
0.011099 main (2): + cdk (for accessing configuration options)
0.011145 main (2): + aa (for displaying live previews)
0.011189 main (2): + jpeg (for displaying live previews in JPEG format)
@twang2218
twang2218 / index.html
Created January 2, 2016 01:23
This is the index.html extracted and decoded from Pentax Flucard firmware v00010002
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
<head>
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes">
<!--[if IE]><meta http-equiv="Content-type" content="text/html; charset=UTF-8"><![endif]-->
<title>PENTAX FLU</title>
<link rel="apple-touch-icon" href="icon.png">
<style type="text/css">