Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@davidski
davidski / extract_traffic.py
Created July 16, 2014 20:14
Sample Elasticsearch Scroll Query
from elasticsearch import Elasticsearch, helpers
import csv
import logging
logging.basicConfig()
target_file = "traffic.csv"
es=Elasticsearch("your.es.host.example.tld", timeout=480)
import os, glob, re
def main():
p = re.compile('^([0-9a-f]+-[0-9a-f]+)\s[a-z\-]{4}\s[0-9a-f]{8}\s[a-z0-9]{2}\:[a-z0-9]{2}\s[0-9]+\s+(.*)$')
smaps = glob.glob('/proc/[0-9]*/smaps')
for smap in smaps:
lines = open(smap).readlines()
for line in lines:
m = p.match(line)
if m and 'libc' in line:
name = open(smap.replace('smaps','status')).readlines()[0]
@zeffii
zeffii / one step closer to nirvana.py
Created October 4, 2012 18:55
scripted keymapping
# script to map 1, 2, 3 to vertex, edge, face selection for 3dview
import bpy
wm = bpy.context.window_manager
if True:
deactivate_list = ['ONE', 'TWO', 'THREE']
view3d_km_items = wm.keyconfigs.default.keymaps['3D View'].keymap_items
for j in view3d_km_items:
if j.type in deactivate_list and j.name == 'Layers':
# blender_version_save.py (c) 2013 Scott Wilson (ProperSquid)
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#

Meltdown fix impact on Redis performances in virtualized environments

UPDATE: apparently kernel difference may have a serious impact, so I'll redo the test from scratch.

Test performed with AOF enabled, fsync policy 1 second, allowing the rewrites to be triggered.

Command lines used:

@tomaes
tomaes / raster-fari
Created March 22, 2014 18:11
16 bytes for a fairly nice looking (and flicker free) static raster effect (c64)
* = $7c ; zeropage boot-up (for VICE)
sei ; no interupts, no flickering
sty $d011 ; background frame is now everywhere
cpy $d012 ; wait for next raster line
bne *-3 ;
sty $d020 ; set fullscreen color
iny ; wait 2 lines (looks best)
iny ;
bvc *-10 ; loop quickly
@fabrizioc1
fabrizioc1 / akamai_debug_headers.txt
Last active May 24, 2023 08:23
Akamai debug headers
Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no
@bhenerey
bhenerey / ideal ops.md
Created May 23, 2012 19:40
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@magnetikonline
magnetikonline / README.md
Last active November 27, 2023 21:12
Setting Nginx FastCGI response buffer sizes.
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {