Skip to content

Instantly share code, notes, and snippets.

@saudiqbal
saudiqbal / SCP-Upload-Download-only-access-Linux
Created May 4, 2026 02:21
SCP Upload / Download only access for Linux
## Server Setup
# SSH commands for creating user and download upload directories
groupadd backupusers
useradd -g backupusers -s /sbin/nologin backupuser
mkdir -p /mnt/SystemAdmin/BackupStorage/{upload,download}
chown backupuser:backupusers /mnt/SystemAdmin/BackupStorage/{upload,download}
chown root:root /mnt/SystemAdmin/BackupStorage
chmod 755 /mnt/SystemAdmin/BackupStorage
@saudiqbal
saudiqbal / kubuntu.sh
Last active March 25, 2026 22:16
Kubuntu Setup
#!/bin/bash
RD=$(echo "\033[01;31m")
YW=$(echo "\033[33m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
BFR="\\r\\033[K"
HOLD="+"
CM="${GN}✓${CL}"
CROSS="${RD}✗${CL}"
@saudiqbal
saudiqbal / dolphinui.rc
Last active August 30, 2025 18:28
Dolphin Custom Toolbar
<!DOCTYPE gui>
<gui name="dolphin" translationDomain="kxmlgui6" version="41">
<MenuBar alreadyVisited="1">
<Menu alreadyVisited="1" name="file" noMerge="1">
<text translationDomain="kxmlgui6">&amp;File</text>
<Action name="file_new"/>
<Separator weakSeparator="1"/>
<Action name="new_menu"/>
<Action name="file_new"/>
<Action name="new_tab"/>
@saudiqbal
saudiqbal / add-multiple-ipv6.sh
Last active December 18, 2023 16:39
Add multiple IPv6 address on prefix change.
#!/bin/bash
IPv6PrefixFile=$HOME/IPv6Prefix.txt
IPv6Prefix=$(cat $IPv6PrefixFile)
__rfc5952_expand () {
read addr mask < <(IFS=/; echo $1)
quads=$(grep -oE "[a-fA-F0-9]{1,4}" <<< ${addr/\/*} | wc -l)
grep -qs ":$" <<< $addr && { addr="${addr}0000"; (( quads++ )); }
grep -qs "^:" <<< $addr && { addr="0000${addr}"; (( quads++ )); }
@saudiqbal
saudiqbal / gist:61a0eee2faf9e675ed29474ff9530582
Created November 10, 2023 02:42
Dynamic DNS IPv6 prefix
IPv6 home server with dynamic prefix for VPN, Web Server, RDP and Firewall setup guide
IPv6 is the new successor to legacy IPv4 which overcomes the shortages of IPv4 addresses since it only contains 4,294,967,296 IP addresses where as the smallest IPv6 block which is a /64 has 18,446,744,073,709,551,616 IPv6 addresses. The world is running out of IPv4 addresses and more and more ISPs are moving towards CGNAT (Carrier Grade Network Address Translation) which means instead of a public IPv4 address a private IPv4 address is assigned to users where services hosted on home does not work. If you are planning on setting up a server or remote access to your home or office using IPv6 then this guide is for you.
Preparing your device.
Windows
Windows uses IPv6 privacy extension where it uses a temporary IPv6 address which changes every couple of hours. To force Windows to use a static address create a new file as disable_temp_ipv6.bat and paste these lines
netsh interface ipv6 set global randomizeidentifiers=disabl
@saudiqbal
saudiqbal / gist:fb567cf058f4b2b87c7b4e78ea7b9e66
Last active November 13, 2023 01:49
Dynamic DNS bash script for IPv6 prefix using DHCPv6
#!/bin/bash
# Create an empty file first at $HOME/ddns-ipv6-address.txt with a 0 in it.
ADDRSTORE=$HOME/ddns-ipv6-address.txt
__rfc5952_expand () {
read addr mask < <(IFS=/; echo $1)
quads=$(grep -oE "[a-fA-F0-9]{1,4}" <<< ${addr/\/*} | wc -l)
grep -qs ":$" <<< $addr && { addr="${addr}0000"; (( quads++ )); }
grep -qs "^:" <<< $addr && { addr="0000${addr}"; (( quads++ )); }
[ $quads -lt 8 ] && addr=${addr/::/:$(for (( i=1; i<=$(( 8 - quads )) ; i++ )); do printf "0000:"; done)}
@saudiqbal
saudiqbal / gist:9adbaa44a40a02cc4f0cdf28c62c56c8
Last active November 13, 2023 01:49
Dynamic DNS bash script for IPv6 prefix using token
#!/bin/bash
# Create an empty file first at $HOME/ddns-ipv6-address.txt with a 0 in it.
SUFFIX="::71c6:b34f:8e2a:54f5"
ADDRSTORE=$HOME/ddns-ipv6-address.txt
STOREDIPV6=$(cat $ADDRSTORE)
__rfc5952_expand () {
read addr mask < <(IFS=/; echo $1)
quads=$(grep -oE "[a-fA-F0-9]{1,4}" <<< ${addr/\/*} | wc -l)
grep -qs ":$" <<< $addr && { addr="${addr}0000"; (( quads++ )); }
@saudiqbal
saudiqbal / password-protected-page.php
Last active November 10, 2023 17:50
PHP password protect single page script with multiple users
<?php
$user_info=[
'admin'=>['adminpassword','ynNYKWngfgW8gI0WX72g1tRq0RLpDiNz'],
'root'=>['rootpassword','16n2VZKFLI3inP3xS1dfdoY60pCOhFIZ'],
'manager'=>['managerpassword','ML7IZ0updvFCKtcdEECBf6qCmnX8u4lB']
];
if (!isset($_COOKIE['token']))
{
$login = true;
}
@saudiqbal
saudiqbal / nftables.conf
Last active May 26, 2024 16:39
Ocserv OpenConnect VPN firewall rules for Nftables
#!/usr/sbin/nft -f
flush ruleset
# ----- IPv4 -----
table ip filter {
chain input {
type filter hook input priority 0;
# accept traffic originated from us
ct state {established, related} accept
@saudiqbal
saudiqbal / port-check.php
Created August 24, 2020 22:23
PHP Port Checker
<!DOCTYPE html>
<html>
<head>
<title>Port Scanner</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width" />
<style>
body {
background: #f4f4f4;
width:100%;