Skip to content

Instantly share code, notes, and snippets.

View bisko's full-sized avatar

Biser Perchinkov bisko

View GitHub Profile
@bisko
bisko / Outputs.txt
Last active November 15, 2019 12:29
Fan Controller code
esptool.py v2.6
Serial port /dev/cu.usbserial-A800evSx
Connecting........___
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 3c:71:bf:0d:4d:38
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
watch -n1 -x hidutil property -m '{"ProductID":592, "VendorID":1452}' --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064}]}'

Keybase proof

I hereby claim:

  • I am bisko on github.
  • I am bisko (https://keybase.io/bisko) on keybase.
  • I have a public key ASAQuj-JHtD7Lvz2IZuydR82qVQ8M1Qsrq10RuSTxKO3QAo

To claim this, I am signing this object:

@bisko
bisko / motion_watchdog_monitor.php
Created February 23, 2017 16:55
Monitors the `motion` process because it crashes at certain intervals
<?php
$ts = (int)file_get_contents('/tmp/wd_mt');
if (time() - 60 < $ts) {
exit();
}
do {
file_put_contents('/tmp/wd_mt', time());
@bisko
bisko / is_wp_site.php
Created February 2, 2017 12:49
Check if a site is a WordPress site. Does only basic checks and doesn't check the site endpoints.
<?php
$list = [
'https://ma.tt',
'https://google.com',
'https://wordpress.org'
];
function is_wp_site( $site ) {
@bisko
bisko / autoconnect.py
Created August 15, 2016 14:05
Python scan and autoconnect to devices
import dbus
import bluetooth
import sys
import subprocess
# Hardcoded devices, order is the priority
devices = ["C8:85:50:88:30:ED", "FC:64:BA:0E:C0:10"]
has_connected = False
@bisko
bisko / detect_real_audio_stream_url.php
Created January 16, 2016 12:42
Detect real URL behind an audio stream.
<?php
/**
* The idea behind this is that I had to check several hundred streams
* and validate their URLs if they contain valid stream or not.
* If they didn't - fix it.
*
* It is best to automate such things, so the code below does that.
* It's basic - detects mostly shoutcast/icecast streams and .as[fx], .m3u8? playlists
*/
@bisko
bisko / bitbucket-deploy-webhook.php
Last active August 29, 2015 14:25
A bitbucket deploy webhook, that respects ssh keys for a user without shell on the server.
<?php
/**
* Got the code and idea from http://jonathannicol.com/blog/2013/11/19/automated-git-deployments-from-bitbucket/
*
* Had to change the way the keys are loaded, as the www-data user on my host didn't have shell
*/
// where is the git repo located
@bisko
bisko / gist:729498
Created December 5, 2010 21:41
Pretty bad way of skipping the first load of an iframe...
var hiddenIfr = document.getElementById('hiddeniframepopup');
if (hiddenIfr) {
hiddenIfr.onload = function() {
this.onload = function () {
ifr.innerHTML = this.contentDocument.body.innerHTML;
}
}
}