Skip to content

Instantly share code, notes, and snippets.

View matcap's full-sized avatar

Matteo Cappelletti matcap

View GitHub Profile
@matcap
matcap / fancontrol.py
Created July 27, 2017 21:43
Nvidia fan curve script
#!/usr/bin/python3
import subprocess as sp
import time
import sys
import re
def exec_cmd(cmd):
proc = sp.Popen(cmd, shell=True, stdout=sp.PIPE)
res = proc.communicate()
out = res[0].decode(sys.stdout.encoding)
@matcap
matcap / KillerDaemon.cpp
Created May 30, 2017 13:25
A simple process killer for Windows.
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <chrono>
#include <iomanip>
#include <map>
#include <Windows.h>
#include <TlHelp32.h>
using namespace std;
@matcap
matcap / geoip.py
Created September 16, 2016 17:08
Python IP geolocator
# Small python program to retrieve location and/or
# other infos about a internet address.
# Requires python3 and requests library.
# Thanks to freegeoip.net for its free JSON API.
import requests
import sys
GEOIP_URL = "http://freegeoip.net/json/"
arg_options = []