Skip to content

Instantly share code, notes, and snippets.

View coderjun's full-sized avatar

Jun Heider coderjun

View GitHub Profile
@jpetazzo
jpetazzo / Sample result.txt
Created August 17, 2011 22:13
Compare the available nginx versions and their modules (according to debian packages descriptions)
nginx-full nginx-extras nginx-light
Access YES YES YES
Addition File AIO Mail Core - YES -
Addition Mail Core YES - -
Auth Basic YES YES YES
Auto Index YES YES YES
Browser YES YES -
Charset YES YES YES
Echo YES YES -
Embedded Lua - YES -
@rogthefrog
rogthefrog / fms_check.rb
Created June 7, 2012 20:02
Nagios plugin for Flash Media Server monitoring
#!/usr/bin/ruby
# nagios plugin for Flash Media Server monitoring
# roger 2012-06-04
require 'rubygems'
require 'open-uri'
require 'optparse'
require 'ostruct'
require 'set'
require 'xmlsimple'
@igorescobar
igorescobar / default.vcl
Created November 13, 2012 12:24
Varnish Grace Mode
# /etc/varnish/default.vcl
# Define the list of backends (web servers).
# Port 80 Backend Servers
backend yourapp_webserver1 {
.host = "000.000.000.000";
.port = "80";
.max_connections = 250;
.connect_timeout = 5s;
.first_byte_timeout = 5s;
.between_bytes_timeout = 5s;
@ccooper21
ccooper21 / amazon-linux-omnibus.erb
Last active December 10, 2015 13:09
This is a Chef bootstrap script for bootstrapping the Chef client on an Amazon Linux AMI instance. It has been tested with Amazon Linux v2012.09 (AMI ID ami-1624987f). See the first comment below for the detailed background.
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
exists() {
if command -v $1 &>/dev/null
then
return 0
else
return 1
@aderowbotham
aderowbotham / purge-ban-domain-varnish.md
Last active May 24, 2022 19:55
Purge (ban) an entire domain in Varnish Cache 3

How to purge ('ban') an entire domain in Varnish Cache 3

#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.

Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.


@pjdietz
pjdietz / Android Multiple Density Export.jsx
Created May 14, 2013 20:11
Photoshop JavaScript to automate exporting Android resources at multiple densities using the 3:4:6:8:12 scaling ratio.
/*global alert, app, prompt, ExportOptionsSaveForWeb, ExportType, File, Folder, ResampleMethod, SaveDocumentType, SaveOptions */
///////////////////////////////////////////////////////////////////////////////
// Android Multiple Density Export.jsx
//
// Photoshop JavaScript to automate exporting Android resources at multiple
// densities using the 3:4:6:8:12 scaling ratio.
//
//
// Installation:
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@initcron
initcron / redo_knide_node
Last active August 29, 2015 13:57
How to redo the node
0. Remove client and node from chef server's registry. Run thi from Workstation
{ws}$ knife client delete node1
{ws}$ knife node delete node1
1. Login to node
{node}$ ssh vagrant@192.168.33.11
2. Browse to /etc/chef on node, and delete everything under it
{node}$ rm -rf /etc/chef/*
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@ankitmundada
ankitmundada / download_gdrive
Last active April 17, 2022 23:11
Shell Script to download Publicly shared Google drive files
#!/bin/bash
# Get files from Google Drive
# Source: https://stackoverflow.com/a/50573452/2382312
# Usage: download_gdrive FILE_ID DESTINATION_PATH
# $1 = file ID
# $2 = file name
URL="https://drive.google.com/uc?export=download&id=$1"