Skip to content

Instantly share code, notes, and snippets.

View auser's full-sized avatar

Ari auser

View GitHub Profile
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 1, 2025 11:43
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@nerdyworm
nerdyworm / rename.sh
Created July 30, 2016 17:40
rename a phoenix project
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
@aquabu
aquabu / over_under.sol
Last active May 22, 2018 20:44
demonstrating uint overflow and underflow in solidity
/* demonstrating uint overflow and underflow in ethereum solidity
this is why you need guards like:
if (balances[_to] + _amount < balances[_to]) throw;
*/
contract C {
// (2**256 - 1) + 1 = 0
function overflow() returns (uint256 _overflow) {
uint256 max = 2**256 - 1;
return max + 1;
}
/**
* Ethereum Account Scanner
*
* To run this, you need your own geth node, accepting RPC
* connections on a port you can access.
*
* Install pre-requisites:
* sudo npm install -g web3
*
* Usage:
@alces
alces / ansible_local_playbooks.md
Last active June 3, 2025 22:54
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@splhack
splhack / python2+3.md
Created May 18, 2016 06:01
MacVim with Python 2.x and Python 3.x
  • Install python 2.7.11

command line

$ PYTHON_CONFIGURE_OPTS="--enable-shared" \
    LDSHARED="clang -bundle" \
    LDCXXSHARED="clang++ -bundle" \
    BLDSHARED="clang -bundle -lpython2.7" \
    pyenv install 2.7.11
@lowmess
lowmess / .gitignore
Last active June 2, 2016 00:22
Default Metalsmith build
node_modules
_build
@viperwarp
viperwarp / ReactNativeJson.java
Created February 24, 2016 03:02
React-Native Module, ReadableMap/Array to Java JSON objects
private static WritableMap convertJsonToMap(JSONObject jsonObject) throws JSONException {
WritableMap map = new WritableNativeMap();
Iterator<String> iterator = jsonObject.keys();
while (iterator.hasNext()) {
String key = iterator.next();
Object value = jsonObject.get(key);
if (value instanceof JSONObject) {
map.putMap(key, convertJsonToMap((JSONObject) value));
} else if (value instanceof JSONArray) {
@der-On
der-On / metalsmith_express_dynamic_page.js
Created January 29, 2016 21:58
Express middleware to create a dynamic HTML page using metalsmith.
'use strict';
var metalsmith = require('metalsmith');
var layouts = require('metalsmith-layouts');
var fs = require('fs');
var lorem = fs.readFileSync('./lorem.txt', 'utf8');
var n = 0;
// generates a single page
@ermaker
ermaker / KerasExampleOnJupyter.py
Last active June 22, 2016 05:56
Keras Example on Jupyter (works on old version of Keras, not current version)
# Python 2.7 on Jupyter
# Libraries: Keras, pandas, numpy, matplotlib, seaborn
# For compatibility
from __future__ import absolute_import
from __future__ import print_function
# For manipulating data
import pandas as pd
import numpy as np
from keras.utils import np_utils # For y values