Skip to content

Instantly share code, notes, and snippets.

cat >> $HOME/.i3/conkyrc
background no
out_to_console yes
out_to_x no
max_text_width 0
own_window no
update_interval 0.5
total_run_times 0
short_units yes
if_up_strictness address
#cloud-config
---
coreos:
fleet:
public-ip: "$public_ipv4"
units:
- name: flanneld.service
drop-ins:
- name: 50-network-config.conf
content: |
@knabben
knabben / gist:589ecb279c96512c5792
Created March 12, 2016 23:37
Dev Django Deploy
FROM python:2.7.11-alpine
COPY . /data
WORKDIR /data
RUN mkdir /var/log/django
RUN apk add --update git mysql-client mysql-dev gcc libxml2 libxml2-dev libxslt-dev libxslt musl-dev
RUN pip install -r requirements/py27.txt
CMD ["python2.7", "manage.py", "runserver", "0.0.0.0:8000"]
@knabben
knabben / nginx.lua
Last active March 4, 2020 21:03
nginx with response out
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
log_format log_1 'x $request_body - $resp_body';
server {
listen 8080;
from utils import now_with_ms
from scapy.all import TCP, sniff
def start_scapy(packets_deque, plot_deque, loop):
print('scapy')
def sniffer(pkt):
out = pkt[TCP].payload
if hasattr(out, 'load'):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
HOST = "https://api.newrelic.com/v2/"
HEADER = {'X-Api-Key': os.environ.get('API_KEY')}
NAME = os.environ.get('NAME')
#!/usr/bin/python
import os
import sys
import aiohttp
import asyncio
import yaml
from bs4 import BeautifulSoup
from concurrent import futures
from urllib.parse import unquote
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <ngx_event.h>
static char *ngx_http_skill(ngx_conf_t *cf, void *post, void *data);
static ngx_conf_post_handler_pt ngx_http_skill_p = ngx_http_skill;
typedef struct {
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2015, House of the Hat, where the baby cries
* and the mother dont see.
*
* Amim Knabben - amim.knabben@gmail.com
*/
/*** MODULEINFO
local BasePlugin = require "kong.plugins.base_plugin"
local responses = require "kong.tools.responses"
local constants = require "kong.constants"
local RedHandler = BasePlugin:extend()
local set_header = ngx.req.set_header
local get_headers = ngx.req.get_headers
function RedHandler:new()