Skip to content

Instantly share code, notes, and snippets.

@blockpane
blockpane / firewall.sh
Last active March 22, 2025 23:35
Example of how to setup iptables to correctly filter Docker services
#!/bin/bash
### This is an example script that sets up IP tables with Docker. Many admins are not aware that UFW
### and Docker do not play well together, and accidently expose RPC ports and vulnerable services to
### the network. This replaces UFW with Netfilter-persistent and adds rules to the DOCKER-USER chain
### which is the correct way to filter incoming traffic with docker. This specific example is for a
### Tendermint node running via docker, and wireguard / ssh running directly on the host.
# CHANGE THIS TO ACTUAL PUBLIC INTERFACE!!!!!!!!!!
@abdallahokasha
abdallahokasha / Install_robo3t_Ubuntu.md
Last active April 8, 2025 13:16
Install Robo3t on Ubuntu18.04 and make a desktop icon for it

Install Robo3t On Ubuntu 18.04

Download the package form Robo3t or using wget
wget https://download.robomongo.org/1.2.1/linux/robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz
Extract here using

tar -xvzf robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz

@ksvbka
ksvbka / worker-threadpool.py
Created December 19, 2018 15:29
Demo worker threadpool and report progress in PyQT.
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QPushButton, QWidget
from PyQt5.QtCore import QObject, QRunnable, QThreadPool,pyqtSlot, pyqtSignal
import time
import traceback, sys
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
@promi
promi / 011-unistd.patch
Last active December 14, 2017 01:17
MikroTik MetaROUTER OpenWRT build script for Debian Wheezy (Jessie?)
--- a/src/mklibs-readelf/elf.cpp
+++ b/src/mklibs-readelf/elf.cpp
@@ -25,6 +25,7 @@
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <unistd.h>
using namespace Elf;
@alexras
alexras / breaks.tex
Created September 23, 2012 01:46
Fix URL breaks in LaTeX
% Allow breaking at both hyphens and spaces
\usepackage[hyphens,spaces]{url}
% A sequence of BigBreaks will be treated as one break, so it will only be able to break after ://
\renewcommand{\UrlBigBreaks}{\do\:\do\/}
% (Less aggressive) Treat both / and - as breakable characters (don't know why this does something different than hyphens in the package declaration, but it does)
\renewcommand{\UrlBreaks}{\do\/\do\-}
% (More aggressive) Any letter and / are treated as breakable characters