Skip to content

Instantly share code, notes, and snippets.

View jrpz's full-sized avatar

Jaime Perez jrpz

View GitHub Profile
--- /etc/openvpn/openvpn.conf.template
+++ /etc/openvpn/openvpn.conf
@@ -26,3 +26,26 @@
#push "block-outside-dns"
#push "dhcp-option DNS 8.8.8.8"
#push "dhcp-option DNS 8.8.4.4"
+comp-lzo no
+push "comp-lzo no"
+push "route 1.1.1.1 255.255.255.255 net_gateway"
+push "route 1.0.0.1 255.255.255.255 net_gateway"
@jrpz
jrpz / tmux.cheat
Last active July 21, 2017 20:05 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^c w
New -s <session> Create ^c c
Attach att -t <session> Rename ^c , <name>
Rename rename-session -t <old> <new> Last ^c l (lower-L)
Kill kill-session -t <session> Close ^c &

Keybase proof

I hereby claim:

  • I am jrpz on github.
  • I am jrpz (https://keybase.io/jrpz) on keybase.
  • I have a public key ASD7cs-wYaMHlLQAuchRUt08yFVOa__cZUdWKvfBQOYHgAo

To claim this, I am signing this object:

@jrpz
jrpz / no_pngs.rb
Last active August 29, 2015 14:06
For when I forget to export pngs without extensions
# Step thru directory
# Find files without extension
# Rename file to include .png extension
dir = Dir.getwd
Dir.foreach(dir) do |f|
ext = File.extname(f)
if ext == '' && File.file?(f)
File.rename(f, "#{f}.png")
@jrpz
jrpz / twits.html
Created October 12, 2011 15:41
Twitter Feed
<div id="tweets"></div>
<script>
var timeline_url = "http://twitter.com/statuses/user_timeline/USERNAME.json?count=1&callback=?";
$.getJSON(timeline_url, function(tweets){
$.each(tweets, function(i, tweet){
$('#tweets').append(tweet.text);
});
});
@jrpz
jrpz / dirfiles_combine.rb
Created March 18, 2011 19:45
Combine text based files within a directory into a single file. Requires 'directory' and 'file' parameters.
dir = Dir.new(ARGV[0])
file = File.open(ARGV[1], 'w')
dir.each{|d|
if (d[0] != '.')
f = File.open(ARGV[0] + d)
file.write(f.read)
f.close
end
}
file.close
@jrpz
jrpz / jq_daisy
Created December 17, 2010 16:17
jQuery daisy chain
$('input[type="text"]').css({
'font-weight' : 'bold',
'color' : '#999',
'text-align' : 'center'
}).click(function(){
$(this).val('');
});
require 'json'
require 'open-uri'
url = 'http://query.yahooapis.com/v1/public/yql?format=json&env=http://datatables.org/alltables.env&callback=cbfunc&q='
query = 'QUERY = SELECT * FROM yahoo.finance.quotes WHERE symbol IN (“YHOO”,“AAPL”,“GOOG”,“MSFT”)'
quri = URI.encode(url + query)
doc = open(quri)
<div id="bib">
<span id="title">Title</span>
<span id="author">Author</span>
<div id="location">Location</div>
</div>
<div id="qr_code"></div>
<script>
/* Grab bib info */
size(320,240);
background(0);
for(int i=0;i<250;i=i+1){
int x = int(random(0,290));
int y=int(random(0,200));
int hw=int(random(10,40));
fill(int(random(0,255)));
stroke(255);rect(x,y,hw,hw);
}