Skip to content

Instantly share code, notes, and snippets.

@luisnquin
luisnquin / INSTRUCTIONS.md
Created April 10, 2022 19:20
Create battery limit on ASUS
  • Name as battery-charge-threshold.service and move to /etc/systemd/system

  • CHARGE_STOP_THRESHOLD -> Battery limit [0-100]

  • BATTERY_NAME -> Obtained from $ ls /sys/class/power_supply. Example: BAT0, BAT1 and BATT.

Then, run:

$ sudo systemctl enable battery-charge-threshold.service
@luisnquin
luisnquin / script.bash
Created November 26, 2022 06:45
Bash script that runs swagger-editor in docker and waits for signal SIGINT to kill and remove containers
main() {
docker_command="docker run -d -p 80:8080 "
if [[ $1 != "" ]]; then
absolute_path=$(realpath "$1")
dir=$(dirname "$absolute_path")
docker_command+="-v $dir:/tmp -e SWAGGER_FILE=/tmp/$1 "
fi
@luisnquin
luisnquin / scrapping.zsh
Created January 4, 2023 12:40
Bash script to get the current billboard of cinerama in your city
# You can extract your own 'city' value from 'http://www.cinerama.com.pe/cines'
curl --silent http://www.cinerama.com.pe/cartelera_cine/{city} | htmlq --text .row .container .card .card-header | sed 's/.*/\L&/; s/[a-z]*/\u&/g'
@luisnquin
luisnquin / mic-toggle-notify.bash
Created April 7, 2023 04:27
Little script to mute/unmute global microphone using amixer and notify-send
microphone_state=''
if [[ $(output=$(amixer set Capture toggle); echo "$output" | grep -m 1 --fixed-strings --only-matching '[on]') ]]; then
microphone_state=unmuted;
else
microphone_state=muted; fi
notify-send "Global microphone state: $microphone_state" "Triggered by keybinding (Ctrl + Alt + M)" --app-name=System --expire-time=2500 --urgency=normal
@luisnquin
luisnquin / sustainPlusPlus.java
Created August 12, 2023 01:14 — forked from MikuroXina/sustainPlusPlus.java
Mili - sustain++; / Ghost In The Shell: SAC_2045 Ending Theme
package extraLarge;
/**
* The goal of this program is to obtain a HEALTHY
* and SUSTAINABLE relationship, darling.
*
* @author Cassie Wei from Mili
*/
public class sustainPlusPlus {
public static void main(String[] args) {
@luisnquin
luisnquin / i3-shortcuts-screenshot.md
Created August 30, 2023 18:38 — forked from dianjuar/i3-shortcuts-screenshot.md
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots