Skip to content

Instantly share code, notes, and snippets.

View albert2lyu's full-sized avatar

albert albert2lyu

  • code copilot
  • shenzhen
View GitHub Profile
@albert2lyu
albert2lyu / check_vpn.py
Created August 20, 2016 03:57 — forked from greatghoul/check_vpn.py
选择最快的 VPN 服务
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
copyright (c) 1989 by The Regents of the University of California.
That code is in turn derived from code written by Mike Muuss of the
US Army Ballistic Research Laboratory in December, 1983 and
placed in the public domain. They have my thanks.
# coding: utf-8
# http://forums.fedoraforum.org/showthread.php?t=272322
import os
import uuid
import fnmatch
import subprocess
CURRENT_DIR = os.path.dirname(__file__)
CFG_DIR = '/etc/NetworkManager/system-connections'
@albert2lyu
albert2lyu / xpad.c
Created December 18, 2016 22:30 — forked from anonymous/xpad.c
xpad.c to emulate keyboard
/*
* Xbox input device driver for Linux - v0.1.6
*
* Copyright (c) 2002 - 2004 Marko Friedemann <mfr@bmx-chemnitz.de>
*
* Contributors:
* Vojtech Pavlik <vojtech@suse.sz>,
* Oliver Schwartz <Oliver.Schwartz@gmx.de>,
* Thomas Pedley <gentoox@shallax.com>,
* Steven Toth <steve@toth.demon.co.uk>,