Skip to content

Instantly share code, notes, and snippets.

View jinjie's full-sized avatar
🇸🇬
Hey there!

Kong Jin Jie jinjie

🇸🇬
Hey there!
View GitHub Profile
#!/usr/bin/python
import sqlite3 as lite
import sys
con = None
try :
con = lite.connect(<Sqlite file>)
con.row_factory = lite.Row
@jinjie
jinjie / gist:bfbecfbe891e05c9d2ffe4ac900fed49
Last active April 5, 2019 02:15
Verifying my Blockstack ID is secured with the address 1NUJLHzfTrb1hibs18WFKJEutqe6rvG3Au https://explorer.blockstack.org/address/1NUJLHzfTrb1hibs18WFKJEutqe6rvG3Au
Verifying my Blockstack ID is secured with the address 1NUJLHzfTrb1hibs18WFKJEutqe6rvG3Au https://explorer.blockstack.org/address/1NUJLHzfTrb1hibs18WFKJEutqe6rvG3Au
{
"Postal code": "Poskod",
"Important": "Penting",
"Page not found": "Laman tidak dijumpai",
"We can't find the page or service you're looking for": "Kami tidak dapat mencari halaman atau perkhidmatan yang anda cari",
"The link you clicked may be broken, or the page no longer exists": "Pautan yang anda klik boleh dipecahkan, atau halaman tidak lagi wujud",
"Something went wrong!": "Ada yang salah!",
"Something must have gone wrong": "Ada sesuatu yang salah",
"Send an e-mail to": "Hantar e-mel ke",
"if you can't get it to work.": "jika anda tidak boleh melakukannya untuk bekerja.",
@jinjie
jinjie / homeassistant_setup_script.sh
Created May 16, 2020 06:21
Setup Home Assistant easily on Raspberry Pi with venv. Improved from https://www.home-assistant.io/docs/installation/virtualenv
#!/bin/bash
#############################################
# WARNING: DO NOT RUN THIS SCRIPT DIRECTLY. #
# THIS SHOULD BE RUN AS ROOT IN A RPI #
#############################################
if [ ! "$(whoami)" == "root" ];
then
echo "YOU MUST RUN THIS AS ROOT"
@jinjie
jinjie / swap.sh
Last active May 17, 2020 06:52
Shell script for adding swap to Linux
#!/bin/sh
# Usage: curl <url to the raw script> | sh -s <size in MB>
# size of swapfile in megabytes
swapsize=1024
if [ $1 ];
then
swapsize=$1
@jinjie
jinjie / Dockerfile
Last active December 9, 2022 12:45
Example Dockerfile creating lean image for Go apps (Multi-stage build)
FROM golang:1.19-alpine as build
WORKDIR /app/
ADD . /app/
RUN go get
RUN CGO_ENABLED=0 go build -o mainApp .