Skip to content

Instantly share code, notes, and snippets.

#include <vector>
#include <algorithm>
class One {
protected:
int a;
int b;
};
class Two : public One {
#include <vector>
#include <algorithm>
class One {
protected:
int a;
int b;
};
class Two : public One {
#include <vector>
#include <algorithm>
class One {
protected:
int a;
int b;
};
class Two : public One {
# update packages
apt-get update && apt-get install emacs24-nox mcrypt
# setup Postgres
apt-get install postgresql postgresql-contrib libpq-dev
# setup Nginx
apt-get install nginx
@recoder
recoder / safekeep-git.sh
Last active August 18, 2017 19:36
Archive a git repo, then archive uncommitted changes separately
#!/bin/sh
BACKUPING=`git remote show origin -n | grep "Fetch URL:" | sed -E 's:^.*/(.*):\1:'`
git archive -9 HEAD -o ../${BACKUPING}.committed.zip
git ls-files -o | zip ../${BACKUPING}.backup-uncommitted.zip -@
@recoder
recoder / url_salvage_op.py
Last active May 17, 2019 00:53
A script to recover URL's from Firefox Tabmix Plus session backup files - 2017 edition
import rdflib,urllib,json
g = rdflib.Graph()
g.parse("tabmix_sessions-2017-08-28.rdf") # replace with your own
links = {}
for obj in g.objects():
try:
if 'http' in obj:
@recoder
recoder / docker-compose.yaml
Created December 28, 2017 22:54
Sample docker-compose config for traefik and two domains
version: '2'
networks:
shout:
external:
name: web
whisper: {}
services:
traefik:
@recoder
recoder / docker-compose.yaml
Created January 2, 2018 16:14
Sample docker-compose config for traefik with LetsEncrypt and two domains plus dashboard
version: '2'
networks:
shout:
external:
name: web
whisper: {}
services:
traefik:
@recoder
recoder / synology_disk_space.sh
Created January 8, 2018 15:45
How to solve Synology "You cannot login to the system because the disk space is full currently"
#!/bin/bash
#1. See what partition is full:
df -h
#2. Find largest directories:
du -hax / 2> /dev/null | sort -rh | head -n 20
#3. Find fattest files:
find . -type f -printf "%s\t%p\n" | sort -n | tail -n 20
@recoder
recoder / ljlinks.py
Last active February 7, 2018 15:53
Python script to extract all external links for archiving