Skip to content

Instantly share code, notes, and snippets.

@jkramarz
jkramarz / list.md
Last active August 25, 2022 19:59
3D planes printable on Prusa Mini
#!/usr/bin/env perl
# sends email subject line as zmtrigger command
# can be used to start ZoneMinder recording from non-Onvif capable camera that can send emails on event
use IO::Socket::INET;
use Net::Server::Mail::ESMTP;
use Email::Simple;
my $server = new IO::Socket::INET Listen => 1, LocalPort => 10025;
my $conn;
while($conn = $server->accept)
@jkramarz
jkramarz / calibrate.py
Last active January 8, 2020 08:02
kalibrate-rtl
#!/bin/env python3
import subprocess
import re
from functools import reduce
import sys
import argparse
def get_channels(band="GSM900", timeout=60):
output = subprocess.check_output(['./kal', '-s', band], timeout=timeout)
match = re.finditer('chan: (?P<channel>[\d]+) \(.*\) power: (?P<power>[\d.]+)', str(output))
#!/usr/bin/env python2
import re
import turtle
import sys
import math
def to_mm(distance):
return distance * 0.0254;
def to_mils(distance):

Keybase proof

I hereby claim:

  • I am jkramarz on github.
  • I am jkramarz (https://keybase.io/jkramarz) on keybase.
  • I have a public key whose fingerprint is F0A6 047B 425B A22E 516E 8CF2 9E77 454C B474 E5BB

To claim this, I am signing this object:

@jkramarz
jkramarz / guitarhero.cpp
Created August 8, 2015 14:01
guitarhero
#include <iostream>
#include <cctype>
#include <cstdlib>
using namespace std;
bool game = false;
string colors[] = {"pink", "blue", "red", "yellow", "green"};
int actual = 0;
int points = 0;
@jkramarz
jkramarz / roller.bsg
Created May 4, 2015 20:18
Ultimate Rolling Besiege Machine
PREFAB IDS
0|1|18|9|9|7|7|41
POSITIONS
0,0,0|0,0,0.5|0,0.4999999,2|0,0.4999999,0|0,0.4999999,0|0.5,0,0|-0.5,0,2|0,0.4999999,0
ROTATIONS
0,0,0,1|0,0,0,1|-0.7071068,0,0,0.7071068|-0.7071068,0,0,0.7071068|-0.7071068,0,0,0.7071068|0,0.7071069,0,0.7071066|0,-0.7071069,0,0.7071066|-0.7071068,0,0,0.7071068
IS BLOCK FLIPPED
0|0|0|0|0|0|0|0
BRACE + SIMILAR BLOCKS - START POSITION
90000,90000,90000|90000,90000,90000|90000,90000,90000|0,0,0|0,0,0|0,0,0|0,0,0|90000,90000,90000
@jkramarz
jkramarz / stellaris.sh
Last active December 22, 2015 16:49
Install tools for Stellaris LM4F120 LaunchPad Evaluation Board on Fedora (and probably other RPM-based distros)
#!/bin/bash
# copyleft 2013 Jakub Kramarz http://hskrk.pl
# based on http://www.jann.cc/2012/12/11/getting_started_with_the_ti_stellaris_launchpad_on_linux.html
set -x
function install_gcc_arm_embedded() {
sudo yum install glibc.i686
wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2
tar -xf gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2 -C $HOME/.local
rm gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2
#!/bin/bash
set -e
from=sda
to=sdb
function copyGPT() {
sudo sgdisk -R /dev/$to /dev/$from
sudo sgdisk -G /dev/$to
}
function getNonEmptyPvs() {
#!/bin/bash
function showMeDirsAndCdToOneOfDirectories() {
count=0
for dir in $(dirs); do
if [ -d $(echo $dir | sed "s#~#$HOME#") ]; then
echo $count $dir
fi
count=$(( $count + 1 ))
done | awk '
{