Skip to content

Instantly share code, notes, and snippets.

View bborysenko's full-sized avatar

Borys Borysenko bborysenko

View GitHub Profile
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
<!doctype html>
<html>
<head>
<meta charset=utf-8">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
<style>
body {
background:#ffffff;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 16px;
color: #444;
line-height: 24px;
max-width: 800px;
padding: 0 20px;
margin: 20px auto 100px;
text-align: justify;
#!/bin/sh
# You can edit these variables
version="4.0"
nodotversion="40"
lastpatch="41"
# You probably don't want to edit anything below this line

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
#!/bin/bash
#
# Copyright (C) 2014 by Red Hat
host=${1:-127.0.0.1}
port=${2:-443}
timeout_bin=`which timeout 2>/dev/null`
echo -n "$host:$port - "
@bborysenko
bborysenko / ghosttest.c
Created January 29, 2015 22:08
GHOST vulnerability check
/* ghosttest.c: GHOST vulnerability tester */
/* Credit: http://www.openwall.com/lists/oss-security/2015/01/27/9 */
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@bborysenko
bborysenko / fs-download.sh
Created March 20, 2015 12:55
A simple bash script to download files from fs.to
#!/usr/bin/env bash
list=$1
DOWNLOAD=${1%%.*}
dos2unix $list
test -e $DOWNLOAD || mkdir -p $DOWNLOAD
while read url; do
wget -P ${DOWNLOAD} ${url}
# The Roots theme by default does not check production assets into Git, so
# they are not deployed by Capistrano when using the Bedrock stack. The
# following will compile and deploy those assets. Copy this to the bottom of
# your config/deploy.rb file.
# Based on information from this thread:
# http://discourse.roots.io/t/capistrano-run-grunt-locally-and-upload-files/2062/7
# and specifically this gist from christhesoul:
# https://gist.github.com/christhesoul/3c38053971a7b786eff2