Skip to content

Instantly share code, notes, and snippets.

import os
from fabric.api import env, require, run, sudo, cd
env.project_name = ''
env.server_name = ''
env.webapps_root = '/opt/webapps/'
env.project_root = os.path.join(env.webapps_root, env.project_name)
env.activate_script = os.path.join(env.project_root, 'env/bin/activate')
env.wsgi_file = os.path.join(env.project_root, 'django.wsgi')
@vietlq
vietlq / 000_README.md
Last active August 8, 2017 08:00
Floats and Doubles for Dummies: Understanding Floating Points
@vietlq
vietlq / arduinoclock.cpp
Created August 23, 2017 18:51 — forked from Bravo555/arduinoclock.cpp
Arduino clock project
#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
#include <LiquidCrystal_I2C.h>
int budzikGodzina = 7, budzikMinuta = 0;
LiquidCrystal_I2C lcd(0x27, 16, 2);
tmElements_t tm;
@vietlq
vietlq / Rinkeby.md
Created October 5, 2017 20:33 — forked from learner-long-life/Rinkeby.md
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@vietlq
vietlq / rinkeby_01.txt
Created October 5, 2017 20:43
Ether for Rinkeby
0x827c4C5789957dfd8A6a90d904bef931CE1B8Fee
@vayn
vayn / decrypt.py
Last active October 9, 2017 22:16
Example of PyCrypto AES decryption
import base64
import hashlib
import hmac
from Crypto.Cipher import AES
key = base64.decodebytes(b'v4QC6l4ttEogiBYvjLyvbA==')
nonce = base64.decodebytes(b'3iNVHJXuCfYoU9QP49DGqw==')
ct = base64.decodebytes(b'x9WM3Qy15Xw/2Z6pGVKXVA==')
@vietlq
vietlq / test_v3_scrypt_aes_128_ctr_utc.json
Created October 14, 2017 13:01
VISCHub: Sample UTC JSON file for Ethereum Wallet
{
"version": 3,
"id": "f50f0234-d25c-42a9-8c2f-e777fafe5c2a",
"address": "389d46c0d5d20c8220ad236b5a25b348c67e3021",
"Crypto": {
"ciphertext": "7cc66b5740d2ce0942b5beef2a997f5d85a9ab0e10a166a9f31cc16372c72204",
"cipherparams": {
"iv": "d8acc1c0a3a18c61acc33ca05eeb19bf"
},
"cipher": "aes-128-ctr",
package main
import (
"github.com/syndtr/goleveldb/leveldb"
"fmt"
"encoding/binary"
"github.com/ethereum/go-ethereum/core/types"
"bytes"
"github.com/ethereum/go-ethereum/rlp"
)
@vietlq
vietlq / docker-cleanup-resources.md
Created January 27, 2018 19:49 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@vietlq
vietlq / curl.md
Created January 29, 2018 13:01 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin