Skip to content

Instantly share code, notes, and snippets.

View alekratz's full-sized avatar
👃
smells good

~ alekratz

👃
smells good
View GitHub Profile
@alekratz
alekratz / PKGBUILD
Created February 2, 2016 00:29
uberwriter PKGBUILD
pkgname=uberwriter
pkgdesc="A simple Markdown editor that offers a lot of features."
pkgver=15.05.01
pkgrel=1
arch=('i686' 'x86_64')
url="http://uberwriter.wolfvollprecht.de/"
license=('GPL')
source=(http://ppa.launchpad.net/w-vollprecht/ppa/ubuntu/pool/main/u/uberwriter/uberwriter_$pkgver-publicubuntu4_all.deb)
md5sums=('SKIP')
depends=('python-gtkspellcheck' 'python-gobject' 'ttf-ubuntu-font-family' 'pandoc' 'dconf' 'desktop-file-utils' 'gnome-web-photo' 'hicolor-icon-theme' 'morituri' 'passenger' 'python' 'python-cairo' 'python-levenshtein' 'python-pyenchant' 'texlive-bin' 'yelp' 'python-regex')
#!/bin/bash
# This be a script that sends a command via SSH to a list of hosts
function usage() {
echo "usage: $0 [ -p password -u username ] command"
}
# I love bash
#hosts=$(sed -r '/^127.0.0.1.*$|^::1.*$|^#.*$|^\s*$/d'</etc/hosts | awk '{print $2}')
hosts="node1 node2 node3 node4"
@alekratz
alekratz / alek.sublime-project
Created October 7, 2015 13:06
alek.sublime-project
{
"folders":
[
{
"path": ".",
"name": "ALEK"
},
{
"path": "./arch/i686-elf",
"name": "I686-ELF"
@alekratz
alekratz / gpgcat.sh
Last active August 29, 2015 14:27
encrypt/decrypt cat
# copy and paste these into your ~/.bashrc or whatever you source on terminal startup
# for the lazy bash users:
# $ curl https://gist.githubusercontent.com/alekratz/fed9fb9db081637d4138/raw | grep '^[^#]' >> ~/.bashrc
# for the lazy zsh users:
# $ curl https://gist.githubusercontent.com/alekratz/fed9fb9db081637d4138/raw | grep '^[^#] >> ~/.zshrc
function encat() {
case $# in
0)
echo "usage: $0 file [ file ... ]"
#!/bin/bash
java -Xmx1024M -Xms1024M -jar minecraft_server.1.8.7.jar nogui
@alekratz
alekratz / parse_radix.hpp
Created July 19, 2015 05:31
parses multiple radices using C++11 and some boost
template<typename T>
T parse_radix(const std::string& str, i32 radix)
{
assert("provided radix is not between the supported range of 2 and 36" && radix >= 2 && radix <= 36);
T result = 0;
auto get_radix_map = [](i32 radix) -> std::map<char, T>
{
typedef std::pair<char, T> pair_t;
@alekratz
alekratz / autosizer.sh
Created July 15, 2015 18:21
automatic image resizer
#!/bin/bash
# Automatic Image file resizer
# Written by SirLagz
# Fixed and cleaned by Alek Ratzloff <[email protected]>
if [[ ! $(whoami) =~ "root" ]]; then
echo ""
echo "**********************************"
echo "*** This should be run as root ***"
echo "**********************************"
@alekratz
alekratz / PKGBUILD
Created July 11, 2015 14:51
javahelp2 PKGBUILD
# Maintainer: Alucryd <alucryd at gmail dot com>
# Contributor: Stefan Husmann <stefan-husmann at t-online dot de>
# Contributor: Simon Lipp <sloonz+aur at gmail dot com>
# Contributor: Alek Ratzloff <alekratz+aur at gmail dot com>
pkgname=javahelp2
pkgver=2.0.05
pkgrel=1
pkgdesc="Java based help system"
arch=('any')
@alekratz
alekratz / ConfigPrinter.java
Created June 1, 2015 16:23
Hadoop config printer
/*
* to compile: first run
* javac *.java -classpath $(hadoop classpath)
*
* then run
* jar cf config-printer.jar *.class
*
* To use it, run
* hadoop jar config-printer.jar ConfigPrinter
*/
@alekratz
alekratz / client.py
Last active August 29, 2015 14:21
python thin client
#!/usr/bin/python2
"""
author: Alek Ratzloff
Client that connects to the server and sends it commands.
"""
from socket import *
PORT = 65000