This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fcntl | |
import os | |
import struct | |
import subprocess | |
# Some constants used to ioctl the device file. I got them by a simple C | |
# program. | |
TUNSETIFF = 0x400454ca | |
TUNSETOWNER = TUNSETIFF + 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
# Open file corresponding to the TUN device. | |
tun = open('/dev/tun0', 'r+b') | |
# Bring it up and assign addresses. | |
subprocess.check_call('ifconfig tun0 192.168.7.1 192.168.7.2 up', shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"exec" | |
"log" | |
"os" | |
"syscall" | |
"unsafe" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"exec" | |
"log" | |
"os" | |
) | |
func main() { | |
file, err := os.Open("/dev/tun0", os.O_RDWR, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- DOMAIN-SUFFIX, google.com, Proxy | |
- IP, 104.154.127.126, Spotify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name youtube playlist cleaner | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description add a filter button to filter out watched videos | |
// @author GlacJAY <glacjay@gmail.com> | |
// @match https://www.youtube.com/playlist?list=* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#inputlevel,2 | |
; Esc | LCtrl | |
$LCtrl:: | |
SetMouseDelay -1 | |
Send {Blind}{LCtrl DownR} | |
KeyWait, LCtrl | |
Send {Blind}{LCtrl up} | |
; MsgBox, %A_ThisHotkey%-%A_TimeSinceThisHotkey% | |
if (A_ThisHotkey="$LCtrl" and A_TimeSinceThisHotkey < 250) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# forked from https://github.com/yekingyan/rime-wubi-86-single/blob/master/wubi86_single.py | |
import re | |
INPUT_FILE_PATH = "wubi86.dict.yaml" | |
OUTPUT_FILE_PATH = "wubi86.dict.yaml.single" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<iframe :src="the_url" @load="onIframeLoad" /> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
the_url: "http://xxx.com/yyy", | |
some_id: 42 |
NewerOlder