Skip to content

Instantly share code, notes, and snippets.

Avatar

alex-eri alex-eri

View GitHub Profile
View AD-BLOCKING FOR OPENWRT
# NOTICE: SSH ACCESS REQUIRED
# INSTALL nano AS AN ALTERNATIVE TO vi
opkg install nano
# PASTE THIS INTO /etc/rc.local BEFORE exit 0
sed -i -e `$i \logger _____Initializing the blocklist... &\n` /etc/rc.local
sed -i -e `$i \wget -O - "http://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasq&mimetype=plaintext" | sed 's/127.0.0.1/192.168.1.254/g' | grep -vE 'example.com' > /etc/dnsmasq.conf && /etc/init.d/dnsmasq restart &\n` /etc/rc.local
# CREATE /tmp/block.init
@jdkanani
jdkanani / notepad.html
Last active Dec 18, 2020 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
View notepad.html
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@glacjay
glacjay / tun-ping-win.py
Created Sep 19, 2010
Reading/Writing OpenVPN's TUN/TAP Device under Windows using Python.
View tun-ping-win.py
import _winreg as reg
import win32file
adapter_key = r'SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
def get_device_guid():
with reg.OpenKey(reg.HKEY_LOCAL_MACHINE, adapter_key) as adapters:
try:
@endolith
endolith / Readme.txt
Last active Jan 11, 2021
Gnome to Wine color scraper
View Readme.txt
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper
You can’t perform that action at this time.