Skip to content

Instantly share code, notes, and snippets.

View jacksoncage's full-sized avatar
🏠
Working from home

Love Billingskog Nyberg jacksoncage

🏠
Working from home
View GitHub Profile
@bols-blue
bols-blue / jenkins-slave
Created November 23, 2011 09:45
jenkisn daemon sclipt./etc/init.d/jenkins-slave and /etc/default/jenkins-slave
# defaults for jenkins continuous integration server
JENKINS_ARGS="-jnlpUrl http://test.lnc.jp:8080/computer/wock/slave-agent.jnlp"
# jenkins home location
JENKINS_HOME=/opt/jenkins-slave
# location of the jenkins war file
JENKINS_WAR=$JENKINS_HOME/slave.jar
# pulled in from the init script; makes things easier.
NAME=jenkins
@whiteinge
whiteinge / process_status_updates.sls
Last active October 3, 2021 21:49
POC for writing status updates to a sqlite db. Updates are written using an Orchestrate file. The Orchestrate file can be called via the Reactor.
{# Place this file in /srv/reactor/process_status_updates.sls
Call via sending a custom event on a minion as:
salt-call event.send myco/external_task/status_update task=foo status='Update number one!'
Requires reactor config such as:
reactor:
- 'myco/external_task/status_update':
- /srv/reactor/process_status_updates.sls
@danriti
danriti / hipchat-v2.sh
Last active July 19, 2021 10:49
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
@jfrost
jfrost / gist:8798108
Created February 4, 2014 04:21
Basic Saltstack mine.get example
# This jinja template will demonstrate what grains are available from other nodes via salt's mine.get function
{% for host, data in salt['mine.get']('*', 'grains.items', expr_form = 'glob').items() -%}
{% for key, value in data.items() -%}
{{ host }} - {{ key }}: {{ value }}
{% endfor -%}
{% endfor -%}
@mikejolley
mikejolley / template-stock-report.php
Created December 5, 2011 20:18
WooCommerce - Stock Report. A template page snippet to (if you are logged in as admin) output a list of products/stock (which you are managing stock for) ready for printing.
<?php
/*
Template Name: Stock Report :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@mshmsh5000
mshmsh5000 / geoip-headers.vcl
Last active August 7, 2018 09:33
Fastly GeoIP header injection
# Request headers
sub vcl_recv {
set req.http.X-Fastly-Country-Code = geoip.country_code;
set req.http.X-Fastly-Country-Name = geoip.country_name;
set req.http.X-Fastly-City = geoip.city;
set req.http.X-Fastly-Latitude = geoip.latitude;
set req.http.X-Fastly-Longitude = geoip.longitude;
set req.http.X-Fastly-Region = geoip.region;
#FASTLY recv
@DTrejo
DTrejo / top3stories.js
Created January 21, 2011 22:41
Gets top three articles from frontpage and newpage of Hacker News. Blog post on scraping: http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
@djonsson
djonsson / darcula.css
Created September 5, 2013 16:08
Darcula theme for jsonview (google chrome plugin)
body {
white-space: pre;
font-family: monospace;
background: #393939;
color: #b5c4d0;
}
.property {
}