Skip to content

Instantly share code, notes, and snippets.

redraw /
Created Mar 17, 2022
HTTP dump contents to files
#!/usr/bin/env python
# usage: mitmdump -s "~ts application/json"
# options:
# - dumper_folder: content dump destination folder (default: ./httpdump)
# - open_browser: open integrated browser with proxy configured at start (default: true)
# remember to add your own mitmproxy authorative certs in your browser/os!
# certs docs:
# filter expressions docs:
# brew install xbar jq
# pip install astro-cli
ASTRO=$(pyenv which astro)
$ASTRO --date "a week ago" -f json moon phases | jq -r "first | .emoji"
echo "---"
echo "phases | size=10"
View pedidosya.js
let more = true
let data = []
let offset = 0
while (more) {
console.log(`Fetch offset: ${offset}`)
var req = new XMLHttpRequest();"GET", `${offset}&countryId=3`, false);
let response = JSON.parse(req.responseText)
View gist:9a03245c5fd54a9902aa1d8a36b32169
curl -sL | htmlq "#content p:first-child" -tw | sed '/^$/d'
View sleep-battery-stats.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
redraw / battery-monitor
Last active Feb 19, 2022
View battery-monitor
# battery monitor systemd suspend/resume hook
KERNEL=$(uname -r)
BIOS=$(dmidecode -s bios-version)
log() {
cd /sys/class/power_supply
redraw / gist:f94756a2e2d9627d5af33731162b2d81
Last active Mar 5, 2021
el sr @ignaciovidal nos dejo manijas para repasar como funcionaba la herencia multiple en Python
View gist:f94756a2e2d9627d5af33731162b2d81
>>> class A():
...: def uno(self):
...: print("A uno")
>>> class B():
...: def uno(self):
...: print("B uno")
...: def dos(self):
...: print("B dos")
redraw / thinkpad-hotkeys
Last active Jan 25, 2021
Thinkpad T14 ACPI event/action hotkey
View thinkpad-hotkeys
# /etc/acpi/events/thinkpad-hotkeys
action=/etc/acpi/ %e
redraw / 10-hibernate.conf
Created Jan 15, 2021
hibernate kde neon
View 10-hibernate.conf
# particion swap size = ram
# gettear UUID con blkid
# en /etc/grub/default agregar,
# quiet splash resume=UUID=<UUID-swap-partition>
# sudo update-grub
# sudo vim /etc/polkit-1/localauthority.conf.d/10-hibernate.conf
[Re-enable hibernate by default for login1]
# sudo apt install jq wget curl
# usage: github-install user/repo
set -e
rm -rf $tmp