Skip to content

Instantly share code, notes, and snippets.

View slimm609's full-sized avatar

Brian Davis slimm609

View GitHub Profile
@slimm609
slimm609 / perf.csv
Last active June 25, 2023 20:08
Perf test results
Name Req/sec Throughput
Go net/http 159k 32.31MB/s
Rust Hyper 172k 35.06MB/s
Rust TCP 16k 5.52MB/s
Go Fasthttp 215k 42.77MB/s
Go Fasthttp w/ reuseport 227k 46.30MB/s
@slimm609
slimm609 / Installation.md
Created August 4, 2019 22:37 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@slimm609
slimm609 / jail.local
Created December 22, 2015 16:48 — forked from Nihisil/jail.local
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...

Keybase proof

I hereby claim:

  • I am slimm609 on github.
  • I am slimm609 (https://keybase.io/slimm609) on keybase.
  • I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); }

To claim this, I am signing this object:

@slimm609
slimm609 / teampass-pseudorandom.patch
Created April 22, 2013 14:50
teampass-pseudorandom.patch
diff -upr TeamPass2/sources/main.functions.php TeamPass/sources/main.functions.php
--- TeamPass2/sources/main.functions.php 2013-04-22 10:46:26.746643301 -0400
+++ TeamPass/sources/main.functions.php 2013-04-22 10:45:36.464643449 -0400
@@ -156,11 +156,14 @@ function decrypt($encrypted, $personal_s
*/
function bCrypt($password, $cost)
{
- $chars='./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$salt = sprintf('$2y$%02d$', $cost);
+ if (function_exists('openssl_random_pseudo_bytes')){
diff -upr TeamPass2/admin.settings.php TeamPass/admin.settings.php
--- TeamPass2/admin.settings.php 2013-01-27 21:23:59.463507675 -0500
+++ TeamPass/admin.settings.php 2013-01-28 09:11:54.366082082 -0500
@@ -200,6 +200,10 @@ if (isset($_POST['save_button'])) {
if (@$_SESSION['settings']['maintenance_mode'] != $_POST['maintenance_mode']) {
updateSettings('maintenance_mode', $_POST['maintenance_mode']);
}
+ // Update sts mode
+ if ( @$_SESSION['settings']['enable_sts'] != $_POST['enable_sts'] ) {
+ updateSettings( 'enable_sts', $_POST['enable_sts'] );
@slimm609
slimm609 / ssl-sts-bcrypt_rollup.patch
Last active December 11, 2015 20:29
rollup of previous patches.
diff -upr TeamPass2/admin.settings.php TeamPass/admin.settings.php
--- TeamPass2/admin.settings.php 2013-01-27 21:23:59.463507675 -0500
+++ TeamPass/admin.settings.php 2013-01-28 09:11:54.366082082 -0500
@@ -200,6 +200,10 @@ if (isset($_POST['save_button'])) {
if (@$_SESSION['settings']['maintenance_mode'] != $_POST['maintenance_mode']) {
updateSettings('maintenance_mode', $_POST['maintenance_mode']);
}
+ // Update sts mode
+ if ( @$_SESSION['settings']['enable_sts'] != $_POST['enable_sts'] ) {
+ updateSettings( 'enable_sts', $_POST['enable_sts'] );
@slimm609
slimm609 / teampass-ssl.patch
Created January 28, 2013 05:32
enforce ssl in teampass
diff -upr TeamPass2/sources/core.php TeamPass/sources/core.php
--- TeamPass2/sources/core.php 2013-01-27 21:23:59.469507708 -0500
+++ TeamPass/sources/core.php 2013-01-28 00:27:08.538069424 -0500
@@ -17,6 +17,27 @@ if (!isset($_SESSION['CPM']) || $_SESSIO
die('Hacking attempt...');
}
+function redirect($url){
+ if (!headers_sent()){ //If headers not sent yet... then do php redirect
+ header('Location: '.$url);
@slimm609
slimm609 / teampass-bcrypt.patch
Last active December 11, 2015 20:08
bcrypt patch for teampass
diff -upr TeamPass2/install/install_ajax.php TeamPass/install/install_ajax.php
--- TeamPass2/install/install_ajax.php 2013-01-27 21:23:59.466507730 -0500
+++ TeamPass/install/install_ajax.php 2013-01-27 22:43:55.222757602 -0500
@@ -288,7 +288,7 @@ if (isset($_POST['type'])) {
"CREATE TABLE IF NOT EXISTS `".$_SESSION['tbl_prefix']."users` (
`id` int(12) NOT null AUTO_INCREMENT,
`login` varchar(50) NOT NULL,
- `pw` varchar(50) NOT NULL,
+ `pw` varchar(200) NOT NULL,
`groupes_visibles` varchar(250) NOT NULL,