Skip to content

Instantly share code, notes, and snippets.

View erm3nda's full-sized avatar
😑
Expressionless master

m3nda erm3nda

😑
Expressionless master
  • n0n3
  • localhost
View GitHub Profile
@erm3nda
erm3nda / OpenWithCode.reg
Created June 13, 2023 22:55
Lets you add the proper handler for Directory and Directory\Background types for VS Code
Windows Registry Editor Version 5.00
; Open files [HKEY_CLASSES_ROOT\*\shell\Open with VS Code] @="Edit with VS Code"
"Icon"="%LocalAppData%\\Programs\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"%LocalAppData%\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
@erm3nda
erm3nda / ww3_slide_helper.akh
Last active January 7, 2023 08:55
WW3 slide helper to continue sprinting after sliding.
; This modifies the behavior after slide, helps to continue sprinting after sliding.
; You can still press crouch manually while sliding to keep crouched after slide.
; You need to edit the key of slide (mine is LAlt) and maybe Space to jump ?.
; This is AutoHotkey v2 syntax
; All the close stuff is made to let Steam detect when the "game" has exit, which is the autohotkey process handle now.
~LAlt::{
If (GetKeyState("LAlt", "P") && GetKeyState("CapsLock", "P") && WinActive("ahk_exe WW3-Win64-Shipping.exe")){
Sleep 200
Send "{Space down}"
@erm3nda
erm3nda / asseto_corsa_x360_settings.txt
Last active May 25, 2022 21:32
List of x360 gamepad settings for Asseto Corsa
Speed Sensitivity=80%
Steering Speed=100
Gamma=2.4
Filter=0.82
Deadzone=0.23
@erm3nda
erm3nda / visitors.sh
Created May 8, 2022 08:11
Gives you accounting for unique visitors to given log file.
#!/bin/bash
# gives you accounting for unique visitors
cat $1 | cut -d" " -f1 | sort | uniq | wc -l
@erm3nda
erm3nda / userChrome.css
Created May 6, 2022 15:45
Fix Firefox window buttons decoration with css (because gtk themed)
hbox.titlebar-buttonbox {
appearance: none !important;
}
toolbarbutton.titlebar-button {
border-radius: 0px !important;
min-height: 45px !important;
}
@erm3nda
erm3nda / f4_close_windows_and_logout_kde_plasma
Created May 3, 2022 02:16
Give KDE Plasma same F4 shortcut behavior -> Close active window or gimme logout window
#!/bin/bash
xdotool getwindowfocus getwindowname | \
grep "Plasma" && \
qdbus org.kde.ksmserver /KSMServer logout 1 0 1 || \
xdotool getwindowfocus windowclose
@erm3nda
erm3nda / thread_kill.py
Created April 17, 2022 22:04
python thread kill with ctypes
import ctypes
def terminate_thread(thread):
"""Terminates a python thread from another thread.
:param thread: a threading.Thread instance
"""
if not thread.is_alive():
return
@erm3nda
erm3nda / compare_images.py
Created November 9, 2021 19:39
Compares images based on pixel modifications between original file (jpg,png) and converted an resized jpg from that original. Fixed RGBA problem when saving to JPEG with PIL.
import io
from PIL import Image
import numpy as np
def countDiff(img1, img2):
s = 0
if img1.size != img2.size or img1.getbands() != img2.getbands():
return -1
@erm3nda
erm3nda / ssh-persistent-tunnel.service
Created March 12, 2021 08:30
SSH permanent tunnel service
#Template SystemD service for a auto healing (reverse) SSH tunnel.
#Place this to /etc/systemd/system/ folder.
#Edit all values inside <>
#/etc/systemd/system/ssh-persistent-tunnel.service
#Edit the ports, remote user+host, and the key file.
#In the authorized_keys file on the other system, use something like this:
#<restrict,command="echo 'No Commands Allowed.'",port-forwarding,permitopen="localhost:22",permitlisten="localhost:5000">
[Unit]
Description=SSH Persistent Tunnel
@erm3nda
erm3nda / steam_launch_params_for_games_without_admin
Created January 20, 2021 04:23
Run steam game without evelevated privileges
; Steam launch params do not works if you don't include %command%, which represents the original launch arguments, ie: steam://rungameid/391540/
; If you remove the "" quotes and the start, you can't remove original cmd screen. That's why we use cmd + start, when cmd returns start, closes becase /C
cmd /min /C "set __COMPAT_LAYER=RunAsInvoker && start "" %command%"