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 / restoreAffinity.ps1
Last active May 16, 2024 00:59
Sets all processes affinity to half of cores and give ROE High priority #powershell
# elevate privileges if we are not running as Administrator, so we can set affinity of Windows owned processes
# source:
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
erm3nda /
Last active January 1, 2024 11:19
Google Images Reverse Search - Python & Selenium
#!/usr/local/env python
# -*- coding: utf-8 -*-
# autor: erm3nda at gmail
# website:
# searchs for content inside an image, then compares to a string, example, looking for cat inside a picture (PetFinder)
# if geany: Geany (f5) ads custom params when executes file, remove them if you don't wanna see errors or play yourself with term
import os, sys, re
import selenium, base64, time
from selenium import webdriver
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 / javascript-check.php
Last active May 9, 2023 20:39
Check if javascript is enabled from the PHP server
* The simplest way i found to check javascript vía PHP
* Not to run code if javascript, to tell server if a client
* has enabled Javascript. Check at $_SESSION['js'] for 1/0 true/false
* Need cookie to run
* I've not wrapped into a class nor a function because lazy
* It's easy too to put a include_once("javascript-check.php")
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 / 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%"
erm3nda /
Last active March 27, 2023 11:41
Creates and serves a fresh wordpress sqlite powered install from scratch
# wp-cli basic install script with sqlite database.
# requires installing wp-cli.phar following instructions from
# Download wp-package, by default does download en_US package (--locale="en_US")
wp core download --locale="es_ES"
# U can later install another language package
# wp core language es_ES --activate
erm3nda / clipboard.js
Created July 2, 2019 14:48
Clipboard Javascript
// Compatible for most of the current browsers
function copyText(text){
function selectElementText(element) {
if (document.selection) {
var range = document.body.createTextRange();
} else if (window.getSelection) {
var range = document.createRange();
erm3nda /
Last active January 13, 2023 11:29
Python logging wrapper with rotating file and stream handlers
#!/usr/local/env/ python
# -*- coding:utf-8 -*-
The current config creates 2 logs/handlers with script name as base and "logs" folder to store
The streamhandlers is the CLI output, defaulted to level INFO and up.
The filehandler is rotating, 5mb with up to 3 rotations, defaulted to level DEBUG and up.
If you don't want to see that much INFO logs in your screen, just set it to logging.WARNING level
To use the name of other module importing this, init like 'log = logger(fileName=__file__)'
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.
If (GetKeyState("LAlt", "P") && GetKeyState("CapsLock", "P") && WinActive("ahk_exe WW3-Win64-Shipping.exe")){
Sleep 200
Send "{Space down}"