Skip to content

Instantly share code, notes, and snippets.

@shyba
shyba / openwrt-cheatsheet.md
Last active December 30, 2022 19:07
Openwrt cheatsheet for stuff I do often

Openwrt cheatsheet for stuff I do often

set router ip address and bring network up

uci set network.lan.ipaddr=x.x.x.x
uci commit
ifup lan
@shyba
shyba / pomodoro.py
Created August 6, 2018 19:07
quick pomodoro with libnotify and python
# sudo apt install libnotify-bin libnotify-dev python-gobject
# python pomodoro.py "do homework"
import sys
from time import sleep
from gi.repository import Notify
Notify.init("App Name")
Notify.Notification.new(sys.argv[-1]).show()
Notify.Notification.new("Pomodoro Start!").show()
for i in range(25):
@shyba
shyba / watchdog.py
Last active December 30, 2022 19:09
simple watchdog to detect reactor blocked periods
import time
import sys
import inspect
from twisted.internet.task import LoopingCall
from twisted.internet import reactor
from twisted.internet.threads import deferToThread
from twisted.logger import textFileLogObserver
from twisted.python import log
log.addObserver(textFileLogObserver(sys.stdout))
@shyba
shyba / reset_tags.py
Created October 6, 2014 15:32
Pixelated Dev - Resets all tags and clear the index for testing purposes.
import os
from flask import Flask
from pixelated.adapter.pixelated_mail_sender import PixelatedMailSender
from pixelated.adapter.pixelated_mailboxes import PixelatedMailBoxes
import pixelated.reactor_manager as reactor_manager
import pixelated.bitmask_libraries.session as LeapSession
from pixelated.adapter.mail_service import MailService
from pixelated.adapter.pixelated_mail import PixelatedMail
from pixelated.adapter.soledad_querier import SoledadQuerier