Skip to content

Instantly share code, notes, and snippets.

View pol's full-sized avatar

pol llovet pol

View GitHub Profile
@pol
pol / minecraft.yml
Last active January 17, 2023 18:16
Minecraft Ansible Playbook
#
# Minecraft Server Ansible Playbook
#
# Author:: Pol Llovet (<pol.llovet@montana.edu>)
# Copyright 2013, Montana State University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@pol
pol / set_iTerm_background.sh
Created January 11, 2011 01:42
Set the background color of iTerm based on RAILS_ENV
#!/usr/local/bin/bash
set_term_bgcolor(){
local R=$1
local G=$2
local B=$3
/usr/bin/osascript <<EOF
tell application "iTerm"
tell the current terminal
tell the current session
@pol
pol / wos.php
Created October 28, 2011 04:59
Web of Science API access with ruby libs
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(
@pol
pol / regexCheatsheet.js
Created February 1, 2020 01:59 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@pol
pol / postmortem.md
Created May 21, 2019 13:49 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@pol
pol / etc-hosts-on-win.md
Last active July 21, 2018 00:16 — forked from zenorocha/etc-hosts-on-win.md
/etc/hosts on Windows

How to edit your hosts file

notepad

For Windows 10 and 8
  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
root@app-server-b-3 ~ # lsof | grep deleted | awk '{print $1}' | sort | uniq -c
8 consul
51772 log-couri
root@app-server-b-3 ~ # lsof | grep deleted | awk '{print $10}' | sort | uniq -c
1433 (deleted)
46 /mnt/app/myapp/etc/sv/resque-worker-statused,high,highnetwork,medhigh,medium,long_medium-10/log/main/@400000005a1f2f663b201db4.s
46 /mnt/app/myapp/etc/sv/resque-worker-statused,high,highnetwork,medhigh,medium,long_medium-10/log/main/@400000005a1f35c7139217fc.s
46 /mnt/app/myapp/etc/sv/resque-worker-statused,high,highnetwork,medhigh,medium,long_medium-10/log/main/@400000005a1f3a8716e90b2c.s
46 /mnt/app/myapp/etc/sv/resque-worker-statused,high,highnetwork,medhigh,medium,long_medium-10/log/main/@400000005a1f40183699ce5c.s
46 /mnt/app/myapp/etc/sv/resque-worker-statused,high,highnetwork,medhigh,medium,long_medium-10/log/main/@400000005a1f46c015870a2c.s
@pol
pol / gist:ef1a786c258c4751d90c0eb2afad706a
Created November 8, 2017 22:12
Keybase Proof of Me.
### Keybase proof
I hereby claim:
* I am pol on github.
* I am pol (https://keybase.io/pol) on keybase.
* I have a public key whose fingerprint is 8F14 7A93 28E1 1F48 99EC 073E 89E0 D6D5 8F0F CCBE
To claim this, I am signing this object:
@pol
pol / logstash.conf.erb
Created September 19, 2017 15:20
logstash conf template
input {
tcp {
port => 5000
type => "raw-tcp"
}
courier {
transport => "tls"
port => <%= @log_courier_port %>
ssl_certificate => "<%= @log_courier_certpath %>"
ssl_key => "<%= @log_courier_keypath %>"