Skip to content

Instantly share code, notes, and snippets.

View mraaroncruz's full-sized avatar
🏃‍♂️

Aaron Cruz mraaroncruz

🏃‍♂️
View GitHub Profile
@mraaroncruz
mraaroncruz / ethereum.rb
Created November 8, 2018 12:24
Use your key with a contract in ruby
key = Eth::Key.new(priv: YOUR_PRIVATE_KEY)
client = Ethereum::HttpClient.new(...)
client.default_account = key.address
contract = Ethereum::Contract.create(...)
contract.key = key
@mraaroncruz
mraaroncruz / iam_admin_policy.json
Last active September 10, 2018 13:32
S3 Policies
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListAllMyBuckets"
],
"Resource": "arn:aws:s3:::*"
@mraaroncruz
mraaroncruz / steps.md
Last active March 23, 2024 13:28
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999

@mraaroncruz
mraaroncruz / gist:b3f4546bcba45130496d62587b46f62b
Created June 18, 2018 14:24 — forked from TeWu/gist:1234573
TCP client and multithreaded server in 14 lines of Ruby code

TCP client and multithreaded server in 14 lines of Ruby code

Server:

require "socket"
server = TCPServer.open(2626)
loop do
	Thread.fork(server.accept) do |client| 
 client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
@mraaroncruz
mraaroncruz / veominer_fallback.bash
Created June 5, 2018 13:18
veoCL script with fallback pool
# veoCL pool failover script by Overcooked Panda
#
# Enter your default pool at the bottom, enter secondary pool on Line 39
# Set the value for 'timeout' to kill the miner and check default pool.
#
# Use at your own risk, and good luck!
#########################################################################
# Original snippet from phs on stackoverflow.
#
# Retries a command a configurable number of times with backoff.
@mraaroncruz
mraaroncruz / wol.rb
Last active June 15, 2018 04:57 — forked from scharfie/wol.rb
A ruby script which sends out a magic packet to wake up your PC
#!/usr/bin/ruby
# wol.rb: sends out a magic packet to wake up your PC
#
# Copyright (c) 2004 zunda <zunda at freeshell.org>
# Modified by scharfie <scharfie at gmail dot com>
#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms of ruby itself ---
# Ruby Distribution License or GNU General Public License.
#
@mraaroncruz
mraaroncruz / install_nvidia_docker.bash
Created April 23, 2018 06:56
Install Nvidia Docker
#!/bin/bash
# INSTALL DOCKER
### Update the apt package index:
sudo apt-get update
### Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install \
apt-transport-https \
@mraaroncruz
mraaroncruz / Dockerfile
Created February 21, 2018 12:20 — forked from treeder/Dockerfile
multi-stage build
# build stage
FROM golang:alpine AS build-env
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
ENTRYPOINT ./goapp
@mraaroncruz
mraaroncruz / dockerhub-v2-api-user.sh
Created February 20, 2018 20:42 — forked from kizbitz/dockerhub-v2-api-user.sh
Get the list of images and tags for a Docker Hub user account.
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all imagas and tags associated with a Docker Hub user account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username and password
UNAME=""
UPASS=""
@mraaroncruz
mraaroncruz / claymore-dualminer-api.md
Last active July 20, 2021 17:34
Ethminer API Docs (lol) and some other miner APIs

EthMan uses raw TCP/IP connections (not HTTP) for remote management and statistics. Optionally, "psw" field is added to requests is the password for remote management is set for miner. The following commands are available (JSON format):


REQUEST: {"id":0,"jsonrpc":"2.0","method":"miner_getstat1"}

RESPONSE: