Skip to content

Instantly share code, notes, and snippets.

View mgregoro's full-sized avatar
🏄‍♂️
enjoying the internet superhighway

Michael Gregorowicz mgregoro

🏄‍♂️
enjoying the internet superhighway
  • Wayne State University
  • Detroit, MI
  • X @mgregoro
View GitHub Profile
@mgregoro
mgregoro / 0_reuse_code.js
Created June 23, 2014 16:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mgregoro
mgregoro / keybase.md
Created September 29, 2014 22:45
keybase.md

Keybase proof

I hereby claim:

  • I am mgregoro on github.
  • I am mg2 (https://keybase.io/mg2) on keybase.
  • I have a public key whose fingerprint is 53B5 5737 48B2 377C A7AC 2D90 7689 B59B 45BA 9D7C

To claim this, I am signing this object:

@mgregoro
mgregoro / gist:9fa29f5dfb36e88878ec
Created April 24, 2015 20:57
Perl TOTP using Crypt::Sodium
#!/usr/bin/env perl
use Crypt::Sodium;
use MIME::Base32;
my $secret = join(' ', @ARGV);
my $skew_tolerance = 10;
my $interval = 60;
while (1) {

Keybase proof

I hereby claim:

  • I am mgregoro on github.
  • I am mg2 (https://keybase.io/mg2) on keybase.
  • I have a public key whose fingerprint is DC6A DDF9 C913 1310 2DC6 188A B530 F4BC 6F9C FF8A

To claim this, I am signing this object:

@mgregoro
mgregoro / kbfree.pl
Last active August 18, 2016 20:08
Quick script to show total, used, free keybase.io kbfs space on OSX / Linux clients
#!/usr/bin/env perl
# kbfree.pl
# cpanm JSON Number::Bytes::Human
# (c) 2016 Michael Gregorowicz
use Number::Bytes::Human;
use JSON;
use v5.10;
Node.prototype.getSeemsLegitHashrate = function(callback) {
http.get("http://127.0.0.1:8081/api/stats", function (res) {
if (res.statusCode == 200) {
res.setEncoding('utf8');
var body = '';
res.on('data', function (chunk) {
body += chunk;
});
@mgregoro
mgregoro / openbsd_59_to_60_upgrade.pl
Created February 5, 2017 06:39
script for slurping down tarballs for openbsd upgrades.
#!/usr/bin/env perl
#
# Perl implementation of the guide at https://www.openbsd.org/faq/upgrade60.html
#
# Requires: Mojolicious
#
my $arch = "amd64";
my $rel = "6.0";
@mgregoro
mgregoro / ovpn.pl
Created February 5, 2017 06:53
convenience script for starting openvpn and update resolv.conf based on what was PUSHed by the server; handy on the *BSDs
#!/usr/bin/env perl
unless ($> == 0) {
die "Must run ovpn.pl as root!\n";
}
unless ($ARGV[0]) {
die "Usage: ovpn.pl <conf-file-in-cwd>\n";
}
index 54952fc..6d5d168 100644
--- a/libethash-cl/ethash_cl_miner_kernel.cl
+++ b/libethash-cl/ethash_cl_miner_kernel.cl
@@ -277,7 +277,7 @@ __kernel void ethash_search(
for (int i = 0; i < THREADS_PER_HASH; i++)
{
// share init with other threads
- if (i == thread_id)
+ if ((uint) i == thread_id)
copy(share[hash_id].ulongs, state, 8);
@mgregoro
mgregoro / dester.pl
Last active March 30, 2017 17:57
destination_url= based daisy chaining for wsu SSO
#!/usr/bin/env perl
use v5.10;
use Mojo::URL;
unless ($ARGV[0]) {
say "Usage: dester.pl <url1> <url2> <url3> <urlN>";
print <<"EOF";
You ever be like "man, I need to daisy chain a bunch of Mikey's crazy destination_url= based sso crap