Skip to content

Instantly share code, notes, and snippets.

View thosuperman's full-sized avatar

Tho Nguyen thosuperman

View GitHub Profile

Introduction

There’s been a lot of buzz in the recent year around Ethereum cryptocurrency and not without cause. Smart contracts is a new exciting concept that Ethereum introduced. What is it? Ethereum is a distributed ledger (same as bitcoin) but this ledger may contain not only accounts and balances, but also computer programs. Programs are first class citizen on Ethereum blockchain and they are not only stored on it, but they provide functions that might be called (same as you may deposit or withdraw money on the ledger’s account) and store its state on the blockchain. For software developers it would be a good analogy that Ethereum Blockchain is a something similar to a VM. There is a virtual machine with instances of objects that are stored in its memory (smart contract). Instances contain not only code that might be executed but also its state. The main difference is that the everything is stored on distributed ledger instead of RAM. This metaphor is not perfect and simplifie

@thosuperman
thosuperman / Node_AWS_Linux.md
Created February 16, 2018 15:22 — forked from nrollr/Node_AWS_Linux.md
Install Node.js on Amazon Linux (EC2)

Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

@thosuperman
thosuperman / Rinkeby.md
Created January 25, 2018 11:08 — 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,

@thosuperman
thosuperman / Howto convert a PFX to a seperate .key & .crt file
Created January 24, 2018 07:13 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@thosuperman
thosuperman / GoDaddySSLHAProxy.md
Last active January 19, 2018 06:34 — forked from sethwebster/GoDaddySSLHAProxy.md
Creating a PEM for HaProxy from GoDaddy SSL Certificate

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/yourdomain.com/yourdomain.com.key 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy:

@thosuperman
thosuperman / selenium.sh
Last active September 26, 2017 07:48 — forked from dhensby/selenium.sh
Selenium, Firefox and Behat on CentOS 7 RHEL 7 and fedora
#!/usr/bin/env bash
# help from:
# https://gist.github.com/textarcana/5855427
# http://tecadmin.net/install-firefox-on-linux/
# install deps
yum install -y java Xvfb firefox
# This version of FF doesn't actually work with latest selenium (for me) so I remove it again
@thosuperman
thosuperman / stable_ico.sol
Created September 13, 2017 09:48 — forked from stableproject/stable_ico.sol
STABLE Project ICO
pragma solidity ^0.4.11;
/// @title STABLE Project ICO
/// @author Konrad Szałapak <[email protected]>
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
@thosuperman
thosuperman / Compile_Bitcoin_on_Ubuntu_14_04
Last active September 13, 2017 03:12 — forked from kostaz/Compile_Bitcoin_on_Ubuntu_14_04
Compile Bitcoin on Ubuntu 14.04
Assuming the username of the Ubuntu user is "ubuntu".
Preparation
-----------
```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
@thosuperman
thosuperman / readme.md
Created September 4, 2017 08:05 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@thosuperman
thosuperman / ConvertUTF-8.py
Created August 24, 2017 03:33 — forked from smccutchen/ConvertUTF-8.py
Convert multiple files to UTF-8 encoding with Notepad++
# 2016-2017 Soverance Studios.
# Scott McCutchen
# This file will search all files and folders within a given directory, and use Notepad++ to convert their encoding to UTF-8 without Byte Order Marks
#
# This file must be run using the PythonScript plugin from within Notepad++, which is available through the Notepad++ Plugin Manager
#
# You must have Python 2.7 installed
#
# Additionally, this script can only exist and be run from within the Notepad++ user's working directory, the default of which is here: