Skip to content

Instantly share code, notes, and snippets.

View NabiKAZ's full-sized avatar

Nabi KaramAliZadeh NabiKAZ

View GitHub Profile
@AkramiPro
AkramiPro / hamster-auto-clicker.js
Last active June 11, 2024 21:16
Hamster Kombat javascript auto clicker
// 1. Open firefox browser.
// 2. Use this for open hamster in browser: https://gist.github.com/NabiKAZ/10ab0c25c0703d5d3f5b9b4acd500c66
// 3. Install addon: https://addons.mozilla.org/en-US/firefox/addon/my-js-injector/
// 4. Copy & paste below code.
// tap every 0.5 second
setInterval(() => {
let tab = document.querySelector('.router-link-exact-active');
// only run if we are in home tab
if (tab && tab.getAttribute('href') === '/clicker') {
@NabiKAZ
NabiKAZ / hamster_on_computer.js
Last active June 21, 2024 01:47
Running Hamster Telegram game on computer
// Programmer: @NabiKAZ (https://twitter.com/NabiKAZ) and Thanks for Erfan (https://github.com/ErfanBahramali)
// To run Hamster Telegram game on computer. Enter Telegram from this link https://web.telegram.org/k/
// Then open the game. When the "Play on your mobile" error appeared. Copy and paste this code in
// your browser console. Both the game is run in the opened window and the address written in the console
// can be run in a separate and full-screen browser.
// Caution: You are responsible for possible risks such as banning.
// The game link: https://t.me/Hamster_kombat_bot/start?startapp=kentId101554083
console.log("Use this address in your browser:", document.getElementsByTagName('iframe')[0].src = document.getElementsByTagName('iframe')[0].src.replace(/(tgWebAppPlatform=)[^&]+/, "$1android"));
@SaeedDev94
SaeedDev94 / socks2vpn.sh
Last active July 2, 2024 12:51
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"
@NabiKAZ
NabiKAZ / route.php
Last active July 10, 2024 00:04
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');
@sohamkamani
sohamkamani / rsa.js
Last active July 4, 2024 13:04
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,
})
@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
@avivace
avivace / telegramRestore.md
Last active July 19, 2024 09:53
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
@WesThorburn
WesThorburn / client.js
Created May 14, 2018 22:47
Sending binary messages between client and server using uWS
var socket = new WebSocket("ws://localhost:3000");
socket.binaryType = "arraybuffer";
socket.onopen = function(){
var arrayBufferMessage = stringToArrayBuffer("Test message from client");
socket.send(arrayBufferMessage);
};
socket.onmessage = function(e){
console.log(arrayBufferToString(e.data));
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 19, 2024 18:06
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@cmer
cmer / haproxy.cfg
Last active April 15, 2024 09:54
Simple, no bullshit TCP port forwarding using HAProxy
listen l1
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443