Skip to content

Instantly share code, notes, and snippets.

View jh00nbr's full-sized avatar
🌎
Saiyajin in training living on Earth

Jhonathan Davi jh00nbr

🌎
Saiyajin in training living on Earth
View GitHub Profile
[Unit]
Description=AutoSSH tunnel Check
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -N -R 6000:localhost:22 user@monitoring.com
[Install]
WantedBy=multi-user.target
#Cloudflare ip addresses
# - IPv4
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
@jh00nbr
jh00nbr / check_version_libssh_auth_bypass.py
Created October 21, 2018 05:18
CVE-2018-10933 - libSSH Authentication Bypass Server Version Check
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: Jhonathan Davi @jh00nbr
# insightl4b.com
# github.com/jh00nbr
# Twitter: @jh00nbr
# CVE-2018-10933 - libSSH Authentication Bypass Server Version Check
# Reference: https://github.com/blacknbunny/libSSH-Authentication-Bypass/blob/master/checkversionofserver.py

Keybase proof

I hereby claim:

  • I am jh00nbr on github.
  • I am jh00nbr (https://keybase.io/jh00nbr) on keybase.
  • I have a public key ASCX7CWhk0rsyAb_W9nJAreibJvHOCcyEar5NBVog-2xoQo

To claim this, I am signing this object:

@jh00nbr
jh00nbr / mysql_backup.sh
Created March 17, 2018 13:14 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@jh00nbr
jh00nbr / custom-error-page
Last active November 30, 2017 23:25 — forked from simlegate/custom-error-page
Nginx return custom json
error_page 400 404 405 =200 @40*_json;
location @40*_json {
default_type application/json;
return 200 '{"code":"1", "message": "Not Found"}';
}
error_page 500 502 503 504 =200 @50*_json;
location @50*_json {
@jh00nbr
jh00nbr / somehost.conf
Created November 30, 2017 22:52 — forked from tomkersten/somehost.conf
Nginx config with CORS headers added globally (for application w/ Basic Auth)
upstream your-app {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/tmp/your_app.socket fail_timeout=0;
}
server {
listen 80;
@jh00nbr
jh00nbr / nameserver.py
Created November 24, 2017 17:55 — forked from roblayton/nameserver.py
Python Flask server for returning names from a MySQL DB
from flask import Flask
from flask import g
from flask import Response
from flask import request
import json
import MySQLdb
app = Flask(__name__)
@app.before_request
@jh00nbr
jh00nbr / gist:073c1a6ad3668348766853a6ad9adca1
Created November 11, 2017 15:22 — forked from dalethedeveloper/gist:1503252
Mobile Device Detection via User Agent RegEx

#Mobile Device Detection via User Agent RegEx

Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.

I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.

The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".

Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(