Skip to content

Instantly share code, notes, and snippets.

Avatar
😑
Expressionless master

m3nda erm3nda

😑
Expressionless master
  • n0n3
  • localhost
View GitHub Profile
@erm3nda
erm3nda / ssh-persistent-tunnel.service
Created Mar 12, 2021
SSH permanent tunnel service
View ssh-persistent-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 Jan 20, 2021
Run steam game without evelevated privileges
View steam_launch_params_for_games_without_admin
; 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
erm3nda / javascript_bottom_alert.js
Created Oct 12, 2020
Javascript code to detect when we are at bottom of the scroll
View javascript_bottom_alert.js
window.onscroll = function() {
// @var int totalPageHeight
var totalPageHeight = document.body.scrollHeight;
// @var int scrollPoint
var scrollPoint = window.scrollY + window.innerHeight;
// check if we hit the bottom of the page
if(scrollPoint >= totalPageHeight)
@erm3nda
erm3nda / universal_blinking_led_arduino_example.ino
Created Aug 18, 2020
Arduino blinking led example but fixed to work also on boards with less PIN, ie attiny85 #arduino #c
View universal_blinking_led_arduino_example.ino
#include <Arduino.h>
// Attiny85 doesn't have nor recognize LED_BUILTIN 13 from Arduino.h
// Little fix to enable led blink with a LED on PIN 3 + GND to test boards.
#ifndef LED_BUILTIN
#define LED_BUILTIN 3
#endif
void setup() {
// initialize digital pin LED_BUILTIN as an output.
@erm3nda
erm3nda / mpv-http-ipc-json-flask-interface.py
Created Aug 6, 2020
This code shows how to create an https interface and listen for queries, then filter and pass them to ipc server running locally #python #mpv
View mpv-http-ipc-json-flask-interface.py
#!/usr/local/env python
# coding: utf8
from flask import Flask, jsonify, request
import os, subprocess
# La creación manual de certificados la reemplazo por ssl_context="adhoc" que está integrado en flask y funciona onthefly
# el problema del adhoc es que genera un nuevo cert cada vez que se lanza, y eso es un rollo si accedemos con un browser, por ejemplo
'''
@erm3nda
erm3nda / mpv-http-ipc-json-flask-bridge.py
Created Aug 6, 2020
This code shows how to create an https bridge with flask that sends json commands from network to json ipc server running locally #python #mpv
View mpv-http-ipc-json-flask-bridge.py
#!/usr/local/env python
# coding: utf8
from flask import Flask, jsonify, request, abort
import os, subprocess, json
ASSETS_DIR = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__)
@erm3nda
erm3nda / dual_screen_elantech.sh
Created Jul 24, 2020
Configure touchscreen area of touch device when having dual screen
View dual_screen_elantech.sh
# configure touchscreen area properly
pointer_id=`xinput | grep ELAN | cut -d " " -f30 | egrep -o '[0-9]{2}'`
xinput map-to-output $pointer_id eDP1
@erm3nda
erm3nda / x360 chinesses usb receiver install.md
Created Jul 23, 2020
Como instalar el receptor chino de Xbox 360 wireless en Win10
View x360 chinesses usb receiver install.md
@erm3nda
erm3nda / init.sh
Last active Jul 22, 2020 — forked from ebuildy/init.sh
Setting PHP stream context from system env
View init.sh
echo "auto_prepend_file=/opt/www/proxy.php" >> /etc/php/php.ini
@erm3nda
erm3nda / kivy_install.bat
Created Jul 22, 2020
Install Kivy on Windows #python #kivy
View kivy_install.bat
pip install --upgrade pip wheel setuptools
pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
pip install kivy.deps.gstreamer
pip install kivy.deps.angle
pip install kivy