Skip to content

Instantly share code, notes, and snippets.

View Bystroushaak's full-sized avatar
🦊
Rapid Offensive Unit

Bystroushaak Bystroushaak

🦊
Rapid Offensive Unit
View GitHub Profile
@Bystroushaak
Bystroushaak / fmath.h
Created May 31, 2011 21:43
renamed fm_sinus to fm_sin
#ifndef _FMATH_H
#define _FMATH_H
long int fm_pow(int, int);
float fm_powf(float, int);
long int fm_fact(int);
float fm_sin(float);
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define MEMINFO "/proc/meminfo"
#define MEM "/dev/mem"
#define MB 1024 * 1024
@Bystroushaak
Bystroushaak / gist:1259401
Created October 3, 2011 15:41
Boot checking script
#!/usr/bin/env bash
WHERE="/boot"
FILE="$HOME/.b.chk"
#~ FILE="./b.chk"
FIND_CMD="find $WHERE -type f -exec md5sum {}"
if [ -n "$1" ] && ([ $1 = "-a" ] || [ $1 = "--aprove" ]); then
test -e "$FILE" && rm -f "$FILE"
#! /usr/bin/env sh
# Router postinstalation script by Bystroushaak (bystrousak@kitakitsune.org)
cd /
SWAP_SIZE=`free | grep -i swap | tr -s [:space:] " " | cut -d " " -f 2`
if [ $SWAP_SIZE -eq 0 ]; then
echo "Creating swap file .."
A physicist, a biologist and a mathematician are sitting in a street café watching people entering and leaving the house on the other side of the street. First they see two people entering the house. Time passes. After a while they notice three people leaving the house. The physicist says, "The measurement wasn't accurate." The biologist says, "They must have reproduced." The mathematician says, "If one more person enters the house then it will be empty."
/// Converts Windows-1250 to UTF. Thx http://latrine.dgx.cz/prevody-mezi-kodovanim
string win1250ShitToUTF(string i_s){
string o_s;
string[ubyte] table = [
0x80 : "\xe2\x82\xac",
0x81 : "",
0x82 : "\xe2\x80\x9a",
0x83 : "",
0x84 : "\xe2\x80\x9e",
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
# This work is licensed under a Creative Commons 3.0 Unported License
# (http://creativecommons.org/licenses/by/3.0/).
#
#= Functions & objects ========================================================
>>> f = open("/home/bystrousak/Plocha/output.txt", "w")
>>> a = 0
>>> for i in range(1000):
... a = (a + 1913) % 1000
... f.write(str(a) + "\n")
...
>>> f.close()
913
826
#! /usr/bin/env bash
# Apple wireless keyboard module installation script
# by Bystroushaak (bystrousak@kitakitsune.org)
if [ ! -d ubuntu-precise ]; then
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git ubuntu-precise
fi
cd ubuntu-precise
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
http://stackoverflow.com/questions/19960243/how-to-store-ip-address-range-vs-location
by Bystroushaak bystrousak@kitakitsune.org
"""
#
# Interpreter version: python 2.7
# This work is licensed under a Creative Commons 3.0 Unported License
# (http://creativecommons.org/licenses/by/3.0/).