Skip to content

Instantly share code, notes, and snippets.

View alekratz's full-sized avatar
👃
smells good

Alek Ratzloff alekratz

👃
smells good
  • Salem, OR
View GitHub Profile
#!/bin/bash
# Create some randomly-populated files of varying sizes in the given directory,
# up to a maximum summed size.
min=512
max=$((1024 * 1024))
size=$((1024 * 1024 * 1024))
location="$PWD"
sleep_between=0
#count=1024
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-8086K CPU @ 4.00GHz
CPU Family: 0x6
import glob
import importlib
from os.path import dirname, basename, isfile
import sys
import omnibot
modules = glob.glob(dirname(__file__) + "/*.py")
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith("__init__.py")]
from . import *
@alekratz
alekratz / diskinfo.sh
Created March 26, 2018 16:06
Writes table info of /dev/sd* disk info
#!/bin/bash
set -e
# Determines whether the specified disk is partitioned or not.
has-partition() {
local dev="$1"
local parts=("$dev"?)
if [[ ${#parts[@]} == 0 ]]; then
return 1
else
return 0
#!/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)"
}
#pragma once
#if __has_include(<filesystem>)
#include <filesystem>
#else
#include <experimental/filesystem>
namespace std {
namespace filesystem = experimental::filesystem;
};
#endif
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);
}
}

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:

#!/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
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