Skip to content

Instantly share code, notes, and snippets.

View NabiKAZ's full-sized avatar

Nabi KaramAliZadeh NabiKAZ

View GitHub Profile
@avivace
avivace / telegramRestore.md
Last active May 3, 2024 15:15
Restore deleted Telegram messages from groups

Restore deleted Telegram messages, medias and files from groups

There's not telegram API method for this, we need to call MTProto methods to retrieve messages from the "Recent Actions" (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion.

from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
@carlesloriente
carlesloriente / compile-and-install-glibc_2.18-centos-7.sh
Last active April 22, 2024 03:17
Compile and install GLIBC 2.18 in CentOS 7
# Check gist comments to verify system PATH and or adapt it.
wget https://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxvf glibc-2.18.tar.gz
cd glibc-2.18
mkdir build
cd build
../configure --prefix=/opt/glibc-2.18
make -j4
sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/glibc-2.18/lib
@sohamkamani
sohamkamani / rsa.js
Last active May 8, 2024 19:32
An example of RSA Encryption implemented in Node.js
const crypto = require("crypto")
// The `generateKeyPairSync` method accepts two arguments:
// 1. The type ok keys we want, which in this case is "rsa"
// 2. An object with the properties of the key
const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", {
// The standard secure default length for RSA keys is 2048 bits
modulusLength: 2048,
})
@NabiKAZ
NabiKAZ / route.php
Last active September 19, 2023 16:09
For show advanced list of files and directories with sort, date, size, icon type,..., Save bellow content code as `route.php` file, and then run this command: `php -S 0.0.0.0:8080 -t . route.php` And then open `http://localhost:8080/` in the browser.
<?php
//@NabiKAZ
//https://gist.github.com/NabiKAZ/91f716faa89aab747317fe09db694be8
//For show advanced list of files and directories with sort, date, size, icon type,...,
//Save bellow content code as route.php file, and then run this command:
// php -S 0.0.0.0:8080 -t . route.php
//And then open http://localhost:8080/ in the browser.
//////////////////////////////////////////////////////////////////
// This block MUST be at the very top of the page!
@ob_start('ob_gzhandler');
@SaeedDev94
SaeedDev94 / socks2vpn.sh
Last active April 18, 2024 18:50
Linux tun2socks routing helper
#!/bin/bash
if [ "$EUID" -ne 0 ]; then echo "Please run as root"; exit; fi
GATEWAY=$(ip route | awk '/default/ {print $3}')
INTERFACE=$(ip route | awk '/default/ {print $5}')
RESOLVE_CONF=$(cat /etc/resolv.conf)
SOCKS_SCHEME="socks5"
SOCKS_ADDRESS="127.0.0.1"