Skip to content

Instantly share code, notes, and snippets.

View doniz's full-sized avatar

Donatas Navidonskis doniz

View GitHub Profile
@doniz
doniz / tcpdump.md
Created August 28, 2019 15:45 — forked from qzaidi/tcpdump.md
capture http headers

HTTP Headers

tcpdump -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'

Postgres Queries

sudo tcpdump -i lo -s0 -nl -w- dst port postgres | strings -n8
@doniz
doniz / Makefile
Last active August 12, 2019 09:11 — forked from StanAngeloff/Makefile
Generate RabbitMQ self-signed certificate authority, server and client certificates.
# See http://www.rabbitmq.com/ssl.html
#
# (c) Stan Angeloff / http://www.gnu.org/licenses/agpl-3.0.html
SHELL := /bin/bash
HOSTNAME ?= $(shell hostname)
PASSPHRASE ?= $(shell cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
PASSPHRASE_FILE = $(HOSTNAME)/.passphrase
@doniz
doniz / vm-resize-hard-disk.md
Created December 4, 2018 13:21 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

<?php
/**
* Configure SilverStripe from the _ss_environment.php file.
*
* Edit this file and rename from _ss_environment.sample.php to _ss_environment.php.
* Put "require_once('conf/ConfigureFromEnv.php');" into your _config.php file.
* http://doc.silverstripe.org/framework/en/trunk/topics/environment-management
*/
    error_page 404 /assets/error-404.html;
    error_page 500 /assets/error-500.html;
    
    location / {
        try_files $uri @silverstripe;
    }
    
    location @silverstripe {
        fastcgi_keep_conn on;
@doniz
doniz / ffmpeg.md
Last active August 29, 2015 14:14 — forked from radavis/ffmpeg.md

Sample ffmpeg Commands

Convert to 480p

ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4

Convert to 720p via scaling, copy audio

ffmpeg -i input.mp4 \