Skip to content

Instantly share code, notes, and snippets.

Avatar
👀

Jonne Haß jhass

👀
View GitHub Profile
@jhass
jhass / gh-pr-status.rb
Last active Jun 20, 2020
Little script to list your pull requests and whether you need to take action on them
View gh-pr-status.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "octokit"
gem "terminal-table"
@jhass
jhass / README.md
Last active May 14, 2020
Crystal shim to redirect malloc & pthread to bdwgc (depends on glibc and https://github.com/jhass/crystal/tree/function_pointer_fixes)
@jhass
jhass / .ssh_authorized_keys
Last active May 17, 2019
Git shell only for specific SSH key
View .ssh_authorized_keys
command="/home/USER/.ssh/git-shell",no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa YOUR_KEY foo
@jhass
jhass / hockeyapp_updater.rb
Last active Jun 9, 2017
Update all connected devices and running emulators with the latest version of your app(s) from HockeyApp (install Ruby & bundler first)
View hockeyapp_updater.rb
#!/usr/bin/ruby
require "bundler/inline"
gemfile(ARGV.any? {|arg| arg == "--install"}) do
source "https://rubygems.org"
gem "http", "~> 2.2"
gem "ADB", "~> 0.5.6"
gem "slop", "~> 4.5"
end
@jhass
jhass / injecting_io.cr
Last active Mar 30, 2017
Crystal injecting/replacing IO PoC
View injecting_io.cr
struct Slice(T)
def []?(start, count)
if start + count >= size
count = -1
end
if count < 0
count = size - start + (count + 1)
end
@jhass
jhass / barcode.html
Last active Nov 4, 2020
Simple Barcode generator
View barcode.html
<!DOCTYPE html>
<html>
<head>
<title>Barcode generator</title>
<script src="https://cdn.jsdelivr.net/jsbarcode/3.5.8/JsBarcode.all.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script type="text/javascript">
window.eanHistory = [];
function loadHistory() {
@jhass
jhass / README.md
Last active Nov 19, 2020 — forked from yorkxin/README.md
Proxy to remote server with CORS support
View README.md

cors.py for mitmproxy

Hacking CORS restriction to enable in-browser XHR to any server.

Usage

Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.

Run:

@jhass
jhass / server.cr
Created Jul 22, 2016
Simple debug HTTP server in Crystal
View server.cr
require "option_parser"
require "http/server"
require "json"
class Settings
property port = 3000
property host = "127.0.0.1"
property? show_headers = false
property? show_raw_json = false
end
@jhass
jhass / archlinux.sh
Created Nov 18, 2015
VMM (http://vmm.localdomain.org/) DKIM configuration (only relevant parts shown)
View archlinux.sh
sudo pacman -S opendkim
sudo cp /etc/opendkim/opendkim.conf{.sample,}
sudo mkdir /var/lib/dkim
sudo chown opendkim:mail /etc/opendkim/opendkim.conf /var/lib/dkim
sudo chmod 700 /var/lib/dkim
sudo chgrp mail /var/spool/postfix/private
sudo -u opendkim opendkim-genkey -D /var/lib/dkim -b 2048 -s mail
sudo usermod -a -G mail postfix
@jhass
jhass / 1-README.md
Last active Nov 5, 2015
ix.io helper function
View 1-README.md
  1. Add to your .${SHELL}rc.
  2. Replace user and password.
  3. Create cat foo | ixio.
  4. Update cat foo | ixio abc.
  5. View your pastes at ix.io/user/your_username.
You can’t perform that action at this time.