Skip to content

Instantly share code, notes, and snippets.

View bluet's full-sized avatar
🏠
Working from home

BlueT - Matthew Lien - 練喆明 bluet

🏠
Working from home
View GitHub Profile
@bluet
bluet / eth-pubkey-tests.js
Last active June 18, 2023 02:08
eth-crypto and web3, public key retrieving, sign, recover and encrypting test
/* eslint-disable no-console */
const EthCrypto = require("eth-crypto");
const sigUtil = require("@metamask/eth-sig-util");
const ethUtil = require("ethereumjs-util");
async function test (provider, selectedAccount) {
// eslint-disable-next-line no-undef
const web3 = new Web3(provider);
// const accounts = await web3.eth.getAccounts();
// selectedAccount = accounts[0];
@bluet
bluet / Database Naming Convention and Data Warehouse Design Principles.md
Last active November 13, 2023 13:12
Database Naming Convention and Data Warehouse Design Principles
@bluet
bluet / mariadb-temporal-table.md
Last active July 6, 2020 08:29
Versioning database data with MariaDB Temporal Table

Running Minikube via LXD

I make some assumptions, and make no claims in how well supported this is or ever will be. I wanted to avoid using VMs because i've been working in containers for the last half decade. It made sense to just skip the middle man and use a machine type container system to run my minikube workloads.

Why not juju?

Simply put, Juju does a fantastic job; but to stay objective I wanted to achieve minikube in LXD as a functional alternative to juju deploy kubernetes-core, or using KVM/VirtualBox in this solution.

@bluet
bluet / monospace.sol
Created August 31, 2018 05:02
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.16;
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
@bluet
bluet / postgres_queries_and_commands.sql
Created May 17, 2018 04:23 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
# Replace [YOUR_DOMAIN_NAME] by your real domain
server.modules += ( "mod_setenv" ) # For HSTS
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/letsencrypt/live/[YOUR_DOMAIN_NAME]/combined.pem"
ssl.ca-file = "/etc/letsencrypt/live/[YOUR_DOMAIN_NAME]/fullchain.pem"
ssl.dh-file = "/etc/ssl/certs/dhparam.pem"
{ Winters: 6.446,
Rasmussen: 4.8934,
Levy: 4.8123,
Miriam: 4.8345,
Brenda: 4.8083,
Elma: 4.8371,
Clarice: 4.5523,
Alana: 4.3095,
Patton: 5.2737,
Scott: 4.9223,

Keybase proof

I hereby claim:

  • I am bluet on github.
  • I am bluet (https://keybase.io/bluet) on keybase.
  • I have a public key ASAlSJONdhClnJ9ORFkg21itIdKooFbt6yEx_o9g5778Jgo

To claim this, I am signing this object:

@bluet
bluet / servo build log --verbose
Created March 14, 2015 18:53
servo build log --verbose
Fresh mozjs-sys v0.0.0 (https://github.com/servo/mozjs#056e1d95)
Fresh matches v0.1.2
Fresh unicase v0.0.4
Fresh gcc v0.1.7
Fresh gcc v0.1.7 (https://github.com/alexcrichton/gcc-rs#016cc159)
Fresh egl v0.1.0 (https://github.com/servo/rust-egl#328e79b6)
Fresh khronos_api v0.0.5
Fresh plugins v0.0.1 (file:///home/matthew/workspace/servo/components/servo)
Fresh rustc-serialize v0.2.12
Fresh png-sys v1.6.16 (https://github.com/servo/rust-png#687f1034)