Skip to content

Instantly share code, notes, and snippets.

View CyberShadow's full-sized avatar

Vladimir Panteleev CyberShadow

View GitHub Profile
@Peetz0r
Peetz0r / tablet-switch.py
Created October 14, 2017 08:40
Disables touchpad and trackpoint on ThinkPad Yoga 370 (and possibly others)
#!/usr/bin/python3
from evdev import InputDevice
from syslog import syslog
switch = InputDevice('/dev/input/by-path/platform-thinkpad_acpi-event')
trackpoint = InputDevice('/dev/input/event4')
touchpad = InputDevice('/dev/input/event5')
print(switch)
@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
@CyberShadow
CyberShadow / hvalue.d
Created September 8, 2011 20:30
hvalue - show an integer constant from a C header file
// rm hvalue* ; wget --no-check-certificate https://raw.github.com/gist/1204580/hvalue.d ; dmd hvalue.d
import std.stdio, std.file, std.process, std.exception;
void cleanup()
{
try
foreach (fn; listDir("", "hvalue-test*"))
remove(fn);
catch {}