Skip to content

Instantly share code, notes, and snippets.

@elico
elico / files-in-folder.ps1
Created September 21, 2023 13:15
A helper tool to find duplicate files in a folder
$FirstStageFile = "O:\hashes3.csv"
$SecondStageFile = "O:\hashes3-s.csv"
$Directory = "C:\Users\eliezer\Documents\"
Get-ChildItem -Path $Directory -Recurse -File -Force | ForEach {
[PSCustomObject]@{
FullPath = $_.FullName
Name = $_.Name
Size = $_.Length
ffmpeg -i '.\File.ts' -vcodec copy -acodec copy -map 0:v -map 0:a '.\File.mp4'
@elico
elico / sat.sh
Created July 8, 2023 22:30
VyOS SDWAN with proxy and per packet routing from lan to local PROXY
#!/bin/vbash
set interfaces ethernet eth0 address '10.50.1.208/24'
set interfaces ethernet eth0 hw-id '00:15:5d:89:c6:a8'
set interfaces ethernet eth1 address '192.168.1.254/24'
set interfaces ethernet eth1 hw-id '00:15:5d:89:c6:a9'
set interfaces ethernet eth2 hw-id '00:15:5d:89:c6:aa'
set interfaces ethernet eth3 hw-id '00:15:5d:89:c6:ab'
set interfaces ethernet eth4 hw-id '00:15:5d:89:c6:ac'
set interfaces loopback lo
set interfaces wireguard wg0 address '100.20.0.2/30'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
GRCN is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
#
This program is distributed in the hope that it will be useful,
# SSL Interception basic rules
acl DiscoverSNIHost at_step SslBump1
acl NoSSLInterceptRegEx ssl::server_name_regex (^|.*\.)redshift3d\.com$
acl NoSSLInterceptRegExFile ssl::server_name_regex "/usr/local/squid/etc/no-intercept-ssl-regex.txt"
acl NoSSLInterceptDstDom ssl::server_name .redshift3d.com
acl NoSSLInterceptDstDomFile ssl::server_name "/usr/local/squid/etc/no-intercept-ssl-dstdom.txt"
## Any of will test what ever rule match first in a first match/hit fasion
@elico
elico / add-host-cert-to-local-store.sh
Last active June 29, 2023 10:33
Alam Linux adding server certificate to local store.
#!/usr/bin/env bash
HOSTNAME="$1"
if [ -z "${HOSTNAME}" ];then
echo "Missing hostname"
exit 1
fi
LOCAL_TRUSTED_STORE="/etc/pki/ca-trust/source/anchors"
@elico
elico / rock_cache_dump.pl
Created June 26, 2023 22:39
rock_cache_dump.pl
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Sys::Mmap;
my ($file) = @ARGV;
die "Usage: $0 <cache_dir>/rock\n" if not $file;
@elico
elico / README.md
Last active June 20, 2023 23:58
Install Netbox in Alma Linux 9
dnf -y update 
dnf install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config git tar
 
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
cat /etc/selinux/config | grep SELINUX=

dnf makecache --refresh
dnf -y install python3-pip
dnf makecache --refresh
@elico
elico / .env
Created June 18, 2023 21:01
Helper script for RouterOS GeoIP managment
USERNAME="admin"
PASSWORD="testAdmin"
#!/usr/bin/env bash
# Step 0: Update the OS
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
dnf -y update
dnf -y install git wget vim bash-completion curl
# Reboot if neccesary