Skip to content

Instantly share code, notes, and snippets.

@kolen
kolen / eac_log_to_musicbrainz_discid.py
Last active January 12, 2024 22:23
Reads EAC log, generates musicbrainz disc TOC listing for use as discid. Opens browser with discid query on musicbrainz.org.
#!/usr/bin/python
"""
Reads EAC log, generates musicbrainz disc TOC listing for use as discid.
Opens browser with discid query on musicbrainz.org.
Warning: may work wrong for discs having data tracks. May generate wrong results on other non-standard cases.
MIT License
Copyright (c) 2018 Konstantin Mochalov
@kolen
kolen / lookup_eac_log.html
Last active October 31, 2023 16:49
Lookup musicbrainz and freedb by EAC log
<!--
Lookup musicbrainz and freedb by EAC log.
MIT License
Copyright (c) 2018 Konstantin Mochalov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@kolen
kolen / zerokiller.py
Created March 15, 2012 08:02
Report for spam accounts with '0' name in twitter
#!/usr/bin/python
# Depends on tweepy
# easy_install tweepy
import tweepy
consumer_key=""
consumer_secret=""
access_token=""
access_token_secret=""
@kolen
kolen / dither.glsl
Created July 30, 2019 21:53
Simple dithering shader for godot engine
// Based on http://devlog-martinsh.blogspot.com/2011/03/glsl-dithering.html
shader_type canvas_item;
uniform float scale = 1.0;
float find_closest(int x, int y, float c0)
{
mat4 dither = mat4(vec4( 1.0, 33.0, 9.0, 41.0),
vec4(49.0, 17.0, 57.0, 25.0),
@kolen
kolen / gae_to_json.py
Last active November 11, 2020 18:43
Google app engine backup dump to json
import sys
import json
import datetime
sys.path.append('/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/')
from google.appengine.api.files import records
from google.appengine.datastore import entity_pb
from google.appengine.api import datastore
def extract(index):
raw = open('backups/2020-11-10T18:54:56_95621/default_namespace/all_kinds/output-'+str(index), 'r')
Analysis of sampling sudo (pid 20663) every 1 millisecond
Process: sudo [20663]
Path: /usr/bin/sudo
Load Address: 0x107424000
Identifier: sudo
Version: 86.50.1
Code Type: X86-64
Parent Process: zsh [20661]
Date/Time: 2020-01-07 19:59:14.114 +0300
Analysis of sampling login (pid 13098) every 1 millisecond
Process: login [13098]
Path: /usr/bin/login
Load Address: 0x10a645000
Identifier: login
Version: 790.50.6
Code Type: X86-64
Parent Process: sh [13097]
Date/Time: 2020-01-07 19:42:07.670 +0300
@kolen
kolen / mh-z14.rb
Created December 3, 2019 19:34
Read MH-Z14 CO2 sensor readings
#!/usr/bin/env ruby
# Read MH-Z14 CO2 sensor readings connected via serial port
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem "rubyserial", "0.6.0"
end
@kolen
kolen / gist:d75adef899ef44d05495986835565f1f
Created August 3, 2017 22:14
cmus freezes on mac os, coreaudio-related
(lldb) bt all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x0000000100520c22 libsystem_kernel.dylib`__psynch_mutexwait + 10
frame #1: 0x0000000100679dfa libsystem_pthread.dylib`_pthread_mutex_lock_wait + 100
frame #2: 0x00007fff8c485f60 CoreAudio`HALB_Mutex::Lock() + 72
frame #3: 0x00007fff8c4a389b CoreAudio`HALC_ProxyIOContext::GetPropertyData(AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, unsigned int&, void*) const + 737
frame #4: 0x00007fff8c49eaae CoreAudio`HALC_ShellObject::GetPropertyData(unsigned int, AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, unsigned int&, void*) const + 1200
frame #5: 0x00007fff8c49e284 CoreAudio`HAL_HardwarePlugIn_ObjectGetPropertyData(AudioHardwarePlugInInterface**, unsigned int, AudioObjectPropertyAddress const*, unsigned int, void const*, unsigned int*, void*) + 232
frame #6: 0x00007fff8c49dfeb CoreAudio`HALPlugIn::ObjectGetPropertyData(HALObject co
@kolen
kolen / Cargo.toml
Created July 23, 2019 17:08
Rust Image library test cases for iteration methods on ImageBuffer with zero width and/or height causing 'chunk_size != 0' panic
[package]
name = "image-iter-panic-demo"
version = "0.1.0"
edition = "2018"
[dependencies]
image = { git = "https://github.com/image-rs/image" }
[lib]
path = "lib.rs"