Skip to content

Instantly share code, notes, and snippets.

View tristan-k's full-sized avatar

ʞ-uɐʇsıɹʇ tristan-k

View GitHub Profile
local jid_bare = require "util.jid".bare;
local jid_split = require "util.jid".split;
local os_time = os.time;
local t_concat = table.concat;
local smtp = require "socket.smtp";
local vcards = module:open_store("vcard");
local smtp_server = module:get_option_string("smtp_server", "localhost");
local smtp_user = module:get_option_string("smtp_username");
local smtp_pass = module:get_option_string("smtp_password");
local smtp_daemon = module:get_option_string("smtp_daemon");
@streeter
streeter / brew-update-notifier.sh
Last active November 18, 2015 17:21
Homebrew Package Update Notifications via Growl
#!/bin/bash
#
# Notify of Homebrew updates via Growl on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: Growl Notify Extra to be installed. Install with
# brew install growlnotify
TERM_APP='/Applications/Terminal.app'
@elmodaddyb
elmodaddyb / gerbera.io.plist
Created May 29, 2017 01:58
Gerbera OSX Launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>gerbera.io</string>
<key>ProgramArguments</key>
<array>
@steventroughtonsmith
steventroughtonsmith / Tweak.xm
Created October 14, 2015 06:33
iOS 9 Enable Splitscreen Jailbreak Tweak (Theos)
/* How to Hook with Logos
Hooks are written with syntax similar to that of an Objective-C @implementation.
You don't need to #include <substrate.h>, it will be done automatically, as will
the generation of a class list and an automatic constructor.
%hook ClassName
// Hooking a class method
+ (id)sharedInstance {
@tonyseek
tonyseek / brew-cask-upgrade
Last active November 1, 2017 02:49
Upgrade all casks
#!/usr/bin/env bash
set -e
STAGING_LOCATION="$(brew cask doctor \
| grep -A1 '==> Homebrew-cask Staging Location:' | tail -n1 \
| awk '{print $1}')"
echo "==> Upgrading casks"
for cask in $(ls ${STAGING_LOCATION})
@eyecatchup
eyecatchup / huawei-ascend-y300-firmware.md
Last active December 10, 2017 14:50
Huawei Ascend Y300 - Official Firmware Image B209

B209 firmware update for Huawei Ascend Y300

B209 was a regional firmware update for Germany & other European countries, officially released by Huawei in July 2014.

It fixed the dangerous Heartbleed bug and brought some other minor optimizations (e.g. improved RAM- and battery usage).

It's official package name is Y300-0100 V100R001C00B209_Firmware_West European_Channel-Others_Android 4.1_EMUI 1.0_05011KYP.

Download

@ntmggr
ntmggr / Run_Tunnelblick_from_MacOS_cli.md
Created December 30, 2015 09:33
Run Tunnelblick from MacOS cli

TunnelBlick from MacOS cli

Create the the OSA script and save it with .scpt extension

tell application "Tunnelblick"
    connect "Your_existing_Tunneblick_vpn_name"
    get state of first configuration where name = "Your_existing_Tunneblick_vpn_name"
    repeat until result = "CONNECTED"
        delay 1
        get state of first configuration where name = "Your_existing_Tunneblick_vpn_name"
 end repeat
@cwoodall
cwoodall / make_gif.sh
Created December 24, 2016 03:12
A little script for generating compressed gifs using ffmpeg from a video file (webm, or mp4)
#!/bin/bash
ORIG_DIR=`pwd`
FRAME_DIR="/tmp/gif-frames"
LOSSY=80
FPS=5
LOOP=0
SCALE=.5
COLORS=128
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
@kode54
kode54 / pci_dev_reset.patch
Last active July 26, 2020 17:43
Linux 5.x PCI device detach/attach reset fix for AMD, possibly others; mirrored from https://clbin.com/VCiYJ; see: https://forum.level1techs.com/t/encountering-the-amd-reset-bug-any-fixes-rx-590/143850 - note, I did not author this patch
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 766f5779db92..dc19079dad1b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -52,6 +52,9 @@ unsigned int pci_pm_d3_delay;
static void pci_pme_list_scan(struct work_struct *work);
+static void pci_dev_save_and_disable(struct pci_dev *dev);
+static void pci_dev_restore(struct pci_dev *dev);