Skip to content

Instantly share code, notes, and snippets.

View tomasklapka's full-sized avatar

Tomáš Klapka tomasklapka

View GitHub Profile
@tomasklapka
tomasklapka / focus-or-run.sh
Created August 10, 2012 08:13
Focuses X application or runs it if not running (requires wmctrl utility installed)
#!/bin/sh
terminal_wm_class=$1
terminal_exec=$1
# no app started, so start one
if [ -z "`wmctrl -lx | grep $1`" ]; then
$terminal_exec &
else
# search for existing terminals on current desktop
@tomasklapka
tomasklapka / test_ip_cache.php
Created June 19, 2012 19:03
test_ip_cache.php
<?php
if (!($argc > 0 && isset($argv[1]))) {
echo "zadej ip jako 1. parametr";
exit;
}
$ip = $argv[1];
function vytahni_osc($ip) {
// dotaz do db a vytazeni osc podle ip