Skip to content

Instantly share code, notes, and snippets.

View mauron85's full-sized avatar

Marián Hello mauron85

View GitHub Profile
@mauron85
mauron85 / create_new_firmware.sh
Created September 8, 2019 19:16 — forked from tuyenld/Original_vs_Mod_Chip.md
2019-02-11-upgrade-flash-chip-tplink-tl-wr840n-4mb-to-8mb
set -e
flash_size_in_MB=8
sysupgrade_OpenWRT="openwrt-18.06.1-ramips-mt76x8-tl-wr840n-v5-squashfs-sysupgrade.bin"
art_file="upload_openwrt_art.bin"
boot_loader="upload_openwrt_mtd0.bin"
sysupgrade_OpenWRT_size=$(wc -c $sysupgrade_OpenWRT | cut -f 1 -d " ")
art_file_size=$(wc -c $art_file | cut -f 1 -d " ")
boot_loader_size=$(wc -c $boot_loader | cut -f 1 -d " ")
@mauron85
mauron85 / dd-wrt-transparent-proxy.sh
Last active October 22, 2023 11:57
Transparent proxy for openwrt using tinyproxy & redsocks
#!/bin/sh
# https://crosp.net/blog/administration/routing-network-traffic-through-socks5-proxy-using-dd-wrt/
# https://serverfault.com/questions/200635/best-way-to-clear-all-iptables-rules
PROXIFYING_MACHINE=192.168.82.192
MACHINE_TO_PROXIFY=192.168.83.0/24
NETWORK=192.168.83.0/24
WAN_IP=192.168.81.1
iptables -I PREROUTING 1 -t mangle -s $MACHINE_TO_PROXIFY ! -d $NETWORK -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
@mauron85
mauron85 / README.md
Last active October 28, 2023 03:41 — forked from maxfierke/README.md
PM2 as a Windows Service under Local Service

PM2 as a Windows Service under Local Service

This is a PoC for running PM2 as a Windows Service under the Local Service account instead of the Local System account.

Prerequsites

  • Neither pm2 or pm2-windows-service installed yet. (The Powershell script will run npm i)
    • At the very least, you should run pm2-service-uninstall before running this script
  • npm and npm-cache global folders should be somewhere accessible to NT AUTHORITY\LocalService.

Keybase proof

I hereby claim:

  • I am mauron85 on github.
  • I am mauron85 (https://keybase.io/mauron85) on keybase.
  • I have a public key whose fingerprint is 51E5 E464 A1F7 A95D 19D2 0B68 2D4B 8B7A 972E 73AD

To claim this, I am signing this object:

@mauron85
mauron85 / .bash_profile
Last active December 21, 2018 17:54
my macOS bash profile
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# Retries a command a with backoff.
#
# The retry count is given by ATTEMPTS (default 5), the
# initial backoff timeout is given by TIMEOUT in seconds
# (default 1.)
#
# For the benefit of emacs users: -*- shell-script -*-
#
# Put this file into $HOME folder
#
###########################
# xbindkeys configuration #
###########################
# Spotify Play/Pause on Keyboard #1 shortcut key
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
@mauron85
mauron85 / resume.sh
Last active December 15, 2018 11:09
Resume curl download with filename detection and resume on libssl error
# Retries a command a with backoff.
#
# The retry count is given by ATTEMPTS (default 5), the
# initial backoff timeout is given by TIMEOUT in seconds
# (default 1.)
#
# Successive backoffs double the timeout.
#
# Beware of set -e killing your whole script!
#
#!/bin/bash
# (@) start-android
# If the emulator command exists on this device, displays a list of emulators
# and prompts the user to start one
# Original source: https://stackoverflow.com/a/41437075/3896616
function assert_sdk {
command -v $1 > /dev/null || {
echo >&2 "Executable \"$1\" not present in your system.";
echo "Did you installed android sdk? Aborting.";
@mauron85
mauron85 / xcode-refactor.js
Last active April 28, 2018 20:55
Refactor xcode project files - add class prefix
const fs = require('fs');
const path = require('path');
const DIRECTORIES = ['BackgroundGeolocation', 'BackgroundGeolocationTests'];
const PBX_PROJ = path.join('BackgroundGeolocation.xcodeproj', 'project.pbxproj');
const PREFIX = 'MAUR';
const FILENAME_INCLUDE_CRITERIA = [
/\.h$/,
/\.m$/,
];
function find() { unset -f $0; find $1 -newermt $(date +%Y-%m-%d -d "$2"); };
function dayago() { unset -f $0; __find $1 "1 day ago"; };
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
alias server='python -m SimpleHTTPServer'
alias trash='gvfs-trash'
alias ipconfig='ip address show'
alias suspend='systemd-run --on-active=30 systemctl suspend'