This file contains hidden or 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
sub rw { my $word = "$_[0]"; $word =~ s/(.)/rc($1)/ge; $word;} | |
sub rc { return ((rand(1)*2+1)%2) ? lc($_[0]): uc($_[0]); } |
This file contains hidden or 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
set :repo_url, "ssh://git@localhost:9000/#{fetch(:application)}.git" | |
module SSHKit; module Backend | |
class Netssh < Printer | |
alias_method :orig_ssh, :ssh | |
def ssh | |
ret = orig_ssh | |
@@created_remote ||= ret.forward.remote(22, 'gitserver', 9000) | |
return ret | |
end |
This file contains hidden or 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
require 'net/ssh' | |
#set :ssh_options, :verbose => :debug | |
set :user, 'labuser' | |
set :repo_url, "ssh://eti@localhost:9000/#{fetch(:application)}.git" | |
$gateway_ssh = {} | |
namespace :ssh do | |
task :git_start do | |
on roles(:all) do | |
hostname = host.hostname.to_s |
This file contains hidden or 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
import grails.converters.JSON | |
// Automatically generated. Make future change here. | |
definition( | |
name: "gavin_test_pushes", | |
namespace: "gavin", | |
author: "Gavin", | |
description: "Description goes here", | |
category: "Fun & Social", |
This file contains hidden or 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
# cat /etc/nginx/conf.d/cloudflare.conf | |
# sh cloudflare_ips_nginx.sh > /etc/nginx/conf.d/cloudflare.conf && service nginx configtest && service nginx reload | |
echo "# Cloudflare" | |
for ip in $(curl -s https://www.cloudflare.com/ips-v4); do | |
echo "set_real_ip_from $ip;" | |
done | |
for ip in $(curl -s https://www.cloudflare.com/ips-v6); do | |
echo "set_real_ip_from $ip;" | |
done |
This file contains hidden or 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
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Moq; | |
namespace UnitTestStatic | |
{ | |
public class Utilities : IUtilities | |
{ | |
private static IUtilities _instance = new Utilities(); | |
private Utilities() { } |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# | |
# check-supervisor-socket | |
# | |
# | |
# DESCRIPTION: | |
# Check that all supervisor processes are running using its UNIX domain socket. See unix_http_server section in | |
# http://supervisord.org/configuration.html. | |
# | |
# OUTPUT: |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" |
This file contains hidden or 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
source 'https://rubygems.org' | |
gem 'youtube_it', '2.4.0' |
This file contains hidden or 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
# parses strings such as: 07-31 09:56:08 | |
DATESTAMP_CP [0-9]{2}-[0-9]{2} %{TIME} | |
# parses strings such as: '\u001b\[0m' or '^[[0m' or '\e[0m' | |
METACHAR_CP ((\\u001b|\^\[|\e)\[\d+m)? | |
# assigns regular expression that matches Java classes to a new variable name. | |
FACILITY_CP %{JAVACLASS} |