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 | |
set -euxo pipefail | |
dnf install -y fail2ban | |
systemctl enable fail2ban | |
cat > /etc/fail2ban/jail.local<< EOF | |
[DEFAULT] | |
# Ban hosts for one hour: |
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 | |
set -euxo pipefail | |
if [ -f "/etc/yum.repos.d/CentOS-Linux-BaseOS.repo" ]; then | |
sed -i 's/baseurl/#baseurl/' /etc/yum.repos.d/CentOS-Linux-BaseOS.repo | |
echo "baseurl=http://vault.centos.org/\$contentdir/\$releasever/BaseOS/\$basearch/os/" >> /etc/yum.repos.d/CentOS-Linux-BaseOS.repo | |
fi | |
if [ -f "/etc/yum.repos.d/CentOS-Base.repo" ]; then | |
sed -i 's/baseurl/#baseurl/' /etc/yum.repos.d/CentOS-Base.repo | |
echo "baseurl=http://vault.centos.org/\$contentdir/\$releasever/BaseOS/\$basearch/os/" >> /etc/yum.repos.d/CentOS-Base.repo |
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
{ | |
"version": "4.0.0", | |
"gauges": { | |
"io.dropwizard.jetty.MutableServletContextHandler.percent-4xx-15m": { | |
"value": 0.007024159313128319 | |
}, | |
"io.dropwizard.jetty.MutableServletContextHandler.percent-4xx-1m": { | |
"value": 0.7550973761653571 | |
}, | |
"io.dropwizard.jetty.MutableServletContextHandler.percent-4xx-5m": { |
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
using UnityEngine; | |
// Usage: add to a light, specify 6-10 intervals. For a rapidly flickering light, use very short | |
// intervals (e.g. 0.01 - 0.3); for a horror-esque feel, use a combination of long and short intervals, | |
// e.g. [2.1, 0.1, 0.1, 0.2, 0.1, 0.2] for a light that flickers every 2-ish seconds. | |
public class LightFlicker : MonoBehaviour | |
{ | |
public float[] intervals = new float[1]; | |
private Light light; | |
private float elapsed = 0f; |
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
license: csl |
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
#!/usr/bin/env ruby | |
# A Ruby function to compute the difference in minutes between two | |
# RFC2822-formatted dates. Tested on Ruby 1.8.7 | |
# | |
# Note: this feels a bit cheeky, since Ruby's standard library has excellent | |
# support for timestamp conversions; this is basically a CLI wrapper around | |
# Time#rfc2822 and the subtraction operator between Time objects. Then again, | |
# this is the *reason* I'd use Ruby for a task like this (over, say, C++)... | |
# | |
# Author::Trevor Fountain ([email protected]) |
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
-- Lua Cheat Sheet for Programmers, by Al Sweigart http://coffeeghost.net | |
-- This cheat sheet is an executable Lua program. | |
--[[ This is | |
a multline comment]] | |
---[[ This is a neat trick. The first -- makes -[[ not a multiline comment. | |
print("This line executes.") | |
--]] The rest of this line is also a comment. | |
print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.') |
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
import os | |
import pygame | |
import re | |
import sys | |
from pygame.locals import * | |
from optparse import OptionParser | |
parser = OptionParser(usage="AtlasTool is a utility for packing multiple images into a single OpenGL texture (a texture atlas).\n\npython %prog [options]") | |
parser.add_option("-d","--dir",dest="dir",help="(REQUIRED) Path to a directory containing desired texture images.") | |
parser.add_option("--surface",dest="surface_size",help="Size of the surface into which to render, of the form WIDTHxHEIGHT). Defaults to 512x512.",default="512x512") |
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
// object.h (the header file) | |
#include <iostream> | |
class H | |
{ | |
public: | |
H(int v); | |
void print(); | |
protected: | |
int value; |
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
# Monkey patch to add .x/.y shorthand and wrapping positive indices to Array | |
class Array | |
# Lets me reference arrays as <array>.x/<array>.y for readability. | |
def x; self[0]; end | |
def y; self[1]; end | |
# Replace Array#[] with a version that wraps positive indices | |
alias :old_get :[] | |
def [](a,b=nil) |
NewerOlder