Skip to content

Instantly share code, notes, and snippets.

View timoteoponce's full-sized avatar

Timoteo Ponce timoteoponce

View GitHub Profile
@dasgoll
dasgoll / gist:7b1a796d6e42cb66508bc504bb518f82
Created October 19, 2017 19:41
timeout command on MacOS
brew install coreutils
sudo ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout
@svanoort
svanoort / gcsettings.sh
Last active December 20, 2023 02:27
Blessed GC settings for big servers
# Base settings and GC logging
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed.
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine)
-XX:+UseG1GC
-XX:+UseStringDeduplication
@smoll
smoll / USING-DIFFMERGE.md
Last active October 21, 2023 23:37
Using DiffMerge as your git mergetool (for Mac OS X / macOS)
@minwe
minwe / EventSystem.js
Last active October 22, 2019 03:03 — forked from yitsushi/EventSystem.js
Global event system for React.js
var EventSystem = (function() {
var self = this;
self.queue = {};
return {
publish: function (event, data) {
var queue = self.queue[event];
if (typeof queue === 'undefined') {
@nopslider
nopslider / modsec.rules
Created February 11, 2015 14:11
ModSec Rule Examples
# Redirect to a different page when a PHP file is uploaded
SecRule FILES "(?i)\.php$" "t:none,log,redirect:http://cyberis.co.uk,msg:'PHP file upload blocked',id:1"
# Deny when a semi-colon is found in the 'ip' parameter
SecRule ARGS:ip ";" "t:none,log,deny,msg:'semi colon test',id:2"
# Disable ModSecurity for a given page - NOTE THE ESCAPE OF THE '?'
SecRule REQUEST_URI "/joomla/index.php/component/users/\?task=registration.register" "allow,id:3"
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block; padding: 0.5em;
color: #333;
background: #f8f8f8
@mattratleph
mattratleph / vimdiff.md
Last active May 9, 2024 03:11 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@zircote
zircote / ssh.sh
Created September 26, 2011 21:45
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f private_key1.pem > public_key1.pub