Skip to content

Instantly share code, notes, and snippets.

@Saya47
Saya47 / tmux.md
Created April 23, 2024 12:46 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
@Saya47
Saya47 / promiseAll.js
Created April 17, 2024 18:44 — forked from priteshjha4u/promiseAll.js
Promise.all implementation in vanilla JavaScript
function promiseAll() {
if (!arguments.length) {
return Promise.resolve(null);
}
var args = arguments;
if (args.length === 1 && Array.isArray(args[0])) {
args = args[0];
}
var count = 1;
var total = args.length;
@Saya47
Saya47 / test_dll.c
Created April 13, 2024 21:37 — forked from Homer28/test_dll.c
DLL code for testing CVE-2024-21378 in MS Outlook
/**
* This DLL is designed for use in conjunction with the Ruler tool for
* security testing related to the CVE-2024-21378 vulnerability,
* specifically targeting MS Outlook.
*
* It can be used with the following command line syntax:
* ruler [auth-params] form add-com [attack-params] --dll ./test.dll
* Ruler repository: https://github.com/NetSPI/ruler/tree/com-forms (com-forms branch).
*
* After being loaded into MS Outlook, it sends the PC's hostname and
@Saya47
Saya47 / config.json
Created April 13, 2024 19:21 — forked from usshen/config.json
v2ray; socks outbound; netflix outbound
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warn"
},
"inbounds": [
{
"port": 443,
"tag": "itor",
@Saya47
Saya47 / vhd4wsl2.md
Created March 20, 2024 11:39 — forked from lseongjoo/vhd4wsl2.md
Creating virtual hard disk (VHD) for WSL2

Creating additional virtual hard disk (VHDX) for WSL2 with ext4 filesystem

Lines starting with # mean the commands have to be executed by root user under Linux shell (WSL distro). All other commands have to be executed under Windows-PowerShell as Administrator.

Make VHDX disk file and mount it under Windows

New-VHD support.vhdx -SizeBytes 25GB -Dynamic -BlockSizeBytes 1MB
Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path support.vhdx -PassThru | Get-Disk).Number)"
@Saya47
Saya47 / Anaconda PowerShell Prompt in Windows Terminal settings.json Add an "Anaconda PowerShell Prompt" profile to Windows Terminal. Just paste it in your settings.json file.
{
"colorScheme": "Campbell",
"commandline": "pwsh.exe -ExecutionPolicy ByPass -NoExit -Command \"& '%USERPROFILE%\\anaconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%USERPROFILE%\\anaconda3' \"",
"guid": "{e7d34d61-5a57-4f38-8eab-91cb777b0c26}",
"hidden": false,
"icon": "%USERPROFILE%\\anaconda3\\Menu\\anaconda-navigator.ico",
"name": "Anaconda PowerShell Prompt",
"startingDirectory": "%USERPROFILE%"
}
@Saya47
Saya47 / gist:5b50bc3df7c981f07a936bddfd5b3c54
Created February 20, 2024 10:54 — forked from jgould22/gist:f42ad756fc07143e2a104d7844f39b12
Redis 7 Fluent-Bit Log parsing regex
# This is a partial regex to split a redis log line
# It will parse
# Pid
# The role (X, C, S, or M - https://github.com/redis/redis/blob/unstable/src/server.c#L130)
# Time
# level (.,-,*,# which are LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING respectively - https://github.com/redis/redis/blob/unstable/src/server.c#L104)
# Message
[PARSER]
Name redis
@Saya47
Saya47 / fluent-filebeat-comparison.md
Created February 20, 2024 10:27 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@Saya47
Saya47 / wall.sh
Created February 15, 2024 13:20 — forked from danmou/wall.sh
Replacement for the unix wall command, which also works with gnome-terminal
#!/bin/bash
usage="
Usage:
wall [options] [message]
Write a message to all users.
Options:
-n, --nobanner do not print banner