Skip to content

Instantly share code, notes, and snippets.

View benyanke's full-sized avatar

Ben Yanke benyanke

View GitHub Profile
@jakebellacera
jakebellacera / ICS.php
Last active March 11, 2024 05:12
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@oodavid
oodavid / README.md
Last active February 27, 2024 12:44 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@madx
madx / .gitconfig
Last active August 3, 2022 10:09
Git aliases for a simple tag based Heroku deploy strategy
[alias]
deploy = ! git checkout master && git tag-deploy && git push && git push --tags && git push production master
deploy-staging = ! git checkout develop && git tag-deploy staging && git push && git push --tags && git push staging develop:master
tag-deploy = ! sh -c 'git tag "${0:-production}-`date +%Y%m%d%H%M%S`-$USER"'
@tott
tott / ip_in_range.php
Created November 27, 2013 22:46
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active February 14, 2024 05:58
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@rupl
rupl / drupal-test.js
Last active November 18, 2017 23:24
This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/testing-drupal-casperjs
/**
* @file
* Testing a demo of Drupal. The script will log in and check for various
* features in Drupal core. This demo was inspired by a similar script for
* a Wordpress site. The original script was written by Henrique Vicente.
*
* @see https://github.com/henvic/phantom-casper-simple-talk/blob/master/wordpress.js
*/
// Set up variables to visit a URL and log in.
@brasey
brasey / Masterless Puppet using a Puppetfile.md
Created November 18, 2014 20:58
Masterless Puppet using a Puppetfile

Masterless Puppet using a Puppetfile

The problem

When running Puppet in masterless mode, meaning there is no Puppet Master for the node to connect to, one of the problems you have to solve is how to get all your Puppet modules onto the node. Without going into all the possible ways of doing this, one nice and clean way to solve the problem is to use a Puppetfile.

If you know what a Ruby gemfile is, you can guess what a Puppetfile is. If you don't, think of a very simple list declaring the modules that a node should get, including ways to get those modules. Like this:

forge 'forge.puppetlabs.com'