Skip to content

Instantly share code, notes, and snippets.

@chuckixia
chuckixia / gist:66afb24f13c7d4c6bc2d34e5b4b5a7d3
Last active May 22, 2018 21:59
exec: "/bin/sh": stat /bin/sh: no such file or directory (or maybe exec: "/bin/bash" ?)
Are you suffering from this cryptic error?
Are you somewhat familiar with docker but flailing around lost with what could be causing this issue?
Are you trying to export an image somewhere on docker, and import on another machine, and it seems straightforward enough?
Then what you probably did on machine was:
docker save randomimage > foo.tar
and then on the other machine
docker import foo.tar foo
@chuckixia
chuckixia / minitest_IO_WaitReadable.rb
Created February 28, 2018 01:23
IO::WaitReadbale has not initializer. Makes mocking and stubbing in minitest hard and annoying
# example to stub out IO::WaitReadable. Spent forever figuring this stupid one out.
class MyError < StandardError
# function to test
def start_ssl_server
begin
@server.accept
rescue IO::WaitReadable
rs,ws,es = Kernel.select([@server], [@server], [@server],10)
@chuckixia
chuckixia / gist:501054f21e5ae614631a634fbb6cd38e
Last active June 28, 2017 10:16
bitcoin addresses for wanacry ransomware
quick hack to extract bitcoin address (OS X):
strings -n 34 FILENAME | grep -E '^.{34}$'
better hacky shell script:
strings FILE | grep -E '^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$'
Hash: ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
115p7UMMngoj1pMvkpHijcRdfJNXj6LrLn
12t9YDPgwueZ9NyMgw519p7AA8isjr6SMw
13AM4VW2dhxYgXeQepoHkHSQuy6NgaEb94