Skip to content

Instantly share code, notes, and snippets.

@steamraven
steamraven / app.py
Last active May 19, 2023 17:58
Table Creator for StageTop
"""
MIT License
Copyright (c) 2023 Matthew Hawn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@steamraven
steamraven / pubsub_test.go
Created February 13, 2023 17:43
Simple go file to test pubsub over relay
package main
import (
"context"
"flag"
"fmt"
"math/rand"
"sync"
"time"
@steamraven
steamraven / freerad.py.diff
Last active August 29, 2015 13:57
freerad admin password mask
--- yubiadmin/apps/freerad.py 2014-03-04 16:36:11.468515179 -0700
+++ ~/freerad.py 2014-03-04 16:39:01.224515159 -0700
@@ -31,7 +31,7 @@
from yubiadmin.util.config import parse_block
from yubiadmin.apps.dashboard import panel
from wtforms import Form
-from wtforms.fields import TextField
+from wtforms.fields import TextField,PasswordField
import os
import re
@steamraven
steamraven / gist:6627025
Created September 19, 2013 17:39
record_one_backref
Sep 19 11:36:47 it-dba kernel: [ 1668.612148] WARNING: CPU: 3 PID: 8065 at /home/matthewh/no-snap/btrfs/ubuntu-precise/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420 [btrfs]()
Sep 19 11:36:47 it-dba kernel: raid6_pq async_tx ptp ahci pps_core libahci raid1 raid0 multipath linear
Sep 19 11:36:47 it-dba kernel: [ 1668.612181] Hardware name: Dell Inc. OptiPlex 790/0HY9JP, BIOS A17 03/14/2013
Sep 19 11:36:47 it-dba kernel: [ 1668.612185] 0000000000000000 ffff88039e3e1a98 ffffffff8106534c ffff88039e3e1a78
Sep 19 11:36:47 it-dba kernel: [ 1668.612190] Call Trace:
Sep 19 11:36:47 it-dba kernel: [ 1668.612197] [<ffffffff8106534c>] warn_slowpath_common+0x8c/0xc0
Sep 19 11:36:47 it-dba kernel: [ 1668.612210] [<ffffffffa01377c9>] record_one_backref+0x3a9/0x420 [btrfs]
Sep 19 11:36:47 it-dba kernel: [ 1668.612233] [<ffffffffa018a3f2>] iterate_leaf_refs+0x52/0xc0 [btrfs]
Sep 19 11:36:47 it-dba kernel: [ 1668.612255] [<ffffffffa018ce58>] iterate_extent_inodes+0x198/0x270 [btrfs]
Sep 19 11:36:47 it-dba kernel: [
@steamraven
steamraven / diff
Created January 29, 2012 04:21
m2wsgi gevent patch
diff -r lib/python2.7/site-packages/m2wsgi//io/gevent.py mongrel2/m2wsgi/m2wsgi//io/gevent.py
83,87c83
<
< def __init__(self, *args, **kwargs):
< super(_Socket,self).__init__(*args,**kwargs)
< self._polled_recv = None
<
---
> _polled_recv = None
@steamraven
steamraven / email.php.diff
Created June 15, 2011 17:59
FileZ: Internationalization of standalone file email form
diff --git a/app/views/file/email.php b/app/views/file/email.php
index a4c6396..b5a162d 100644
--- a/app/views/file/email.php
+++ b/app/views/file/email.php
@@ -1,4 +1,4 @@
-<h2>Envoyer le fichier par email <span class="filename">(<?php echo h($file->file_name) ?>)</span></h2>
+<h2><?php echo __("Send via email:") ?> <span class="filename">(<?php echo h($file->file_name) ?>)</span></h2>
<?php echo partial ('file/_mailForm.php', array ('file' => $file)) ?>
@steamraven
steamraven / file_log.sql
Created June 7, 2011 15:52
Filez file logging schema
CREATE TABLE "fz_file_log"
(
"id" serial NOT NULL,
"file_id" numeric(20,0) NOT NULL,
"logged_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ip" inet NOT NULL,
"log_type" character varying NOT NULL,
"uid" character varying,
"guest_id" numeric(20,0),
@steamraven
steamraven / file_log.diff
Created June 7, 2011 15:31
FileZ file logging
76c5
Author: matthewh <matthewh@donaanacounty.org>
Date: Mon Jun 6 16:15:46 2011 -0600
Add File Logging
diff --git a/app/controllers/File.php b/app/controllers/File.php
index 6663520..0b2375e 100644
--- a/app/controllers/File.php
+++ b/app/controllers/File.php
@steamraven
steamraven / filez.js.diff
Created June 6, 2011 15:17
FileZ: Share button after upload
diff --git a/resources/js/filez.js b/resources/js/filez.js
index f0de9db..7ec38eb 100755
--- a/resources/js/filez.js
+++ b/resources/js/filez.js
@@ -330,6 +330,8 @@ var appendFile = function (html) {
'<li class="file '+cssClass+'" style="display: none;">'+html+'</li>'
);
files.children ('li:first').slideDown (500);
+ files = $(settings.fileList);
+ files.children ('li:first').initFileActions();
@steamraven
steamraven / file-mime.diff
Created June 6, 2011 15:06
FileZ downlaod mime type patch
diff --git a/app/controllers/File.php b/app/controllers/File.php
index 5f8e311..ef57650 100644
--- a/app/controllers/File.php
+++ b/app/controllers/File.php
@@ -254,7 +254,7 @@ class App_Controller_File extends Fz_Controller {
* @param App_Model_File $file File to send
*/
protected function sendFile (App_Model_File $file, $forceDownload = true) {
- $mime = file_mime_content_type ($file->getFileName ());
+ $mime = $file->getMimetype();