Skip to content

Instantly share code, notes, and snippets.

View assafshomer's full-sized avatar

Assaf Shomer assafshomer

View GitHub Profile
@assafshomer
assafshomer / README.md
Created September 2, 2020 10:33
Get Address Balance without Index
> sudo chmod a+wx utxo.sh
> sudo chmod a+wx address.sh
> sudo chmod a+wx balance.sh
>./balance 1myaddress 
sudo yum install -y git gcc make readline-devel openssl-devel
git clone git://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install ruby-build system-widely
git clone git://github.com/rbenv/ruby-build.git /tmp/ruby-build
cd /tmp/ruby-build
@assafshomer
assafshomer / rspec_rails_cheetsheet.rb
Created November 7, 2018 15:13 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@assafshomer
assafshomer / create-mint.sh
Last active May 29, 2018 07:33 — forked from gildas/create-mint-sh
Create Linux Mint USB on Mac OS/X
#! /usr/bin/env bash
# Insert a USB key.
# if needed initialize it with MS/DOS FAT and MBR
# Download the Mint ISO image
# Convert the ISO -> IMG
hdiutil convert -format UDRW -o linuxmint-18.3-mate-64bit linuxmint-18.3-mate-64bit.iso
# Run a diskutil list to know the device for the USB key, e.g.: /dev/disk3
@assafshomer
assafshomer / install_coincooler.sh
Last active May 7, 2018 13:54
install coincooler
# Start the RP
# launch a terminal window
# Type the following command and hit `Enter`
bash <(curl -s https://raw.githubusercontent.com/assafshomer/rpcc/master/config-rp/scripts/install-ruby.sh)
# This will take about 15-20 minutes to run. In the end the pi should reboot.
# When it does, type the next command and hit `Enter` (should take a similar amount of time)
bash <(curl -s https://raw.githubusercontent.com/assafshomer/rpcc/master/config-rp/scripts/install-coincooler.sh)

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git

Adding PIXEL to Raspbian Lite

Flash Raspbian Lite as normal. Run raspi-config and setup whatever you would to for console only mode. I usually change password, hostname and activate SSH server as a initial setup.

Adding wifi from console (optional)

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

@assafshomer
assafshomer / install_ruby_rpi.sh
Last active May 6, 2018 09:51 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.5 on the Raspberry Pi (Raspbian)
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby 2.5 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
# --------------------------------------------------------------------------------------------
# Time the install process
START_TIME=$SECONDS
# Install git + dependencies
@assafshomer
assafshomer / install_ruby_rpi.sh
Created April 18, 2018 13:01 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.5 on the Raspberry Pi (Raspbian)
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby 2.5 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Welcome message
"#{`git rev-parse HEAD`} (commit no. #{`git rev-list --count HEAD`.strip} on '#{`git branch`.split(/\n/).select{|e| e=~/\*/}.first.split(/\s/).last}' branch)"