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 / 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 ... ]"
@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"
#!/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 / 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')
alias pac='sudo pacman -S' # install
alias pacu='sudo pacman -Syu' # update
alias pacr='sudo pacman -Rs' # remove
alias pacs='pacman -Ss' # search
alias paci='pacman -Si' # info
alias paclo='pacman -Qdt' # list orphans
alias pacro='sudo pacman -Rns $(sudo pacman -Qtdq)' # remove orphans
alias pacc='sudo pacman -Scc' # clean cache
alias paclf='pacman -Ql' # list files
#!/bin/bash
beedir=/usr/local/bee/beemon
hosts=( rpi21 rpi22 rpi23 rpi24 )
today=$(date "+%Y-%m-%d")
function check_dir() {
local pi=$1
# Check if today directory exists
if [[ ! -d "$beedir/$pi/$today" ]]; then

Keybase proof

I hereby claim:

  • I am alekratz on github.
  • I am alekratz (https://keybase.io/alekratz) on keybase.
  • I have a public key whose fingerprint is F093 7097 278C 68A4 2948 B47A B204 C605 68FF E574

To claim this, I am signing this object:

use std::io::{self, Write};
fn main() {
let yes = "y\n".repeat(8192).into_bytes();
let stdout = io::stdout();
let mut stdout = stdout.lock();
loop {
stdout.write(&yes);
}
}
#pragma once
#if __has_include(<filesystem>)
#include <filesystem>
#else
#include <experimental/filesystem>
namespace std {
namespace filesystem = experimental::filesystem;
};
#endif
#!/bin/bash
set -e
show_usage() {
echo "usage: $0 [-bd]"
echo
echo "-b run backups only"
echo "-d dry run (don't create or delete any files)"
}