Skip to content

Instantly share code, notes, and snippets.

View meetnick's full-sized avatar

Niccola meetnick

  • Belo Horizonte, MG - Brazil
View GitHub Profile

For my reference in the future I will record here the steps that I had to follow in order to install Openwrt on the tp-link router EX220. This was done using a Windows 11 machine.

Disclaimer: Use this tutorial at your own risk. We are not responsible for any damage/harms done to your device using the information from this tutorial.

Steps to install OpenWRT on EX220 router

OEM installation using the serial + TFTP method

These are the steps provided at the official https://openwrt.org/toh/tp-link/ex220_v1 page:

@meetnick
meetnick / Encryption.md
Last active June 4, 2024 19:47
ROG Zephyrus M16 on Linux
@meetnick
meetnick / Windows.md
Last active April 18, 2024 20:58
ASUS ROG Zephyrus M16 Tweak guide

As some people reported sleep-related problems and also other issues with the M16, which I also encountereed on my own and fixed on my device, I decided to write this down so that everyone with these problems can fix them on their machine if they run into them.

Some of them are also just features that some people are unaware of.

These fixes mostly involve changes in Windows Power Plan and Registry. I only tested them for Windows 10 for the Zephyrus M16 2021, but I'm sure they also work for Windows 11 and also for the 2022 version.

Note: My Windows is set to German. I took the English names for the power plan settings out of the registry. They might be called different depending on language settings. The names of the registry keys themselves are unaffected by your language setting.

@meetnick
meetnick / configure_ac_change_script.sh
Last active February 5, 2023 22:41
Script to run when AC power supply state changes
#!/bin/sh
# create udev rule
sudo tee "/etc/udev/rules.d/60-ac-or-battery-change.rules" > /dev/null <<'EOF'
# Rule for when switching to battery
ACTION=="change",SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",ENV{DISPLAY}=":1",ENV{XAUTHORITY}="/run/user/1000/gdm/Xauthority",ENV{DBUS_SESSION_BUS_ADDRESS}="unix:path=/run/user/1000/bus",RUN+="/usr/bin/su niccola -c '/usr/bin/ac_change.sh 0'"
# Rule for when switching to powersupply
ACTION=="change",SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",ENV{DISPLAY}=":1",ENV{XAUTHORITY}="/run/user/1000/gdm/Xauthority",ENV{DBUS_SESSION_BUS_ADDRESS}="unix:path=/run/user/1000/bus",RUN+="/usr/bin/su niccola -c '/usr/bin/ac_change.sh 1'"
EOF
Add-Type -AssemblyName PresentationCore,PresentationFramework
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
$ErrorActionPreference = 'SilentlyContinue'
$wshell = New-Object -ComObject Wscript.Shell
$Button = [System.Windows.MessageBoxButton]::YesNo
$ErrorIco = [System.Windows.MessageBoxImage]::None
$Ask = 'Do you want to run this as an Administrator?
"Yes" to Run as an Administrator
@meetnick
meetnick / gist:b92caf5834f2fa0ec57032cb6872cdf2
Created December 30, 2021 13:52
Disable sound power save ubuntu
#!/bin/bash
# Check for current power save state
cat /sys/module/snd_hda_intel/parameters/power_save
cat /sys/module/snd_hda_intel/parameters/power_save_controller
# Immediately disable session power save
echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save
echo "0" | sudo tee /sys/module/snd_hda_intel/parameters/power_save_controller
# Disable power save forever
@meetnick
meetnick / gist:3984c3f81426103de71d7423bd3f1a20
Last active December 29, 2021 23:09
Improve Ubuntu audio quality
#!/bin/bash
# install pulseeffects
sudo apt-get install pulseeffects lsp-plugins -y
# run pulseeffects and reset to its defaults
pulseeffects -r &
#
# 1) Install all presets
# 2) Install Perfect EQ preset
@meetnick
meetnick / LineageOS Android Encryption fixing
Created April 7, 2021 20:03
This is a guide for allowing encryption with Android LineageOS
# DON'T ENCRYPT YOUR PHONE WITH ANY LOCK PATTERN SET (e.g. PIN) BEFORE YOU FOLLOW THIS GUIDE
# Enter terminal (Example TWRP -> Advanced -> Terminal) and type:
df
# df output example:
# Filesystem 1K-blocks Used Available Use% Mounted on
# /dev/block/mmcblk0p12 12324784 546144 60353600 4% /data
# From the above output, we have to remember the mmcblk block and partition numbers (/dev/block/mmcblk0p12).
# Also need to remember 1K-blocks value amount (12324784)
# Now umount /data in TWRP. For this, go to Mount > deselect Data
@meetnick
meetnick / gist:c52b4b8f31069ad40dfe52013c08dceb
Created March 9, 2021 21:12
mecool file for coreelec compatibility for A95X F3 Air Remote Control
# table mecool, type: NEC
0xdf54 KEY_1
0xdf16 KEY_2
0xdf15 KEY_3
0xdf50 KEY_4
0xdf12 KEY_5
0xdf11 KEY_6
0xdf4c KEY_7
0xdf0e KEY_8
0xdf0d KEY_9
@meetnick
meetnick / gist:a0b4d630077bdd94ff42b4f53e429e62
Created March 9, 2021 16:40
A95X F3 Air Remote Control keycode mapping
5211.503965: event type EV_MSC(0x04): scancode = 0xdf1a UP
5246.296039: event type EV_MSC(0x04): scancode = 0xdf48 BOTTOM
5258.109775: event type EV_MSC(0x04): scancode = 0xdf07 RIGHT
5266.236036: event type EV_MSC(0x04): scancode = 0xdf47 LEFT
5274.196059: event type EV_MSC(0x04): scancode = 0xdf06 ENTER
5285.972336: event type EV_MSC(0x04): scancode = 0xdf0a BACK
5298.872040: event type EV_MSC(0x04): scancode = 0xdf42 HOME
5307.768721: event type EV_MSC(0x04): scancode = 0xdf5d VOL UP
5315.618840: event type EV_MSC(0x04): scancode = 0xdf5c VOL DOWN
5335.712039: event type EV_MSC(0x04): scancode = 0xdf4f NETFLIX