Skip to content

Instantly share code, notes, and snippets.

@Dirrk
Dirrk / plex-status.js
Last active June 21, 2023 23:09
Plex status.js
// jscs: disable
/*
Setup with crontab:
* * * * * /usr/bin/node /home/dirrk/scripts/plex-info/index.js >> /var/log/plex/plexstatus.log 2>/dev/null
Setup splunk to consume json with timestamp from utc on timestamp field
Example dashboard: http://imgur.com/E5jBA7S
*/
var wreck = require('wreck'),
@Dirrk
Dirrk / redis-install.sh
Created March 29, 2015 20:51
redis-install.sh
#!/bin/bash
VERSION=2.8.19
SERVICEDIR=/services/redis
INSTALLDIR=/opt/redis
REDISPASSWORD=hunter2
# Install
if [ ! -e $INSTALLDIR/redis-$VERSION ]; then
cd /tmp
wget http://download.redis.io/releases/redis-$VERSION.tar.gz
@Dirrk
Dirrk / vagrant-web
Created February 14, 2015 06:10
vagrant-web-dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
$home_env = true
Vagrant.configure(2) do |config|
config.vm.define "web" do |web|
web.vm.box = "centos-nginx-nodejs"
web.vm.box_check_update = false
# For gmtimonitor app in prod
user nobody;
worker_processes 1;
daemon off;
error_log /app/nginx/logs/error.log;
events {
worker_connections 1024;
@Dirrk
Dirrk / nginx-node-install.sh
Last active October 31, 2015 17:26
Install nginx and node
#!/bin/bash
# This installs nginx and node under /app
NODE_VERSION=4.2.1
if [ "$UID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ ! -e /usr/bin/gcc ] || [ ! -e /usr/bin/make ]; then
echo gcc or make not installed going to install dev tools in 5 seconds press ^C to exit
sleep 6
@Dirrk
Dirrk / node-ghost.sh
Last active August 29, 2015 14:04
Install ghost io
mkdir -p /opt/ghost/downloads
cd /opt/ghost/
mv /opt/ghost/*.zip /opt/ghost/downloads/
wget --no-check-certificate https://ghost.org/zip/ghost-latest.zip
unzip ghost-*.zip package.json
version=`cat package.json | grep "version" | cut -d: -f2 | tr -d ' ",'`
version=ghost-$version
if [ ! -e /opt/ghost/$version ]; then
@Dirrk
Dirrk / daemontools-centos.sh
Last active February 8, 2019 12:57
Install daemon tools to centos
#!/bin/bash
# Install daemon tools
if [ "$UID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ ! -e /usr/bin/gcc ] || [ ! -e /usr/bin/make ]; then
echo gcc or make not installed going to install dev tools in 5 seconds press ^C to exit
sleep 6
yum -y groupinstall 'Development Tools'
@Dirrk
Dirrk / nginx-config.sh
Last active August 29, 2015 14:04
setup nginx config and service folder for daemon tools
#!/bin/bash
# setup nginx config and service folder
if [ "$UID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Variables
nginxsdir=/services/nginx
@Dirrk
Dirrk / nginx.conf
Last active August 29, 2015 14:04
devbuild nginx.conf
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;