Skip to content

Instantly share code, notes, and snippets.

Jonne Haß jhass

Block or report user

Report or block jhass

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 Feb 12, 2019
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 Aug 21, 2019 — forked from chitsaou/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.
@jhass
jhass / 1-Yubikey_session_lock.md
Last active Sep 10, 2019
Lock (Gnome) session when removing Yubico U2F key
View 1-Yubikey_session_lock.md

Setup

  1. Copy 99-u2f_lock_screen.rules to /etc/udev/rules.d.
  2. Copy gnome_lock_all_sessions to /usr/local/bin.
  3. Mark gnome_lock_all_sessions as executable: chmod +x /usr/local/bin/gnome_lock_all_sessions
  4. Reload udev: udevadm control -R
@jhass
jhass / .gitignore
Last active Jun 5, 2017
bxctl - Small helper to manage my boxcars configuration
View .gitignore
/.crystal/
/bxctl
/pkg/
/src/
*.tar.xz
You can’t perform that action at this time.