Skip to content

Instantly share code, notes, and snippets.

@gndu91
gndu91 / simulate.py
Created December 27, 2017 11:23 — forked from wgm89/simulate.py
python simulate keybord
import ctypes
LONG = ctypes.c_long
DWORD = ctypes.c_ulong
ULONG_PTR = ctypes.POINTER(DWORD)
WORD = ctypes.c_ushort
class MOUSEINPUT(ctypes.Structure):
_fields_ = (('dx', LONG),
('dy', LONG),
@gndu91
gndu91 / ctype_async_raise.py
Created April 2, 2018 13:46 — forked from liuw/ctype_async_raise.py
Nasty hack to raise exception for other threads
#!/usr/bin/env python
# liuw
# Nasty hack to raise exception for other threads
import ctypes # Calm down, this has become standard library since 2.5
import threading
import time
NULL = 0
@gndu91
gndu91 / keybase.md
Last active October 4, 2018 19:44
Keybase proof

Keybase proof

I hereby claim:

  • I am gndu91 on github.
  • I am ghouln (https://keybase.io/ghouln) on keybase.
  • I have a public key ASAYiShUahZKRaYHJNarF69dAH9ZWDSTVLDH_jgEulPK8wo

To claim this, I am signing this object:

@gndu91
gndu91 / .gitignore
Created January 31, 2019 11:42 — forked from chichunchen/.gitignore
Git ignore binary files
# Ignore all
*
# Unignore all with extensions
!*.*
# Unignore all dirs
!*/
### Above combination will ignore all files without extension ###
@gndu91
gndu91 / complete.py
Created January 5, 2020 20:04
Python script to implement bash completion (tested only on Ubuntu 18.04 and python 3.8).
"""
Example:
python3 complete.py define my_command
- Define this script as the handler in .bashrc
- Note: this will overwrite any previous handler
python3 complete.py undef my_command
- Remove it from .bashrc
python3 complete.py complete <current_word> <full_line>
@gndu91
gndu91 / partition_watchdog.py
Created March 18, 2020 15:14
Watch for mounted/unmounted partitions.
#!/usr/bin/python3
import enum
import hashlib
import os
import threading
import time
from ast import literal_eval
from functools import partial
@gndu91
gndu91 / temperature.sh
Last active July 21, 2021 00:11 — forked from corneliusroemer/temperature.sh
Get list and temperature of CPU and battery temperature sensors via Android Debug Bridge
#run from terminal with: adb shell "$(cat temperature.sh)" to get list of temperature sensors and their temperature
#on Android devices
for VARIABLE in $(seq 1 80)
do
cat /sys/devices/virtual/thermal/thermal_zone$VARIABLE/type
cat /sys/devices/virtual/thermal/thermal_zone$VARIABLE/temp
done
@gndu91
gndu91 / ddnsserver.py
Created October 17, 2021 08:27 — forked from pklaus/ddnsserver.py
Simple DNS server (UDP and TCP) in Python using dnslib.py
#!/usr/bin/env python
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import argparse
import datetime
import sys
import time
import threading