Skip to content

Instantly share code, notes, and snippets.

View BrainStone's full-sized avatar

Yannick Schinko BrainStone

View GitHub Profile
BrainStone /
Last active August 29, 2015 14:23
Covert bytes to a human readable format in bash
#! /bin/bash
function humanReadable {
if [ $1 -lt 1024 ]
printf "%4i B\n" $1
postfixes=(KiB MiB GiB TiB EiB PiB YiB ZiB)
BrainStone / transbg.css
Created June 30, 2015 22:14
Transparent backgound texture for CSS
/* Creates that transparent background texture used by many image editing programs like gimp or PhotoShop */
<!-- Polr, a minimalist URL shortening platform. Copyright (C) 2013-2016 Chaoyi Zha This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> <!DOCTYPE html> <html> <head> <title>CBN Link Shortener by Polr</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="BbbAL2SY4ULmADZs
# Force bash
if [ -z "$BASH" ] || [ ! "_$BASH" = "_/bin/bash" ];then bash $0 "$@";exit;fi
exec < /dev/tty
oldstty=$(stty -g)
stty raw -echo min 0
BrainStone / Makefile
Last active April 5, 2017 14:37
Super generic Makefile for C++
# Must be either executable, dynamic_library or static_library
# Defaults to executable if a wrong value is used!
BIN_TYPE = executable
# The name of the executable to be created
# The extension gets appended automatically based on the type
BIN_NAME := prog
# The name of the documentation file
# Compiler used
BrainStone / error.txt
Created July 18, 2017 18:38
Error that appears when running `./gradlew cleanCache clean setupDecompWorkspace eclipse --refresh-dependencies`
This file has been truncated, but you can view the full file.
./gradlew : Patching failed: minecraft\net\minecraft\command\
In Zeile:1 Zeichen:1
+ ./gradlew cleanCache clean setupDecompWorkspace eclipse --refresh-dep ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Patching [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Hunk 1 failed! Cannot find hunk target
---- Minecraft Crash Report ----
WARNING: coremods are present:
OpenEyePlugin (OpenEye-1.12.1-0.8.jar)
SpongeCoremod (spongeforge-1.12.2-2655-7.1.0-BETA-3025.jar)
Contact their authors BEFORE contacting forge
// I'm sorry, Dave.
Time: 4/20/18 8:50 PM
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- ! tcp dpts:20000:20199
f2b-sshd-month tcp -- multiport dports 22
f2b-sshd-week tcp -- multiport dports 22
f2b-sshd tcp -- multiport dports 22
DROP tcp -- ! tcp dpts:20000:20199
ufw-before-logging-input all --
ufw-before-input all --
ufw-after-input all --
server {
listen [2001:41d0:1004:75::]:80;
server_name <subdomain> *.<subdomain>;
root /var/www/html;
location /.well-known {
# Just to prevent the redirect
# Einige Optionen nach Bettercrypto
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security max-age=15768000;
ssl_session_timeout 30m;
#ssl_dhparam /etc/ssl/nginx/dhparams.pem;