Skip to content

Instantly share code, notes, and snippets.

s4l3h1

Block or report user

Report or block s4l3h1

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
View jenkins-delete-failed-builds.groovy
def jobName = '(...)'
Jenkins.instance.getItemByFullName(jobName).builds.findAll { it.result == Result.FAILURE}.each { it.delete() }
View linkedin-unfollow.js
# goto https://www.linkedin.com/feed/following/
# in JS console run
var buttons = $("button"),
interval = setInterval(function(){
var btn = $('.is-following');
console.log("Clicking:", btn);
btn.click();
if (buttons.length === 0) {
clearInterval(interval);
@s4l3h1
s4l3h1 / nginx-tuning.md
Created Dec 18, 2017 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@s4l3h1
s4l3h1 / tile_file.py
Created Dec 17, 2017
GeoServer tile with django
View tile_file.py
import os
from django.conf import settings
from django.http.request import HttpRequest
from django.http.response import HttpResponse, HttpResponseRedirectBase
def http_redirect(request=HttpRequest):
bbox = [float(i) for i in request.GET.get('bbox').split(',')[:4]]
layers = request.GET.get('layers').replace(':', '_')
@s4l3h1
s4l3h1 / proxy.conf
Created Dec 16, 2017 — forked from sirsquidness/proxy.conf
How to have nginx proxy_pass follow upstream 302 redirects (eg, when you're running a steam cache and you're behind Cox's layer 7 interception stuff)
View proxy.conf
# This config came around after a friend had problems with a Steam cache on his
# Cox internet connection. Cox would intercept any requests to Steam content
# servers and return a 302 to Cox's servers. The cache would return the 302
# to the Steam client, and the Steam client would go directly to Cox, bypassing
# the cache.
# This config makes nginx follow the 302 itself, and caches the result of the
# redirect as if it was the response to the original request. So subsequent
# requests to the URL that returned a 302 will get the file instead of a 302.
@s4l3h1
s4l3h1 / linode-ns-A-AAAA
Last active Nov 5, 2017
Linode DNS AAAA A network addresses
View linode-ns-A-AAAA
ns1.linode.com. 300 IN A 162.159.27.72
ns1.linode.com. 300 IN AAAA 2400:cb00:2049:1::a29f:1a63
ns2.linode.com. 300 IN A 162.159.24.39
ns2.linode.com. 300 IN AAAA 2400:cb00:2049:1::a29f:1827
ns3.linode.com. 300 IN A 162.159.25.129
ns3.linode.com. 300 IN AAAA 2400:cb00:2049:1::a29f:1981
ns4.linode.com. 300 IN A 162.159.26.99
ns4.linode.com. 300 IN AAAA 2400:cb00:2049:1::a29f:1b48
ns5.linode.com. 300 IN A 162.159.24.25
ns5.linode.com. 300 IN AAAA 2400:cb00:2049:1::a29f:1819
@s4l3h1
s4l3h1 / _service.md
Created Aug 9, 2017 — forked from naholyr/_service.md
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@s4l3h1
s4l3h1 / es-dump-index.py
Created Jul 24, 2017 — forked from spikeekips/es-dump-index.py
The simple script to dump the data from ElasticSearch for inserting by bulk API.
View es-dump-index.py
# -*- coding: utf-8 -*-
"""
################################################################################
Dump ElasticSearch index for inserting BULK
################################################################################
requires `rawes`.
for more details, run `-h` to show help message.
@s4l3h1
s4l3h1 / add_veth_pair.sh
Created May 13, 2017 — forked from thiagokronig/add_veth_pair.sh
Add veth pair to Docker container
View add_veth_pair.sh
# Fortemente baseado em https://github.com/jpetazzo/pipework
function add_veth_pair {
pid=$1 ; ipaddr=$2 ; container_ifname=$3
echo "Add interface $container_ifname with ip $ipaddr to container pid $pid"
local_ifname="v${container_ifname}l${pid}"
guest_ifname="v${container_ifname}g${pid}"
bridge='docker0'
mtu=$(ip link show $bridge | awk '{print $5}')
if ip link show "$local_ifname" >/dev/null 2>&1 ; then
ip link del "$local_ifname"
You can’t perform that action at this time.