Skip to content

Instantly share code, notes, and snippets.

View mrdaemon's full-sized avatar

Alexandre Gauthier mrdaemon

View GitHub Profile
###
# Copyright (c) 2010, mr_daemon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.01';
%IRSSI = (
authors => 'Alexandre Gauthier',
contact => '[email protected]',
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.01';
%IRSSI = (
authors => 'Alexandre Gauthier',
contact => '[email protected]',
<#
.SYNOPSIS
Safely Imports Hyper-V Virtual Machines that were exported
as configuration only, without State Data (snapshots, VHDs, etc).
.DESCRIPTION
Hyper-V 2008 R2 removed the option to export a Virtual Machine without
its State Data (Snapshots, Virtual Disk Images (VHDs), Suspend State),
as configuration only through the GUI.
@mrdaemon
mrdaemon / .tmux-bootstrap.sh
Created July 12, 2011 23:01
tmux config and random bullshit
#!/bin/bash
# Shitty tmux bootstrap script for auto-login and session planning
SESSIONNAME="hack"
hash tmux || { echo "Could not find tmux? Ensure it's in \$PATH" ; exit 1 ;}
check_session() {
tmux list-sessions | cut -d ':' -f '1'| \
egrep "^""$SESSIONNAME""\$" 2>&1 > /dev/null
#!/usr/bin/env python
# ____ __ _ __
# / __ \___ ________ _____/ /__________ (_) /______ _
# / /_/ / _ \/ ___/ _ \/ ___/ __/ ___/ __ \/ / //_/ __ `/
# / ____/ __/ / / __(__ ) /_/ / / /_/ / / ,< / /_/ /
#/_/ \___/_/ \___/____/\__/_/ \____/_/_/|_|\__,_/
#
# Yet another threaded, multi-part file downloader
#
# Copyright (c) Alexandre Gauthier 2010-2011
@mrdaemon
mrdaemon / Upload.java
Created June 29, 2011 00:29
Upload servlet using the new Streaming upload in apache commons' uploadfile. This is how it should be done.
package org.underwares.uploadtest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
#!/usr/bin/env python
"""
Shitty validator for xmerge's sorts.
Rather simplisitic and naive.
Then again, I am not a real programmer :(
"""
__author__ = "Alexandre Gauthier <[email protected]>"
__copyright__ = "Copyright (c) 2011-2012"
@mrdaemon
mrdaemon / out.txt
Created June 16, 2011 20:01
output
supernaut@kitsune:~/code/git/xsort$ ls
example* example.c example.o fixsort.c fixsort.h fixsort.o Makefile testfile.bin
supernaut@kitsune:~/code/git/xsort$ ls -lah testfile.bin
-rw-r--r-- 1 supernaut supernaut 1,4G 2011-06-15 20:45 testfile.bin
supernaut@kitsune:~/code/git/xsort$ cat testfile.bin | wc -l
18837575
supernaut@kitsune:~/code/git/xsort$ time ./example 512 testfile.bin /tmp/shit%d output.bin
Calculating sorting resource requirements...
Buffer size = 290098655 bytes
Number of runs = 5
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>447</width>
<height>271</height>