Skip to content

Instantly share code, notes, and snippets.

@shamangeorge
shamangeorge / apache-custom-directory
Last active December 22, 2022 07:00
apache virtual host with custom directory index configuration
<VirtualHost *:80>
ServerName www.example.com
# For local dev machines
ServerAlias staging.www.example.com
ServerAlias dev.www.example.com
DocumentRoot /var/www/www.example.com
<Directory /var/www/www.example.com>
Options +FollowSymlinks +Multiviews +Indexes
@shamangeorge
shamangeorge / crayola.json
Last active November 8, 2020 21:55 — forked from jjdelc/crayola.json
Official Crayola Colors hex and rgb values in JSON
[
{
"hex": "#EFDECD",
"name": "Almond",
"rgb": "(239, 222, 205)"
},
{
"hex": "#CD9575",
"name": "Antique Brass",
"rgb": "(205, 149, 117)"
@shamangeorge
shamangeorge / speech.txt
Created December 5, 2018 21:43
polly trial
<speak>HOSPITALIZACIONES</speak>
@shamangeorge
shamangeorge / jail.local
Created October 10, 2017 22:31 — forked from Dman46/jail.local
Fail2ban - send Slack notifications
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
require 'optparse'
require 'optparse/time'
require 'ostruct'
require 'pp'
class OptparseExample
Version = '1.0.0'
CODES = %w[iso-2022-jp shift_jis euc-jp utf8 binary]
CODE_ALIASES = { "jis" => "iso-2022-jp", "sjis" => "shift_jis" }
@shamangeorge
shamangeorge / mattermost_hook_data.json
Created May 6, 2017 17:16
Matter example hook data
{
"attachments": [
{
"fallback": "test",
"color": "#FF8000",
"pretext": "This is optional pretext that shows above the attachment.",
"text": "This is the text of the attachment. It should appear just above an image of the Mattermost logo. The left border of the attachment should be colored orange, and below the image it should include additional fields that are formatted in columns. At the top of the attachment, there should be an author name followed by a bolded title. Both the author name and the title should be hyperlinks.",
"author_name": "Mattermost",
"author_icon": "http://www.mattermost.org/wp-content/uploads/2016/04/icon_WS.png",
"author_link": "http://www.mattermost.org/",
@shamangeorge
shamangeorge / index.html
Last active April 6, 2016 10:49
CSS3 covering bakground technique
<!doctype html>
<html>
<head>
<style>
html {
background: url('./pandora.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
@shamangeorge
shamangeorge / disable_scroll.js
Last active December 29, 2015 20:19
How to disable scrolling temporarily JS
// From http://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily
// left: 37, up: 38, right: 39, down: 40,
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
var keys = [37, 38, 39, 40];
function preventDefault(e) {
e = e || window.event;
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
@shamangeorge
shamangeorge / .gdbinit_objc
Last active December 26, 2015 15:49
Reverse Engineering tools
fb -[NSException raise]
fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
#define NSZombies
# this will give you help messages. Set to NO to turn them off.
set env MallocHelp=YES
# might also be set in launch arguments.
set env NSZombieEnabled=YES
set env NSDeallocateZombies=NO
@shamangeorge
shamangeorge / regexp.sh
Last active December 25, 2015 23:29
Useful bash regexp methods
egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' # finds ips in a file
# From http://stackoverflow.com/questions/1444406/how-can-i-delete-duplicate-lines-in-a-file-in-unix/1444448#1444448
# delete duplicate, consecutive lines from a file (emulates "uniq").
# First line in a set of duplicate lines is kept, rest are deleted.
sed '$!N; /^\(.*\)\n\1$/!P; D'
# delete duplicate, nonconsecutive lines from a file. Beware not to
# overflow the buffer size of the hold space, or else use GNU sed.
sed -n 'G; s/\n/&&/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P'