This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define MEMINFO "/proc/meminfo" | |
#define MEM "/dev/mem" | |
#define MB 1024 * 1024 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 .." | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 ======================================================== | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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/). |
OlderNewer