Skip to content

Instantly share code, notes, and snippets.

View mthri's full-sized avatar
🦄

Amir Motahari mthri

🦄
View GitHub Profile
@ErFUN-KH
ErFUN-KH / VLESS-XTLS-uTLS-REALITY.json
Last active April 6, 2025 08:25
VLESS-XTLS-uTLS-REALITY
{
"log": {
"loglevel": "warning"
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"ip": [
@iamvee
iamvee / template.ipynb
Last active January 31, 2021 21:51
tweets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@root-ali
root-ali / command-line-hero.MD
Created October 2, 2020 15:55 — forked from mthri/command-line-hero.MD
Command Line Hero (Part Software)

Command Line Hero (Part Software)


echo

Display a line of text/string on standard output or a file.

Syntax

echo [Options] [Strings]

Options:

@ppoffice
ppoffice / README.md
Last active April 16, 2025 04:30
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@itshaadi
itshaadi / README.md
Last active January 20, 2021 11:55
GeoIP no-route

Usage

this script will generate routing files for ocserv and iproute2 based on MaxMind's GeoLite2

usage: generate.py [-h] [-i] [-g] [-cc]

optional arguments:
  -h, --help  show this help message and exit
  -i          CSV Dir
@litetex
litetex / Description.md
Last active April 8, 2025 08:12
Serilog (C#): How to get current MethodName, FileName/Path and LineNumber without reflection

Serilog (C#): How to get the current MethodName, FileName/Path and LineNumber without reflection

This is a simple setup for reflectionless logging with serilog using caller information (and a single static class).

See also https://stackoverflow.com/a/46905798

Log.cs

Create your own Log.cs in your Root-Namespace (you can use the class below).

This class is required to detect where the call is coming from; it uses Caller-Information to speed up the program execution, because the attributes are resolved at compile-time.

@mlocati
mlocati / win10colors.cmd
Last active March 17, 2025 20:23
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active February 9, 2025 02:05
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 2, 2025 14:50
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@bigdragon1977
bigdragon1977 / Crc16.java
Created November 30, 2014 20:18
crc16 implementation java
public class Crc16 {
public static void main(String... a) {
byte[] bytes = new byte[] { (byte) 0x08, (byte) 0x68, (byte) 0x14, (byte) 0x93, (byte) 0x01, (byte) 0x00,
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x01,
(byte) 0x00, (byte) 0x13, (byte) 0x50, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x22, (byte) 0x09,
(byte) 0x11 };
byte[] byteStr = new byte[4];
Integer crcRes = new Crc16().calculate_crc(bytes);
System.out.println(Integer.toHexString(crcRes));