Skip to content

Instantly share code, notes, and snippets.

View kyob's full-sized avatar

Łukasz Kopiszka kyob

View GitHub Profile
@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active October 30, 2024 17:14
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@brav0charlie
brav0charlie / AdGuardHome-DNSOnly-docker-compose.yml
Last active March 9, 2024 13:52
AdGuard Home (No DHCP) in Docker using Docker-Compose
# NOTE: While AdGuard Home may be configured as a DHCP server, this is out
# out of scope for this docker-compose.yml file. Configuring the DHCP
# server requires using 'network_mode: host'.
#
# If you want to use the DHCP server feature, delete the 'network:'
# section (lines 20 & 21), as well as the entire 'ports:' section
# (lines 30 - 47). Then, just below the 'restart:' section (line 19)
# insert a line that reads 'network_mode: host'. The container will
# still reserve all the ports listed below, as well as 67 and 68 for
# DHCP, but there's no need to map them in the docker-compose.yml file
@nasirhafeez
nasirhafeez / freeradius-advanced-use-cases.md
Last active October 11, 2024 12:00
FreeRADIUS Advanced Use Cases
@ptomulik
ptomulik / rotate_old_radacct_detail_files_mtime_based.sh
Last active December 16, 2022 11:44
Rotation script for freeradius accounting detail files. Shall be run as a cron script.
#! /bin/sh
########################################################################################
# Compresses old radacct detail files and removes very old compressed radacct files.
########################################################################################
# Author: P. Tomulik
########################################################################################
# Path to the programs used (for environments without $PATH set)
FIND=/usr/bin/find
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 3, 2024 12:26
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Git Cheat Sheet

Commands

Getting Started

git init

or

@Kartones
Kartones / postgres-cheatsheet.md
Last active November 2, 2024 03:58
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@dmytro
dmytro / gist:7887843
Last active November 8, 2018 11:14
Shell script for SYN flood DOS attacks prevention. Use sqlite3 to filter IP's
#!/bin/bash
SLEEP=120
MAX_CONN=20
MY_IP=0.0.0.0 # Configure your IP here
while true; do
(
echo "create table ips (ip string);"
echo 'begin transaction;'
netstat -an | grep -v ESTABLISHED | grep ${MY_IP}:80 | awk '{print $5}' | cut -f4 -d: | while read IP; do
@ksafranski
ksafranski / expecting.md
Last active November 11, 2023 23:00
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect