Skip to content

Instantly share code, notes, and snippets.

View michaelluk's full-sized avatar

Michael Luk michaelluk

  • Hong Kong, Earth
View GitHub Profile

Installing Python 3.7.0 on Raspbian

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).
@michaelluk
michaelluk / s3arangodb.sh
Created February 7, 2018 08:33 — forked from faruken/s3arangodb.sh
backup arangodb to S3
#!/bin/sh
# Slightly modified to meet ArangoDB's needs. https://github.com/lumerit/s3-shell-backups
NOWDATE=`date +%Y-%m-%d`
LASTDATE=$(date +%Y-%m-%d --date='1 week ago')
USERNAME="${ARANGODB_USERNAME}"
PASSWORD="${ARANGODB_PASSWORD}"
DATABASE='dbname'
@michaelluk
michaelluk / _README.md
Created August 31, 2017 03:38 — forked from schickling/_README.md
Script to import and export docker-machine configurations to sync between hosts/collaborators

docker-machine import/export

Script to import and export docker-machine configurations to sync between hosts/collaborators

Export (on host A)

$ docker-machine ls
NAME       ACTIVE   DRIVER         STATE     URL                            SWARM   DOCKER    ERRORS
dev        -        digitalocean   Running   tcp://example.com:2376                 v1.10.1
@michaelluk
michaelluk / index.ios.js
Created July 3, 2017 04:07 — forked from ronnyhartenstein/index.ios.js
React Navigation: Parallel Navigators in React Native in a nutshell
import React from 'react'
import { AppRegistry } from 'react-native'
import setup from './setup'
AppRegistry.registerComponent('ReactNavigationTest', setup)
@michaelluk
michaelluk / huoche.py
Created May 18, 2016 03:59 — forked from w4lle/huoche.py
12306抢票
# -*- coding: utf-8 -*-
"""
@author: Akagi201
"""
from splinter.browser import Browser
from time import sleep
import traceback
###容错做的不好,考虑的情况也不够多,大家见谅
@michaelluk
michaelluk / Foreground.java
Last active August 29, 2015 14:08 — forked from steveliles/Foreground.java
Detect android application enters background and foreground. But it requires API 14+ :\
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>