Skip to content

Instantly share code, notes, and snippets.

View morsik's full-sized avatar

Konrad Mosoń morsik

View GitHub Profile
#!/usr/bin/env bash
e="echo -e"
en="echo -en"
function i {
if [[ $1 == "ok" ]]
then
$e "\033[1;32mok\033[G * \033[0m"
elif [[ $1 == "fail" ]]
#!/bin/sh
# Author: Konrad Mosoń <morsik@darkserver.it>
# Description: Simple Enemy Territory: Legacy installer
function m {
echo -e " \033[1;31m:\033[38;5;33m:\033[1;37m $1\033[0m"
}
if [ ! -n "$1" ]; then
#!/bin/bash
MAKEOPTS="-j8"
RUBYDIR=${HOME}/ruby
einfo() {
echo -e "\033[1;32m * \033[1;37m${1}\033[0m"
}
rm -rf ~/tmp
#!/usr/bin/env python2
import select
import sys
import socket
import Request
TCP_IP = "0.0.0.0"
TCP_PORT = 1234
BUFFER_SIZE = 4
@morsik
morsik / net-edit.pl
Created August 7, 2012 19:17
Perl libvirt net-edit with dhcp reload
#!/usr/bin/perl -w
# Author: Konrad "morsik" Mosoń <mosonkonrad@gmail.com>
# linked here: http://wiki.libvirt.org/page/Networking#Applying_modifications_to_the_network
use strict;
use warnings;
my $net = $ARGV[0];
Index: cgame/cg_crash.c
===================================================================
--- cgame/cg_crash.c (revision 535)
+++ cgame/cg_crash.c (working copy)
@@ -151,11 +151,19 @@
//If we don't do this stack traces are less accurate.
#ifdef GLIBC_21
Crash_Printf("Stack frames: %Zd entries\n", size-1);
+#ifndef __x86_64__
array[1] = (void *)ctx->uc_mcontext.gregs[EIP];
SSH_ENV="$HOME/.ssh/environment"
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
chmod 600 "$SSH_ENV"
. "$SSH_ENV" > /dev/null
from django import template
from django.utils.safestring import mark_safe
import re
register = template.Library()
@register.filter
def colorize(t, a='white'):
if t == None:
@morsik
morsik / rc.lua
Last active December 15, 2015 13:18
-- {{{ Key bindings
globalkeys = awful.util.table.join(
awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 2+") end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 2-") end),
awful.key({ modkey, }, "Pause", function () awful.util.spawn("xscreensaver-command -lock") end),
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::Ping;
my @hosts = (
'localhost.localdomain',
);