Skip to content

Instantly share code, notes, and snippets.

@brunovianarezende
brunovianarezende / ng-really.js
Last active February 11, 2018 13:35 — forked from asafge/ng-really.js
ng-confirm - An AngularJS directive that creates a confirmation dialog for an action. Forked from https://gist.github.com/asafge/7430497
/**
* A generic confirmation for risky actions.
* Usage: Add attributes:
* * ng-confirm-message="Are you sure?"
* * ng-confirm-click="takeAction()" function
* * ng-confirm-condition="mustBeEvaluatedToTrueForTheConfirmBoxBeShown" expression
*/
angular.module('app').directive('ngConfirmClick', [function() {
return {
restrict: 'A',
@blacktwin
blacktwin / create_wait_kill.py
Last active December 19, 2018 03:08
Receive transcode key from PlexPy when paused. Send key to sub-script to wait for X time then check if still paused. If paused kill.
'''
kill_transcode function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: create_wait_kill.py
PlexPy > Settings > Notifications > Script > Script Arguments:
{transcode_key}
@stevejenkins
stevejenkins / EdgeMax-Google.sh
Last active November 15, 2019 17:05
IPv4/IPv6 setup script for EdgeMax EdgeOS v1.9 routers to replace the Google Fiber Network Box
# EdgeOS v1.9 Google Fiber Config Script
# by Steve Jenkins (http://www.stevejenkins.com/)
# Last updated: Aug 14, 2016
# Based on settings & scripts by Atlantisman, TK, and CompTech
# RUN THIS SCRIPT AS ROOT ON YOUR EDGEROUTER
# Script runs best if you copy and paste in sections
#______________________Basic Firewall Setup_______________________________
configure
@shadone
shadone / speedtest_tester.sh
Created February 6, 2016 23:03
Send speedtest.net results to influxdb
#!/bin/bash
INFLUXDB_HOST="localhost"
INFLUXDB_PORT="8086"
DATABASE="home"
[ -f /etc/default/speedtest_tester ] && . /etc/default/speedtest_tester
while [[ $# > 0 ]]; do
key="$1"
@fwenzel
fwenzel / plex_restart.sh
Created April 26, 2012 03:17
Simple watchdog script to restart plex media server if it becomes unresponsive.
#!/bin/bash
# If plex is not running, don't do anything.
plex_running=`ps ax | grep "\./Plex Media Server" | awk '{ print $1 }' | wc -l`
if [ "$plex_running" -eq 1 ]; then
exit 0
fi
# Test Plex web interface. If it's dead, this'll time out in a few seconds.
curl -I -m 8 "http://localhost:32400/library/sections" > /dev/null 2>&1
@kwilczynski
kwilczynski / gist:36914ee29e31f7dbd27b4f6742dc96b3
Last active September 29, 2020 09:13
Amazon Elastic Network Adapter (ENA) on CentOS 6
yum -y install patch dkms kernel-devel
wget https://github.com/amzn/amzn-drivers/archive/ena_linux_1.1.3.tar.gz
tar zxvf ena_linux_1.1.3.tar.gz -C /usr/src/
mv /usr/src/amzn-drivers-ena_linux_1.1.3 /usr/src/ena-1.1.3
cat <<EOF > /usr/src/ena-1.1.3/dkms.conf
PACKAGE_NAME="ena"
PACKAGE_VERSION="1.1.3"
AUTOINSTALL="yes"
@blockloop
blockloop / docker-compose.yaml
Last active April 23, 2022 02:41
Thanos Receive example with docker-compose
version: "3"
networks:
default:
driver: bridge
ipam:
config:
- subnet: 172.16.57.0/24
services:
@Ray33
Ray33 / gist:ba189a729d81babc99d7cef0fb6fbcd8
Last active July 22, 2022 10:50 — forked from SamCyanide/gist:780afff4c3e1a9e105264c2a476e037c
Amazon Elastic Network Adapter (ENA) on CentOS 7
sudo su
yum --enablerepo=extras install epel-release
yum -y install patch dkms kernel-devel perl
yum update
#Required for kernel num 5:
yum --enablerepo=elrepo-kernel -y install kernel-ml-devel
reboot
@silas
silas / build.gradle
Last active March 1, 2023 07:35
Load `.env` into gradle run
def static getenv(path = ".env") {
def env = [:]
def file = new File(path)
if (file.exists()) {
file.eachLine { line ->
line = line.trim()
if (line != "" && !line.startsWith("#")) {
def pair = line.split("=", 2)
env[pair[0].trim()] = pair.length == 2 ? pair[1].trim() : ""
version: '3'
services:
plex:
image: plexinc/pms-docker:beta
container_name: plex
restart: always
network_mode: host
volumes:
- $PWD/plex/config:/config