This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
/** | |
* pingdom.php | |
* | |
* This application will check your server swap, hard drive, cpu, and MySQL conditions. | |
* It will then generate an appropriate XML file for a Pingdom HTTP Custom check. | |
* | |
* If any usage is above your preset thresholds, then a down message will be returned, | |
* indicating that your server may be under more load than usual, hopefully, providing | |
* a bit of advanced notice before a true failure due to lack of resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var os = require("os"); | |
//Create function to get CPU information | |
function cpuAverage() { | |
//Initialise sum of idle and time of cores and fetch CPU info | |
var totalIdle = 0, totalTick = 0; | |
var cpus = os.cpus(); | |
//Loop through CPU cores |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Modified from http://www.shellhacks.com/en/Check-a-Website-Response-Time-from-the-Linux-Command-Line | |
curl -s -w '\nLookup:\t%{time_namelookup}\nConnect:\t%{time_connect}\nApp Connect:\t%{time_appconnect}\nRedirect:\t%{time_redirect}\nPretransfer:\t%{time_pretransfer}\nStarttransfer:\t%{time_starttransfer}\n\nTotal:\t%{time_total}\n' -o /dev/null {$1}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js | |
//code.jquery.com/jquery.min.js | |
//getbootstrap.com/dist/js/bootstrap.js | |
//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Credit: http://stackoverflow.com/questions/22196587/how-to-center-align-vertically-the-container-in-bootstrap --> | |
<title>Bootstrap Centered Jumbotron</title> | |
<meta charset="utf-8" /> | |
<link type="text/css" rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css" /> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -o /usr/local/bin/prettyjson https://gist.githubusercontent.com/ryanlelek/78fc643886628e454a56/raw/12380b8ab13b9c23e1c34c9fe996c01e40b2eccb/prettyjson.py; chmod +x /usr/local/bin/prettyjson; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"auto_complete": false, | |
"auto_match_enabled": false, | |
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme", | |
"draw_white_space": "all", | |
"font_size": 21, | |
"highlight_modified_tabs": true, | |
"line_numbers": true, | |
"open_files_in_new_window": false, | |
"preview_on_click": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Modules | |
var request = require('request'); | |
// Variables | |
var settings = { | |
host : 'http://localhost:8443', | |
version : 'v0', | |
verifySSL : false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// I'd strongly recommend not using Socket.io rooms | |
// This will make it more difficult to switch to another | |
// WebSocket library that may not support rooms (SockJS?) | |
// You can use Redis or another data store to create rooms and add/remove users | |
// But, here it is for historical and educational purposes | |
// Socket.IO v0.7 now gives you one Socket per namespace you define: |