Skip to content

Instantly share code, notes, and snippets.

FOR /R %%F IN (*.*) DO echo.>"%%F":Zone.Identifier
@rc5hack
rc5hack / delete-mbr-bootcode.sh
Created April 29, 2015 10:39
delete boot code from MBR
#!/bin/sh
if [ -z "$1" ] || [ ! -e $1 ] ; then
echo " !! Device '$1' not found" >&2
exit 1
fi
TMPFILE=`mktemp /tmp/mbr.XXXXXXXX`
if [ ! -e $TMPFILE ] ; then
@rc5hack
rc5hack / evills
Last active August 29, 2015 14:15 — forked from Eugeny/evills
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>'
__url__ = 'http://github.com/cburgmer/upsidedown'
#!/usr/bin/env python
import os, sys, commands
import argparse
import ConfigParser
version = '0.1.1'
default_monitoring_checks_cache_path = '/var/cache/monitoring'
def createParser ():
@rc5hack
rc5hack / heredoc.sh
Created January 14, 2014 13:13
HEREDOC for bash
#!/usr/bin/env bash
NAME="John Doe"
RESPONDENT="author of this fine script"
cat <<EndOfMessage
Hi there, $NAME.
Greetings to you, '$NAME', from "$RESPONDENT".
EndOfMessage
@rc5hack
rc5hack / install.cfg
Last active December 21, 2015 04:29
Auto-install config for FreeBSD
# install.cfg: auto-install config for FreeBSD sysinstall(8)
# @see /usr/src/usr.sbin/sysinstall/install.cfg
###################################################################################
debug=yes
nonInteractive=yes
#TODO: make some swap
disk=ad0
partition=all
@rc5hack
rc5hack / sources.c
Created August 15, 2013 08:56
C program that changes it's proctitle (works on FreeBSD).
#include <stdio.h>
#include <unistd.h> // for sleep()
// Please note, that Linux does not supports setproctitle()
// (but FreeBSD does)
int main (void) {
setproctitle("I am C program! (%d)", getpid());
int MyTick=0;
@rc5hack
rc5hack / .bashrc
Created August 2, 2013 14:00
screen(1) stuff
alias live='
if [ -n "`screen -ls | grep LIVE`" ]; then
if [ -n "`screen -ls | grep LIVE | grep Attached`" ]; then
if [ -z "`echo $TERMCAP | grep screen`" ]; then
echo "Enter into Atached screen...";
sleep 2;
screen -x LIVE;
else
echo "Already in LIVE";
fi
@rc5hack
rc5hack / multiple_ssh_setting.md
Last active December 20, 2015 09:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github accounts

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
#!/usr/bin/perl --
use File::Find;
my $directory1 = $ARGV[0];
my $directory2 = $ARGV[1];
find(\&hashfiles, $directory1);
sub hashfiles {