This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this is a simple script to generate checksums and | |
| # find ones that start with zeros. when a matching | |
| # checksum is found, it outputs it and looks for | |
| # the a checksum with one more zero. | |
| # you can see in the output below that it took only | |
| # 9 tries to find a checksum with one zero, and it | |
| # took 6132845 tries to find one with six zeros. | |
| # example output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in stratum-mining-proxy project | |
| python setup.py install | |
| cd midstatec && make && cd .. | |
| ./mining_proxy.py -o mining.eligius.st -p 3334 --custom-user 1JT86GVai2r7sixvsJfJxNWHon9Dep2erh | |
| #TODO: figure out if we can remove midstate (-nm) | |
| # run both: | |
| #FIXME: change the wallet addresses | |
| ./mining_proxy.py -v -o mining.eligius.st -p 3334 -gp 8333 -sp 3333 --custom-user 1Do6mZGbXcRutqVxaMbdoiQrYNSQrfVuA4 --custom-password whatever | |
| ./mining_proxy.py -v -o mining.eligius.st -p 3334 -gp 8334 -sp 3334 --custom-user 1DQeV5UiVhHge95aT1vwgkMGngEtjX2ZLZ --custom-password whatever |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'json' | |
| require 'open-uri' | |
| require 'slack-notifier' | |
| # use the turtle subreddit | |
| turtles = "http://www.reddit.com/r/turtle.json" | |
| json = JSON.load(open(turtles)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| black='\e[47m' | |
| red='\e[31;41m' | |
| blue='\e[34;44m' | |
| blueonred='\e[34;41m' | |
| reset='\e[0m' | |
| echo -e "${blue}iiiiii${reset} ${blueonred}@@@@@@${red}llllllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset}" | |
| echo -e "${blue}iiiiii${reset} ${blueonred}@@@@@@${red}llllllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.tmuxinator/workspace.yml | |
| name: workspace | |
| root: ~/ | |
| # Optional tmux socket | |
| # socket_name: workspace | |
| # Runs before everything. Use it to start daemons etc. | |
| # pre: sudo /etc/rc.d/mysqld start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # this is a proof-of-concept for reading encrypted data bags | |
| # from a ruby script. you only need chef to be installed. | |
| require 'rubygems' | |
| require 'chef/rest' | |
| require 'chef/encrypted_data_bag_item' | |
| # prevent chef from trying to contact a server | |
| Chef::Config[:solo] = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # this script will scrape the CA DMV website for wait times, | |
| # and if the wait is less than a certain threshold, it will | |
| # alert you with an audible message (at least on OS X). | |
| require 'open-uri' | |
| require 'date' | |
| # found from http://apps.dmv.ca.gov/web/fieldoffice.html?number=503 | |
| @branch_id = 503 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # this script takes a URL and verifies that | |
| # every css file included loads correctly | |
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'pry' if $DEBUG | |
| url = ARGV.shift || 'https://ifttt.com' | |
| doc = Nokogiri::HTML(open(url).read) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I don't know if the guide goes on to address these points, | |
| # but I thought it might be kinda fun to help you on your path. | |
| if 4 > 5 | |
| # ruby programmers tend to use 2 spaces instead of 4 for indentation | |
| # also, even though it's confusing, you'll generally use "puts" instead of "print" | |
| puts "I'm soooo wrong it's painful" | |
| # I like to avoid using parentheses to group things, so I'd rewrite what you had as: | |
| #elsif 4 > 5 != true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| puts "Why is the FBI after you?" | |
| # optional, but you can chain the downcase here | |
| text = gets.chomp.downcase | |
| # the default parameter for String#split is ' ', so you can omit it | |
| words = text.split | |
| # note that since text was only used here, you could have just said: | |
| #words = gets.chomp.downcase.split |