Skip to content

Instantly share code, notes, and snippets.

View shakahl's full-sized avatar
:electron:

Soma Szelpal shakahl

:electron:
View GitHub Profile
@shakahl
shakahl / portainer-docker-stack.yml
Created May 10, 2024 09:54
portainer-docker-stack.yml
---
# docker network create -d overlay --attachable public
# docker stack deploy portainer -c portainer-agent-stack.yml
version: '3.9'
x-default-opts:
&default-opts
logging:
@shakahl
shakahl / windows-ssh-no-password-with-keys-wsl2.md
Created April 23, 2024 21:02 — forked from adamelliotfields/windows-ssh-no-password-with-keys-wsl2.md
Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

Disclaimer: I am not a Windows Admin and I'm not even that good with PowerShell.

I wanted to be able to SSH into my Windows laptop directly into Linux. I also wanted to disable password authentication and only allow public key (RSA in my case) authentication.

Scott Hanselman wrote a blog post on how to make your default WSL2 distro your default shell for SSH. Windows OS Hub published an article on using public key

@shakahl
shakahl / Encrypt-Decrypt-WithDotNet.ps1
Created April 1, 2024 17:13 — forked from PanosGreg/Encrypt-Decrypt-WithDotNet.ps1
Encryption & Decryption using native .NET classes
## Encryption & Decryption using native .NET functions
## This is Symetrical encryption. Which means the same key is used to both encrypt and decrypt.
## The encryption method is based on AES 256bit.
## The major difference between this option and the ConvertFrom/To-SecureString functions
## is that this way produces much smaller encrypted files.
## I have not compared the 2 options in regards to performance though, as-in which one is faster.
@shakahl
shakahl / emojis.sh
Created March 27, 2024 20:56 — forked from BuonOmo/emojis.sh
A list of all UTF-8 emojis in bash or zsh
# Obtained with the code written in next file
emoji_grinning_face=😀
emoji_grinning_face_with_big_eyes=😃
emoji_grinning_face_with_smiling_eyes=😄
emoji_beaming_face_with_smiling_eyes=😁
emoji_grinning_squinting_face=😆
emoji_grinning_face_with_sweat=😅
emoji_rolling_on_the_floor_laughing=🤣
emoji_face_with_tears_of_joy=😂
emoji_slightly_smiling_face=🙂
@shakahl
shakahl / apktool.bat
Created March 6, 2024 21:48 — forked from barbietunnie/apktool.bat
Windows/Mac wrapper script for Apktool
@echo off
if "%PATH_BASE%" == "" set PATH_BASE=%PATH%
set PATH=%CD%;%PATH_BASE%;
java -jar -Duser.language=en "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9
@shakahl
shakahl / stack.sh
Created March 5, 2024 13:43 — forked from bmc/stack.sh
A stack implementation, in bash
# A stack, using bash arrays.
# ---------------------------------------------------------------------------
# Create a new stack.
#
# Usage: stack_new name
#
# Example: stack_new x
function stack_new
{
@shakahl
shakahl / exit.js
Created March 4, 2024 12:51
NodeJS - workaround for tty output truncation upon process.exit() call #nodejs #node #javascript #workaround #hack #tty
// workaround for tty output truncation upon process.exit()
// https://github.com/nodejs/node/issues/6456
[process.stdout, process.stderr].forEach((s) => {
s && s.isTTY && s._handle && s._handle.setBlocking &&
s._handle.setBlocking(true)
});
@shakahl
shakahl / queryAll.js
Created March 3, 2024 15:45 — forked from dalgard/queryAll.js
Efficient wrapper for document.querySelectorAll
// Always return an array of DOM elements
function queryAll(selector) {
var id_sel = selector.match(/^#([\w-]*)$/),
class_sel = !id_sel && selector.match(/^\.([\w-]+)$/),
tag_sel = !class_sel && selector.match(/^[\w-]+$/);
if (id_sel) {
var elem = document.getElementById(id_sel[1]);
return (elem ? [elem] : []); // Always return an array
}
@shakahl
shakahl / adjectives.txt
Last active February 1, 2024 20:16
#ubuntu name #generator written in #js
Wonderful
Woolly
Xanthic
Xenodochial
Xenolithic
Xenophobic
Xenial
Xeric
Xintillating
Xiphoid
@shakahl
shakahl / adjectives.txt
Created February 1, 2024 19:03 — forked from ysbaddaden/adjectives.txt
Generate Ubuntu-like release names
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate