Skip to content

Instantly share code, notes, and snippets.

View morsik's full-sized avatar

Konrad Mosoń morsik

View GitHub Profile
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];
@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];
#!/usr/bin/env python2
import select
import sys
import socket
import Request
TCP_IP = "0.0.0.0"
TCP_PORT = 1234
BUFFER_SIZE = 4
#!/bin/bash
MAKEOPTS="-j8"
RUBYDIR=${HOME}/ruby
einfo() {
echo -e "\033[1;32m * \033[1;37m${1}\033[0m"
}
rm -rf ~/tmp
#!/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
#!/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" ]]
@morsik
morsik / calcram.sh
Created February 22, 2012 17:05
Calculates RAM usage by some program
#!/bin/bash
# Author: Konrad (morsik) Mosoń
# Usage: ./calcram.sh chromium
SUM=0
OUT=`ps aux | grep $1 | awk '{print $4}'`
for n in $OUT
do
@morsik
morsik / autosettings.lua
Created February 21, 2012 20:18
this mod allows to autoset panzerwar or sniperwar on specified maps
--
-- autosettings.lua
-- Author: morsik
--
-- this mod allows to autoset panzerwar or sniperwar
-- on specified map
--
-- CONFIG BEGIN
@morsik
morsik / make-gtk-symlinks.sh
Last active May 22, 2016 11:32
Makes symlinks for GTK+ icons filenames to Freedestrop.org filenames
@morsik
morsik / zfs-setup.sh
Created February 4, 2012 18:03
script for install freebsd on zfs
#!/bin/sh
msg() {
echo -e "\033[1;32m >> \033[1;37m$1\033[0m..."
}
msg "Creating zroot"
zpool create -f zroot mirror /dev/gpt/disk0 /dev/gpt/disk1
msg "Configuring zroot"