Skip to content

Instantly share code, notes, and snippets.

@thaarok
thaarok / OxygenPressureProtocol.java
Last active December 18, 2015 19:29
Patch of Galacticraft (Minecraft mod) for allowing of bigger area covered by Oxygen Sealer.Repair stack overflow, but it is too slow - big sealed (unsealeable) area cause big lag. About stack overflow problem: https://github.com/micdoodle8/Galacticraft/issues/45
/**
* Path for bigger sealed spaces (but slower)
* Author of patch: Honza <[email protected]>
* Author of pattern: micdoodle8
*/
package micdoodle8.mods.galacticraft.core.oxygen;
import java.util.ArrayList;
import java.util.HashMap;
@thaarok
thaarok / agent.cpp
Last active June 20, 2020 18:34
Example of setting security policy through JVM Tool Interface (JVM TI) when is JVM starting
/**
* JVM Tool Interface agent which sets
* security policy when is agent loaded
* @author Jan Kalina <[email protected]>
*/
#include <string.h>
#include <jvmti.h>
#include <jni.h>
@thaarok
thaarok / HomeLESS_Hit_Analyzer.java
Created November 2, 2013 12:07
HomeLESS - Hit Analyzer - simple example how to find position of laser pointer point in output of webcam :)
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import codeanticode.gsvideo.*;
import guicomponents.*;
import processing.opengl.*;
import controlP5.*;
LVM:
parted /dev/sda print
pvcreate /dev/sda1
vgcreate imladris /dev/sda1
lvcreate --contiguous y --name root --size 40G imladris
parted /dev/sda set 1 boot on
---------------------------------------------------------------------
mount /dev/sda1 /mnt/disk1/
cdebootstrap --arch=amd64 stable /mnt/disk1/ http://ftp.cz.debian.org/debian/
mount /dev /mnt/disk1/dev/ -o bind
@thaarok
thaarok / mountRegistry.cmd
Created December 13, 2013 22:53
CMD script (Windows commandline) for mounting Windows registry of turned off system from Windows PE (bootable CD/USB).
@echo off
pushd .
echo[
echo[ Script for offline editing of Windows registry from Windows PE
echo[ Author: Jan Kalina ([email protected])
echo[
echo[ Remote registry will be mounted to HKLM\Remote_*
echo[
@thaarok
thaarok / RungeKutta2.c
Last active January 2, 2016 05:49
IMS - Runge Kutta 2. řádu
#include <stdio.h>
/*
*****************************************************************************
V jazyce ISO C napiště funkci Step_RK2 (double t, double st[], double in[],
unsigned N, double stepsize), které předáte modelový čas t, stav všech
integrátorů v poli st, jejich počet N a délku kroku.
Vzorec definující metodu:
k1 = h * f(t, y(t))
@thaarok
thaarok / wildfly-testing.policy
Last active August 29, 2015 13:56
Simple (not minimal) Java security manager policy working with Wildfly-8.0.0.CR1
// Policy file working with Wildfly-8.0.0.CR1
// (modified https://community.jboss.org/wiki/ConfiguringAJavaSecurityManager)
// Into standalone.sh add:
// JAVA_OPTS="$JAVA_OPTS -Djava.security.manager=default"
// JAVA_OPTS="$JAVA_OPTS -Djava.security.policy=/tmp/jboss.policy"
// JAVA_OPTS="$JAVA_OPTS -Djboss.home.dir=/home/honza/Wildfly/wildfly-8.0.0.CR1"
// JAVA_OPTS="$JAVA_OPTS -Djboss.server.home.dir=/home/honza/Wildfly/wildfly-8.0.0.CR1"
// #JAVA_OPTS="$JAVA_OPTS -Djava.security.debug=access,failure"
@thaarok
thaarok / student.c
Created June 4, 2014 08:50
izg_lab_04 - Řešení 4. laboratoře IZG na FIT VUT
/******************************************************************************
* Laborator 04 Krivky - Zaklady pocitacove grafiky - IZG
* [email protected]
*
*
* Popis: Hlavicky funkci pro funkce studentu
*
* Opravy a modifikace:
* - [email protected]
*
@thaarok
thaarok / screenRecordingWithAudio.sh
Last active August 29, 2015 14:02
Screen recording with desktop audio
#!/bin/sh
OUT=`date +"%Y-%m-%d %H-%M"`
IN_RESOLUTION="1280*1024" # screen resolution
OUT_RESOLUTION="720:576" # resolution of output video
VIDEO="-f x11grab -r 20 -s $IN_RESOLUTION -i :0.0 -b:v 1000k"
#AUDIO="-f alsa -i hw:0,0" # record microphone
AUDIO="-f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" # record PC output
@thaarok
thaarok / prouzek.py
Created June 23, 2014 15:33
Informační proužek pro HTV
# -*- coding: utf-8 -*-
# apt-get install python python-qt4
import os,sys
from PyQt4.QtCore import Qt
from PyQt4 import QtGui, QtCore
import PyQt4
import signal
import sys
import urllib