Skip to content

Instantly share code, notes, and snippets.

View tomfarm's full-sized avatar
🤯

Thomas Winkler tomfarm

🤯
View GitHub Profile
class ApplicationReflex < StimulusReflex::Reflex
before_reflex do
jwt = ShopifyApp::JWT.new(element.data_jwt) # pass in "Bearer: blah"
if jwt
self.headers = {"jwt.shopify_domain" => jwt.shopify_domain, "jwt.shopify_user_id" => jwt.shopify_user_id}
end
end
end
@bdha
bdha / gist:8628477
Last active October 13, 2016 18:06
Set up Graphite and Panoptimon on SmartOS

Install Graphite

pkgin up
pkgin in py27-graphite-web ap22-py27-wsgi

If pkgin says the package cannot be found, do this:

@jda
jda / stash.xml
Created July 17, 2013 21:03
SMF Manifest for Atlassian Stash on SmartOS
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='application/stash' type='service' version='0'>
<create_default_instance enabled='true'/>
<single_instance/>
<dependency name='network' grouping='require_all' restart_on='error' type='service'>
<service_fmri value='svc:/milestone/network:default'/>
</dependency>
<dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
@mikeyk
mikeyk / watch_wal-e.py
Created January 16, 2013 20:24
Watch_wal-e script
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
@jahewson
jahewson / smartos-on-a-budget.sh
Last active March 9, 2024 07:27
Installing and Configuring SmartOS on a budget server (with a /29)
# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date.
##################################################################
Installing and Configuring SmartOS on a budget server (with a /29)
##################################################################
# if you find this gist useful, please star it
# please be aware that budget hosting companies usually cut corners somewhere,
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('%23header,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push,%20.wiki-actions,%20%23last-edit,%20.actions,%20.header').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D);%20$('link').removeAttr('media');%7D);
@anl
anl / smartos-graphite.sh
Created December 10, 2012 04:44
Bootstrap Graphite on SmartOS
dataset=$(zfs list | grep data | awk '{print $1}')
sudo zfs set mountpoint=/data $dataset
sudo groupadd graphite
sudo useradd -c "Graphite User" -m -d /data/graphite -g graphite -s /bin/bash graphite
sudo pkgin up
sudo pkgin -y ug
sudo pkgin -y in gcc47
sudo pkgin -y in openldap-client
@mattconnolly
mattconnolly / rvm-smartos.patch
Created November 18, 2012 08:45
A patch for building ruby 1.9.3 in SmartOS / OpenIndiana
diff --git a/siphash.c b/siphash.c
index c100b14..589cdec 100644
--- a/siphash.c
+++ b/siphash.c
@@ -8,7 +8,11 @@
#ifdef _WIN32
#define BYTE_ORDER __LITTLE_ENDIAN
#elif !defined BYTE_ORDER
- #include <endian.h>
+ #if defined(sun)
@bharrisau
bharrisau / README
Created August 19, 2012 06:14
SMF Manifest to bring up IPv6 on SmartOS
Need to open /usbkey/config and add
admin_v6_ip=xx:xx:xx/xx
admin_v6_gateway=yy:yy:yy
place ipv6 in /opt/custom/smf
place ipv6.xml in /opt/custom/scripts
@mikhailov
mikhailov / deploy.rb
Created July 26, 2012 09:14
capistrano prettify
# standard capistrano config goes here....
# Put the maintenance screen if DB migrations take in place only
before "deploy", "deploy:delayed_job:stop"
before "deploy:migrations", "deploy:delayed_job:stop"
after "deploy:update_code", "deploy:symlink_shared", "deploy:assets_compress"
before "deploy:migrate", "deploy:web:disable", "deploy:db:backup"
after "deploy", "newrelic:notice_deployment", "deploy:cleanup", "deploy:delayed_job:restart"