Skip to content

Instantly share code, notes, and snippets.

View lemonlatte's full-sized avatar

Jim Yeh lemonlatte

  • Taipei, Taiwan
  • 19:40 (UTC +08:00)
View GitHub Profile
@lemonlatte
lemonlatte / run.sh
Created December 18, 2020 09:04 — forked from detunized/run.sh
Mount a read-only folder inside a Docker container with OverlayFS on top
# On the host to run the container
docker run --privileged -i -t -v ~/host-folder-to-mount:/root/folder-ro:ro ubuntu
# Inside the container
# Need to create the upper and work dirs inside a tmpfs.
# Otherwise OverlayFS complains about AUFS folders.
mkdir -p /tmp/overlay && \
mount -t tmpfs tmpfs /tmp/overlay && \
mkdir -p /tmp/overlay/{upper,work} && \
mkdir -p /root/folder && \
@lemonlatte
lemonlatte / receipt5.md
Created December 22, 2019 04:13
How to make a Raspberry Pi an RTSP streamer and how to consume this?

How to make a Raspberry Pi an RTSP streamer and how to consume this?

You should perform the following steps on a new SD card. Don't mess with existing solutions. It is not worth the $5 to loose something working.

I'm used to use Raspbian, so my suggestion is to go to https://www.raspberrypi.org/downloads/raspbian/ and download the latest Raspbian Stretch Lite. Flash it to your SD card. Mine have usually 16 GB, but maybe smaller work too. I'm using Etcher on macOS, a great tool for flashing.

After successful flashing enable ssh and prepare a running Wifi configuration.

A Wifi adapter should be attached to your Pi of course.

@lemonlatte
lemonlatte / hexToString.js
Created August 13, 2018 03:54
hex to string in JS
function hexToString (hex) {
var string = '';
for (var i = 0; i < hex.length; i += 2) {
string += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return string;
}
@lemonlatte
lemonlatte / envelope_encryption.go
Created February 7, 2018 16:48 — forked from andreas/envelope_encryption.go
Envelope Encryption with Amazon KMS and Go
package main
import (
"bytes"
"crypto/rand"
"encoding/gob"
"fmt"
"io/ioutil"
"os"
"time"
@lemonlatte
lemonlatte / gist:265f1afbd0ab964a2164dc58513c7d9e
Created December 21, 2017 17:54 — forked from thefella/gist:3431023
Favicons, mobile icons and launch screens
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-57x57-precomposed.png">
<link rel="icon" type="image/png" href="/apple-touch-icon-57x57-precomposed.png">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-startup-image" media="only screen and (max-device-width: 480px) and not (-webkit-min-device-pixel-ratio: 2)" href="/apple-touch-startup-image-320x460.png">
<link rel="apple-touch-startup-image" media="only screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="/apple-touch-startup-image-640x920.png">
<link rel="apple-touch-startup-image" media="only screen and (min-device-width: 768px) and (orientation: portrait)" href="/apple-touch-
@lemonlatte
lemonlatte / LICENCE SUBLIME TEXT
Created September 23, 2017 13:03 — forked from RoseySoft/LICENCE SUBLIME TEXT
Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
@lemonlatte
lemonlatte / README.txt
Created July 25, 2017 16:29 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh [email protected]
Run the server in one terminal
go run server.go
@lemonlatte
lemonlatte / UbuntuMiner
Created June 7, 2017 16:24 — forked from zcshiner/UbuntuMiner
UbuntuMiner. Command list to build an Ubuntu 14.04 Server with Cuda Toolkit 6.5, driver 352.41, and ccminer.
#!/bin/bash
### Command log to install Cuda Toolkit 6.5, driver 343.22, and ccminer.
## Update the system
sudo apt-get update && sudo apt-get -y dist-upgrade
# All the dependencies for Cuda & ccminer (I think)
sudo apt-get -y install gcc g++ build-essential automake linux-headers-$(uname -r) git gawk libcurl4-openssl-dev libjansson-dev xorg libc++-dev libgmp-dev python-dev
@lemonlatte
lemonlatte / tls-client.go
Created May 10, 2017 09:31 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@lemonlatte
lemonlatte / mrt-taipei.json
Created November 30, 2016 13:17 — forked from lackneets/mrt-taipei.json
台北捷運站點.JSON
[
{
"id": "030",
"name": "南港軟體園區",
"line": "文山內湖線",
"address": "115台灣台北市南港區捷運南港軟體園區站",
"latitude": 25.059904,
"longitude": 121.615952
},
{