This file contains hidden or 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
/** | |
* ar2rom - Convert Arabic numerals to Roman numerals | |
* Copyright (C) 2013 Matous J. Fialka, <http://mjf.cz/> | |
* Released under the terms of The MIT License | |
* | |
* Compile: cc -pedantic -ansi -Wall -Werror -o ar2rom ar2rom.c | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> |
This file contains hidden or 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
#! /bin/sh | |
exec < /dev/tty | |
ostty=`stty -g` | |
stty raw -echo min 0 | |
printf -- '\033[6n' > /dev/tty | |
IFS=\; read -d R -r line col | |
stty $ostty | |
printf -- '%d,%d\n' `expr ${col%R} - 1` `expr ${line:2} - 1` |
This file contains hidden or 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
# log work | |
alias log='history -p !! >> ${LOGFILE:-~/log}' |
This file contains hidden or 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
/** | |
* cc -pedantic -ansi -pedantic-errors -Wall -Werror bitset.c -o bitset | |
*/ | |
#include <stdint.h> | |
#include <stdlib.h> | |
typedef enum { /* no use for stdbool.h with ANSI C */ | |
false = 0, | |
true |
This file contains hidden or 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
#! /bin/sh | |
# partcomp - Partition Computing for Kickstart | |
# Copyright (C) 2013 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
RAM=${1:-4096} | |
HDD=${2:-512000} | |
SWAPFS_MAX=32768 |
This file contains hidden or 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
<Directory "/var/www/html"> | |
AuthType Basic | |
AuthName "WARNING: THIS IS A PRIVATE COMPUTER SYSTEM. ONLY AUTHORIZED USERS ARE PERMITTED ACCESS TO THIS WEB SITE. ALL ACCESS ATTEMPTS ONTO THIS SYSTEM ARE CLOSELY MONITORED AND LOGGED. ANY ATTEMPT TO CIRCUMVENT SECURITY OF THIS SYSTEMS MAY RESULT IN LEGAL ACTION(S)." | |
AuthUserFile "/etc/httpd/conf/.htpasswd" | |
AuthGroupFile "/etc/httpd/conf/.htgroup" | |
Require valid-user | |
Require group webmasters |
This file contains hidden or 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
#! /bin/sh | |
# | |
# sysctlgen - Generate useful /etc/sysctl.conf options | |
# Copyright (C) 2013 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
# | |
# | |
# Get PAGE_SIZE value from system compile-time variables |
This file contains hidden or 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
#!CSIRT-IRF-1.0 | |
# Computer Security Incident Response Team (CSIRT) | |
# Incident Reporting Form (IRF) | |
----- BEGIN IRF ----- | |
# Fill in any preliminary information below this line | |
This file contains hidden or 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
#! /bin/sh | |
# editfacl - Edit POSIX.1e ACL information | |
# Copyright (C) 2013 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
EDITOR="${EDITOR:-vi}" | |
TMPDIR="${TMPDIR:-/tmp}" | |
GETFACLOPT="$GETFACLOPT" |
This file contains hidden or 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
static size_t | |
npow2(size_t n) | |
{ | |
n--; | |
n |= n >> 1; | |
n |= n >> 2; | |
n |= n >> 4; | |
n |= n >> 8; | |
n |= n >> 16; | |
return n + 1; |