Skip to content

Instantly share code, notes, and snippets.

🔭

Gilad Peleg pgilad

🔭
Block or report user

Report or block pgilad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tombigel
tombigel / README.md
Last active Nov 9, 2019 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@qoomon
qoomon / TravisGitHub.md
Last active Oct 23, 2019
Setup GitHub Deploy Keys For Travis
View TravisGitHub.md

Setup Travis Deploy (macOS)

gem install travis

ssh-keygen -t rsa -b 4096 -f 'github_deploy_key' -N ''

cat github_deploy_key.pub | pbcopy

set public key as deploy key on github e.g https://github.com/USER/REPO/settings/keys

rm 'github_deploy_key.pub'

@ozbillwang
ozbillwang / .travis.yml
Created Aug 1, 2017
terraform validates with Travis CI
View .travis.yml
env:
- tf_version=0.8.8
- tf_version=0.9.11
sudo: required
language: bash
before_install:
- wget https://releases.hashicorp.com/terraform/${tf_version}/terraform_${tf_version}_linux_amd64.zip -O /tmp/terraform.zip
@tanaikech
tanaikech / submit.md
Last active Nov 7, 2019
Multipart-POST Request Using Node.js
View submit.md

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
@jeroensmeets
jeroensmeets / gist:6e17fc17b5cb156d24f90f222cd9d9e9
Created May 1, 2017
essential parts for let's encrypt renewal under nginx
View gist:6e17fc17b5cb156d24f90f222cd9d9e9
server {
listen 80;
# set root and server_name here
# only serve validation files for Let's Encrypt on port 80
location /.well-known/acme-challenge/ {
try_files $uri /dev/null =404;
}
# otherwise to SSL
@pgilad
pgilad / percentiles.R
Created Apr 2, 2017
Percentiles plot using R
View percentiles.R
library("ggplot2")
sample.jtl <- read.csv("~/repos/work/csv-percentiles/sample.csv")
sample.jtl$ts <- as.POSIXct(sample.jtl$ts / 1000, origin="1970-01-01")
interval_size <- '5 sec'
wanted_percentiles <- c(0.5, 0.9, 0.95, 0.99)
get_quantiles <- function(items) {
yy <- quantile(items, wanted_percentiles)
@equinoxel
equinoxel / main.scss
Created Jan 23, 2017
webpack 2 config capable of loading font-awesome fonts
View main.scss
@import "~normalize-scss/sass/normalize";
$fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome.scss";
@import "bourbon";
@pgilad
pgilad / chi_square_min_sample.r
Last active Apr 15, 2018
Find minimum sample size to obtain minimum power test in non-centralized chi-square
View chi_square_min_sample.r
u <- c(0.1, 0.3, 0.5)
chi_df <- 3
target_power <- 0.9
chi_base <- qchisq(0.95, chi_df)
get_power <- function(n) {
return (pchisq(q = chi_base, df = chi_df, ncp = n * u %*% u, lower.tail = FALSE))
}
get_power(20)
@hallettj
hallettj / Makefile
Last active Mar 4, 2019
Makefile for transpiling with Babel & Flow in a Node app, or in a client- or server-side shared library
View Makefile
# Makefile for transpiling with Babel in a Node app, or in a client- or
# server-side shared library.
.PHONY: all clean
# Install `babel-cli` in a project to get the transpiler.
babel := node_modules/.bin/babel
# Identify modules to be transpiled by recursively searching the `src/`
# directory.
@FutureSharks
FutureSharks / splunk-daemonset.yaml
Last active Jun 8, 2019
Creates a Kubernetes DaemonSet that will monitor container logs and forward them to a Splunk Indexer
View splunk-daemonset.yaml
# Create using kubectl:
# $ kubectl create -f splunk-daemonset.yaml
#
# You should also add config on your indexer to deal with the json formatted files:
# https://answers.splunk.com/answers/148307/how-to-parse-and-extract-json-log-files-in-splunk.html
#
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: splunk-forwarder
You can’t perform that action at this time.