Skip to content

Instantly share code, notes, and snippets.

View ottodevs's full-sized avatar
🥷
Hacking

Otto G ottodevs

🥷
Hacking
View GitHub Profile
Verifying my Blockstack ID is secured with the address 195ubhkEDGcQnRsWQsszgqSBFpwprGtghx https://explorer.blockstack.org/address/195ubhkEDGcQnRsWQsszgqSBFpwprGtghx
@ottodevs
ottodevs / alexa.js
Created October 28, 2017 17:27 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
@ottodevs
ottodevs / .description.drphil.txt
Created October 13, 2017 21:51 — forked from inertia186/.description.drphil.txt
Dr. Phil (`drphil.rb`) is reimplementation of the "Winfrey" voting bot specification. The goal is to give everyone an upvote. See: https://steemit.com/radiator/@inertia/drphil-rb-voting-bot-update-fixes
This is the Dr. Phil bot for STEEM and GOLOS. Please have a look at the README.md file.
@ottodevs
ottodevs / StringToLower.sol
Created September 26, 2017 11:22 — forked from thomasmaclean/StringToLower.sol
Ethereum/Solidity toLower() equivalent, to transform strings to lowercase
pragma solidity ^0.4.11;
contract StringToLower {
function _toLower(string str) internal returns (string) {
bytes memory bStr = bytes(str);
bytes memory bLower = new bytes(bStr.length);
for (uint i = 0; i < bStr.length; i++) {
// Uppercase character...
if ((bStr[i] >= 65) && (bStr[i] <= 90)) {
// So we add 32 to make it lowercase
@ottodevs
ottodevs / gist:4b782d0115f0ec71a97395b014291679
Created September 7, 2017 10:30 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ottodevs
ottodevs / kubernetes_on_macOS.md
Created July 12, 2017 15:54 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

(This is a brief summary of Ethereum's white paper)

Ethereum 101

What is Ethereum

Ethereum is a new cryptocurrency, like Bitcoin or Litecoin, that adds a number of new features. Most notably the inclusion of Agents (also known as Contracts); Independent Turing-complete programs that exist on the Ethereum blockchain. These Agents can receive Ether (Ethereum's currency) and other inputs, perform computations, hold balances, transfer Ether, and even activate other Agents.

Ethereum also attempts to fix some current issues with cryptocurenncy mining, such as rise of specialized hardware, large mining pools that aim to control the network, and the lack of reward for stale blocks, dissuading miners with weaker hardware.

Agents

@ottodevs
ottodevs / pf.conf
Created May 11, 2017 22:32 — forked from trustin/pf.conf
Trustin's /etc/pf.conf for Mac OS X
# 1. Put this file to /etc/pf.conf
# 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/
# I tried to use IceFloor to configure everything but it didn't work very well.
# 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr'
# 4. At System Preferences -> Security -> Firewall -> Firewall Options,
# check 'Block all incoming connections' to prevent annoying per-app dialogs.
set skip on lo0
set block-policy drop
/*
Foundation Tip Contract
Address: 0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359
Bitcoin Shapeshift Address: 1GyczDXWjFbmhx2Qau4ham3zJqNEP8UcEG (if transaction fails it is sent to 39BaMQCphFXyYAvcoGpeKtnptLJ9v6cdFY instead)
Interface: [{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposals","outputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"},{"name":"description","type":"string"},{"name":"votingDeadline","type":"uint256"},{"name":"executed","type":"bool"},{"name":"proposalPassed","type":"bool"},{"name":"numberOfVotes","type":"uint256"},{"name":"currentResult","type":"int256"},{"name":"proposalHash","type":"bytes32"}],"type":"function"},{"constant":false,"inputs":[{"name":"proposalNumber","type":"uint256"},{"name":"transactionBytecode","type":"bytes"}],"name":"executeProposal","outputs":[{"name":"result","type":"int256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"memberId","outputs":[{"name":"","type":"uint

Frontier technical checklist: (FORK ME)

  • Build Geth release 1.0.0
    • git clone https://github.com/ethereum/go-ethereum.git; cd go-ethereum
    • git checkout release/1.0.0
    • make geth
  • Clean out old test net relics (export ETH=<data dir> default data dir on OS X ~/Library/Ethereum, Linux ~/.ethereum)
    • rm -rf $ETH/{blockchain,state,extra}
    • Make a backup of your old keys cp -r $ETH/keystore /path/to/backup/keystore.backup
  • Craft the genesis block