Skip to content

Instantly share code, notes, and snippets.

View malikshi's full-sized avatar
🏠
Working from home

Malik Al malikshi

🏠
Working from home
View GitHub Profile
@malikshi
malikshi / how_to_get_telegram_chat_id.md
Created March 25, 2024 04:33 — forked from nafiesl/how_to_get_telegram_chat_id.md
How to get Telegram Bot Chat ID

How to get Telegram Bot Chat ID

Create a Telegram Bot and get a Bot Token

  1. Open Telegram application then search for @BotFather
  2. Click Start
  3. Click Menu -> /newbot or type /newbot and hit Send
  4. Follow the instruction until we get message like so
    Done! Congratulations on your new bot. You will find it at t.me/new_bot.
    
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/product.schema.json",
"title": "sing-box config schema",
"type": "object",
"$defs": {
"listableString": {
"$comments": "ref:https://github.com/SagerNet/sing-box/blob/b0db869b052aa32ec1716e43f7c1f50d7e491057/option/types.go#L77",
"description": "allow not hava to be an array when there's single item",
"oneOf": [
@malikshi
malikshi / OVH IPv6 Ubuntu.md
Created August 27, 2022 12:52 — forked from casualjim/OVH IPv6 Ubuntu.md
Actually working IPv6 dedicated server configuration for ubuntu

Configure IPv6 on Ubuntu 20.04 on OVH dedicated

Contrary to the guide, do this instead

the gateway is in the /56 network but so you have to get your ip in there.

Edit: /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by the datasource. Changes
@malikshi
malikshi / iptables-udp-flood.txt
Created August 22, 2022 08:16 — forked from thoward/iptables-udp-flood.txt
Prevent UDP flood
# Outbound UDP Flood protection in a user defined chain.
iptables -N udp-flood
iptables -A OUTPUT -p udp -j udp-flood
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: '
iptables -A udp-flood -j DROP
@malikshi
malikshi / rule-indo.sh
Last active August 14, 2022 08:19
rule indo
mola.tv
ws.mola.tv
res.mola01.koicdn.com
vod.cdn.mola.tv
api.sent.tv
cdn01.mola.tv
cdn02.mola.tv
# > Netflix
flxvpn.net
netflix.ca
@malikshi
malikshi / cloudflare.sh
Created June 24, 2022 06:01 — forked from Manouchehri/cloudflare.sh
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@malikshi
malikshi / list-online-gaming-ports-for-mikrotik.txt
Created November 18, 2021 07:39 — forked from renomureza/list-online-gaming-ports-for-mikrotik.txt
List of online gaming ports that can be used to optimize the RouterOS Mikrotik router connection
Mobile Legend (ML)
tcp: 5000-5221,5224-5227,5229-5241,5243-5508,5551-5559,5601-5700,9001,9443
tcp: 10003,30000-30300
udp: 4001-4009,5000-5221,5224-5241,5243-5508,5551-5559,5601-5700
udp: 2702,3702,8001,9000-9010,9992,10003,30190,30000-30300
Free Fire (FF)
tcp: 6006,6674,7006,7889,8001-8012,9006,10000-10012,11000-11019,120006,12008,13006
tcp: 39003,39006,39698,39779,39800
udp: 6006,6008,7008,8008,9008,10000-10013,10100,11000-11019,12008,13008
@malikshi
malikshi / Queries.md
Created October 21, 2021 10:11 — forked from fortuna/Queries.md
Grafana dashboard for Outline Servers

Example Queries

1h active keys by location:

sum(max(increase(shadowsocks_data_bytes{access_key!=""} [1h])) by (access_key, location) > bool 0) by (location)

1h usage by location:

sum(increase(shadowsocks_data_bytes{dir=~"c<p|p>t"} [1h])) by (location)
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */
@malikshi
malikshi / snat_dnat_advantech.md
Created August 21, 2021 04:18 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot)

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

masquarade all outgoing packets to be WLAN0 IP

iptables -t nat -A PREROUTING -s 192.168.1.2 -i eth0 -j MASQUERADE

All packets leaving eth0 will have src eth0 ip address