Skip to content

Instantly share code, notes, and snippets.

View danielribeiro's full-sized avatar

Daniel Ribeiro danielribeiro

View GitHub Profile
@danielribeiro
danielribeiro / regtest.md
Last active October 26, 2017 21:24 — forked from t4sk/regtest.md
How to get bitcoins for development using Regtest

How to get bitcoins for development using Regtest

Start bitcoind

> bitcoind -regtest -datadir=./ -printtoconsole

Generate block chain

> bitcoin-cli -regtest -datadir=./ generate 101
@neuni
neuni / openvpn_on_google_cloud.md
Created February 28, 2017 13:34
Create a openVPN server on Google Cloud Platform to connect to your Google Cloud network using openVPN and/or to route your internet traffic through the VPN (Road Warrior Scenario)

Install openVPN server on Google Cloud using Pritunl

Purpose:

Create a openVPN server on Google Cloud Platform to connect to your Google Cloud network using openVPN and/or to route your internet traffic through the VPN (Road Warrior Scenario)

Create instance

  • Create new instance in default network
  • Chosse Ubuntu 16.04 LTS
@t4sk
t4sk / regtest.md
Last active December 31, 2017 19:31
How to get bitcoins for development using Regtest

How to get bitcoins for development using Regtest

Start bitcoind

> bitcoind -regtest -daemon

Generate block chain

> bitcoin-cli -regtest generate 101
$ pxctest list-tests \
--testrun KIF_iphonesimulator10.2-i386.xctestrun \
| jq -r '. | select(.event | test("begin-test$")) | "\(.className)/\(.methodName)"'
AccessibilityIdentifierTests/testClearingAndEnteringTextIntoViewWithAccessibilityLabel
AccessibilityIdentifierTests/testEnteringTextIntoViewWithAccessibilityIdentifier
AccessibilityIdentifierTests/testEnteringTextIntoViewWithAccessibilityIdentifierExpectingResults
AccessibilityIdentifierTests/testLongPressingViewWithAccessibilityIdentifier
AccessibilityIdentifierTests/testSettingTextIntoViewWithAccessibilityIdentifier
AccessibilityIdentifierTests/testTappingStepperDecrement
@danielribeiro
danielribeiro / gist:70da0d180d4b44230cde09972623ef70
Created October 27, 2016 23:01 — forked from jedi4ever/gist:7677d62f1414c28a1a8c
Some notes on travisci remote debugging via ssh or screenshot or remote desktop of Mac VM builds
Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build.
#################################################
# Enable remote ssh access to travisci build for debugging
#################################################
# Add a key so we can login to travisci vm
- cat ssh/travisci.pub >> ~/.ssh/authorized_keys
- chmod 600 ssh/travisci
# Install netcat
@cocoalabs
cocoalabs / gist:2fb7dc2199b0d4bf160364b8e557eb66
Created August 15, 2016 21:50
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
@mfikes
mfikes / fast.md
Last active January 6, 2024 07:19
Fast Clojure REPL

An experimental change for fast Clojure REPL startup:

  1. Download the JAR: clojure-1.8.0-fast.jar
  2. Launch it via java -jar clojure-1.8.0-fast.jar

The code used to create this JAR is on GitHub.

What's it doing?

It is:

@graceavery
graceavery / harryPotterAliases
Last active May 10, 2023 02:51
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'
@danielribeiro
danielribeiro / optparsing.rb
Last active May 31, 2016 06:04
optparsing.rb
#!/usr/bin/env ruby
require 'optparse'
require 'pp'
options = {}
parser = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
@danielribeiro
danielribeiro / timeout.rb
Created April 4, 2016 23:23 — forked from lpar/timeout.rb
Run a shell command in a separate thread, terminate it after a time limit, return its output
# Runs a specified shell command in a separate thread.
# If it exceeds the given timeout in seconds, kills it.
# Returns any output produced by the command (stdout or stderr) as a String.
# Uses Kernel.select to wait up to the tick length (in seconds) between
# checks on the command's status
#
# If you've got a cleaner way of doing this, I'd be interested to see it.
# If you think you can do it with Ruby's Timeout module, think again.
def run_with_timeout(command, timeout, tick)
output = ''