Skip to content

Instantly share code, notes, and snippets.

View AdroitAdorKhan's full-sized avatar
:octocat:
1x.engineer

Ador AdroitAdorKhan

:octocat:
1x.engineer
  • Madaripur, Bangladesh
View GitHub Profile
@AdroitAdorKhan
AdroitAdorKhan / ipset.service
Last active September 14, 2024 10:51 — forked from meanevo/ipset.service
IPSet settings persistence
#
# reference: http://namsep.blogspot.com/2015/12/yad-centos-7-iptables-ipset-and-fail2ban.html
# reference: http://pkgs.fedoraproject.org/cgit/ipset.git/tree/ipset.service
# file location: /etc/systemd/system/ipset.service
# nano /etc/systemd/system/ipset.service
# systemctl daemon-reload
# systemctl enable ipset.service
# mkdir /etc/ipset
# touch /etc/ipset/ipset
# ...do something with ipset...

How to increase ulimit in Linux:

  • Step 1 (ulimit): open the sysctl.conf and add this line fs.file-max = 65536

      vi /etc/sysctl.conf   
    

    add following at end of file in above file:

      fs.file-max = 65536
    

save and exit.

@AdroitAdorKhan
AdroitAdorKhan / conf.php
Last active March 15, 2024 06:54
Simple PHP snippets to get specific interface info using Mikrotik Rest API. (ROS7.2+)
<?php
// User credentials & Host info
$username = 'admin';
$password = '';
$hostAddress = "192.168.88.1"; // Add port if any, ex, 922.168.88.1:81
$protoScheme = "http"; // If SSL, ex, https
?>
@AdroitAdorKhan
AdroitAdorKhan / mime.types
Last active July 7, 2023 13:19
Custom Mime Types.
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
@AdroitAdorKhan
AdroitAdorKhan / sources.list
Last active September 1, 2023 08:00
Complete Debian 11/12 Sources.
## Bullseye (11)
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
@AdroitAdorKhan
AdroitAdorKhan / AWS-Global-Accelerator-IP-Ranges.md
Created April 10, 2023 09:38
Get IP ranges of AWS Global Accelerator. You can use this list to route Valorant and other games that use AWS Global Accelerator.

Download AWS IP Ranges JSON

wget https://ip-ranges.amazonaws.com/ip-ranges.json

Get IPv4 Ranges

grep -i -B 1 '"region": "GLOBAL",' ip-ranges.json | grep '"ip_prefix":' | awk -F'"' '{print $4}' > AWS-Global-v4.txt

Install latest nala

wget https://gitlab.com/volian/volian-archive/uploads/b20bd8237a9b20f5a82f461ed0704ad4/volian-archive-keyring_0.1.0_all.deb
wget https://gitlab.com/volian/volian-archive/uploads/d6b3a118de5384a0be2462905f7e4301/volian-archive-nala_0.1.0_all.deb
sudo apt install ./volian-archive*.deb
sudo apt update && sudo apt install nala
rm -f volian-archive*.deb

Function to add a wireguard conf in /etc/wireguard/ dir with ease

wireguardConf() {
	conf=/etc/wireguard/${1}.conf
	if test -f "$conf"; then
		systemctl enable wg-quick@${1}.service
		systemctl daemon-reload
		systemctl start wg-quick@${1}
		systemctl status wg-quick@${1}
	fi

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Wireguard /v "MultipleSimultaneousTunnels" /t REG_DWORD /d 1

docker-compose.yml

services:
  redis:
    image: redis:7.0.8-alpine
    container_name: unbound-redis
    command: redis-server --save 43200 1 7200 100 --loglevel warning --rdbchecksum no 
    volumes:
      - "./redis:/data"