This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################### | |
# WARNING: Review this script carefully before running! | |
# | |
# - This script was created and tested on **Ubuntu Server 24.04 (Noble)**. | |
# It should work on other systems using UFW, rsyslog, and AppArmor, | |
# but may require minor modifications. | |
# | |
# - **Purpose**: This script configures UFW to log all traffic for later analysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import re | |
import string | |
import pickle | |
import redis | |
ZADD_BATCH_SIZE = 2000 | |
r = redis.Redis(port=6380) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Existing tests | |
test "BRPOPLPUSH with zero timeout should block indefinitely" { | |
set rd [redis_deferring_client] | |
r del blist target | |
r rpush target bar | |
$rd brpoplpush blist target 0 | |
wait_for_condition 100 10 { | |
[s blocked_clients] == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires python-magic, which requires the native libmagic lib | |
# I installed both on macOS with: | |
# - pip3 install python-magic | |
# - port install libmagic | |
# | |
# To run: | |
# python3 tobase64mime.py http://imagedomain.com/file.jpeg | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
# requires pycryptodome lib (pip install pycryptodome) | |
import sys | |
import base64 | |
import os | |
import json | |
from Crypto.Cipher import AES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
import sys | |
import base64 | |
print(sys.argv[1]) | |
PASSWORD_ENCRYPTION_KEY = b"sdf@!#$verf^wv%6Fwe%$$#FFGwfsdefwfe135s$^H)dg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Just compile with g++ datetime_format_string.cpp -std=c++11 | |
Tested on GCC 5.4.0 on Ubuntu 16.04 | |
*/ | |
#include <iostream> | |
#include <chrono> | |
#include <sys/time.h> | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Created by Felipe Machado - 2016/02/14 | |
# | |
# A retry command for bash | |
# Retries the given command up to MAX_RETRIES, with an interval of SLEEP_TIME | |
# between each retry. Just put it on your bash_profile and be happy :) | |
# Usage: | |
# retry [-s SLEEP_TIME] [-m MAX_RETRIES] COMMAND_WITH_ARGUMENTS | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jeroen janssens' jump utility | |
# http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html | |
# tab completion for bash on Mac OS X | |
# I just modified the find command to pipe to the 'basename' command, | |
# because find on BSD doesn't support the 'printf' option | |
# I didn't test it on Linux, but it should probably work | |
_completemarks() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- You should replace GistID with the id of the gist you want! --> | |
<div class="gistLoad" data-id="GistID" id="gist-GistID">Loading ....</div> | |
<!-- This script does the magic! --> | |
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script> |
NewerOlder