Skip to content

Instantly share code, notes, and snippets.

@WiseScripts
WiseScripts / README.md
Created November 19, 2025 00:53 — forked from hamid-rostami/README.md
wireguard over TCP

To pass wireguard's traffic through a TCP tunnel by using udp2raw

Requirements

For Arch linux, install udp2raw by pacman: pacman -S udp2raw

For Debian or Ubuntu, you can use a binary release from: https://github.com/wangyu-/udp2raw/releases

@WiseScripts
WiseScripts / bash_rules.md
Created November 14, 2025 00:32 — forked from cloverzero/bash_rules.md
Bash Rules

Shell(Bash)标准委员会

马晋 (PS, 主席) 刘卓 (OP) 王炜煜 (OP) 糜利敏 (WD) 雷飞尉 (OP) 刘树宪 (QA) 郑锦锋 (PS) 贾伟强 (SYS)

章节

0 一般信息 1 背景(Background)
2 Shell文件和解释器调用(Shell Files and Interpreter Invocation)
3 书写样板(Layout)

@WiseScripts
WiseScripts / kimsufi.py
Created January 6, 2025 16:34
A script to check Kimsufi server availability using OVH's API
#!/usr/bin/env python
#
# A script to check Kimsufi server availability using OVH's API.
# Typical usage:
# python kimsufi.py --dump-txt --dump-json --loop --verbose 160sk1
#
import sys
import os.path
import argparse
@WiseScripts
WiseScripts / TightVNC Password.ps1
Created November 16, 2024 06:20 — forked from jborean93/TightVNC Password.ps1
Code that can encrypt or decrypt TightVNC server passwords
Function ConvertTo-EncryptedVNCPassword {
[OutputType([byte[]])]
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[SecureString]
$Password
)
# This is hardcoded in VNC applications like TightVNC.
@WiseScripts
WiseScripts / WireGuard_Setup.txt
Created October 3, 2024 04:18 — forked from chrisswanda/WireGuard_Setup.txt
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@WiseScripts
WiseScripts / ansi_colors.sh
Created February 23, 2024 13:44 — forked from kenny-kvibe/ansi_colors.sh
ANSI color codes
#!/bin/bash
# ansi_colors.sh
#
# Wiki (ANSI CSI) https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences
# Wiki (ANSI SGR) https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
# Parameter 030-03F (0x30–0x3F) (ASCII 0–9:;<=>?)
# Intermediate 020-02F (0x20–0x2F) (ASCII space and !"#$%&'()*+,-./)
# Final 040-07E (0x40–0x7E) (ASCII @A–Z[\]^_`a–z{|}~)
#
# _______________________________________________________________
@WiseScripts
WiseScripts / insertAtCaret.js
Created February 19, 2024 06:24 — forked from fnicollier/insertAtCaret.js
Insert text into a textarea at cursor position
//http://www.scottklarr.com/topic/425/how-to-insert-text-into-a-textarea-where-the-cursor-is/
function insertAtCaret(areaId,text) {
var txtarea = document.getElementById(areaId);
var scrollPos = txtarea.scrollTop;
var strPos = 0;
var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ?
"ff" : (document.selection ? "ie" : false ) );
if (br == "ie") {
txtarea.focus();
var range = document.selection.createRange();
@WiseScripts
WiseScripts / error-trap.sh
Created February 15, 2024 05:27 — forked from oldratlee/error-trap.sh
error trap in bash
#!/bin/bash
set -eEuo pipefail
# https://stackoverflow.com/questions/6928946/mysterious-lineno-in-bash-trap-err
# https://stackoverflow.com/questions/64786/error-handling-in-bash
# https://stackoverflow.com/questions/24398691/how-to-get-the-real-line-number-of-a-failing-bash-command
# https://unix.stackexchange.com/questions/39623/trap-err-and-echoing-the-error-line
# https://unix.stackexchange.com/questions/462156/how-do-i-find-the-line-number-in-bash-when-an-error-occured
# https://unix.stackexchange.com/questions/365113/how-to-avoid-error-message-during-the-execution-of-a-bash-script
# https://shapeshed.com/unix-exit-codes/#how-to-suppress-exit-statuses
@WiseScripts
WiseScripts / Bash getopt long options with values usage example.sh
Created February 14, 2024 07:26 — forked from magnetikonline/README.md
Bash getopt long options with values usage example.
# Bash getopt long options with values usage example
```sh
#!/bin/bash -e
ARGUMENT_LIST=(
"arg-one"
"arg-two"
"arg-three"
)
@WiseScripts
WiseScripts / ANSI.md
Created February 4, 2024 09:55 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27