Skip to content

Instantly share code, notes, and snippets.

View stereosupersonic's full-sized avatar

MICE Portal stereosupersonic

View GitHub Profile
@stereosupersonic
stereosupersonic / miner.py
Created March 14, 2022 09:53
bitcoin miner
from hashlib import sha256
MAX_NONCE = 10000000
def create_sha256(text):
return sha256(text.encode("ascii")).hexdigest()
def mining(block_number, transactions, prev_hash, difficulty):

My raspberry pi setup

create a bootable card

boot new raspberry PI

  • find IP in your network e.g. nmap -sP 192.168.1.*
  • login with ssh pi@ password: raspberry
@stereosupersonic
stereosupersonic / linux_setup.md
Last active March 30, 2021 09:21
my linux (debian) setup
def remote_file_exits?(url, limit=10)
raise ArgumentError, 'too many HTTP redirects' if limit == 0
uri = URI(url)
response = Net::HTTP.get_response(uri)
case response
when Net::HTTPNotFound then
false
@stereosupersonic
stereosupersonic / rubocop.yml
Created December 1, 2020 06:50
rubocop basics settings
AllCops:
Include:
- '**/*.rb'
- '**/*.rake'
- '**/Gemfile'
Exclude:
- '**/tmp/**/*'
- '**/vendor/**/*'
- '**/node_modules/**/*'

Visual Studio Code

install

brew cask install visual-studio-code

settings

Code > Preferences > Settings

{
@stereosupersonic
stereosupersonic / open_ny_times.sh
Created November 16, 2020 17:07
Open then latest new york times front page
open https://static01.nyt.com/images/$(date +"%Y/%m/%d")/nytfrontpage/scan.pdf
#!/usr/bin/env ruby
MAX_RETRY = 3
PATH = "/sys/bus/iio/devices/"
TEMP_SENSOR = PATH + "iio\:device#{ARGV[0].to_i}/in_temp_input"
HUMIDITY_SENSOR = PATH + "iio\:device#{ARGV[0].to_i}/in_humidityrelative_input"
def save_read(sensor)
run = 1
while run < MAX_RETRY
@stereosupersonic
stereosupersonic / Gemfile
Created June 26, 2020 06:13 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@stereosupersonic
stereosupersonic / jenkins_raspi.md
Last active May 15, 2020 07:46
run jenkins on Raspi #raspi #jenkins #docker

run jenkins on raspi via docker

this doesn't work because there is no image for arm available

docker run -p 8081:8080 -p 50000:50000 -v  /mnt/data/volumes/jenkins:/var/jenkins_home  jenkins/jenkins:lts

i try