A fully fonctional and good-looking linux for less than 256mb of ram
Get the "mini.iso" image from archive.ubuntu.com
Just flash an usb drive with it as follow.
sudo dd bs=4M if=mini.iso of=/dev/sd> conv=fdatasync && sync
#!/bin/bash | |
OUTDIR=. | |
while read -r db; do | |
while read -r table ; do | |
if [ "$db" == "system" ]; then | |
echo "skip system db" | |
continue 2; |
#!/usr/bin/gawk -f | |
############################################################################### | |
# Terminal Histogram | |
# | |
# Print a histogram to the terminal. | |
# Feed lines of single numbers to stdin, set size with W and H. | |
# If awk variable C is true, prints a cumulative (normalized) histogram | |
# (empirical distribution function). | |
# | |
# 2017, Daniel Prokesch <daniel.prokesch@gmail.com> |
A fully fonctional and good-looking linux for less than 256mb of ram
Get the "mini.iso" image from archive.ubuntu.com
Just flash an usb drive with it as follow.
sudo dd bs=4M if=mini.iso of=/dev/sd> conv=fdatasync && sync
I have been testing various ways to read and write text files with GZIP in Python. There were a lot of uninteresting results, but there were two I thought were worth sharing.
If you have a big list of strings to write to a file, you might be tempted to do:
f = gzip.open(out_path, 'wb')
for line in lines:
# Allow read-only ZoL commands to be called through sudo without a password. | |
# Cmnd alias specification | |
Cmnd_Alias RO_ZFS = \ | |
/sbin/zfs "", /sbin/zfs help *, \ | |
/sbin/zfs get, /sbin/zfs get *, \ | |
/sbin/zfs list, /sbin/zfs list *, \ | |
/sbin/zpool "", /sbin/zpool help *, \ | |
/sbin/zpool iostat, /sbin/zpool iostat *, \ | |
/sbin/zpool list, /sbin/zpool list *, \ |
#!/bin/bash | |
# Slack notification script for Munin | |
# Original author: Mark Matienzo (@anarchivist) | |
# | |
# To use: | |
# 1) Create a new incoming webhook for Slack | |
# 2) Edit the configuration variables that start with "SLACK_" below | |
# 3) Add the following to your munin configuration: | |
# |
#!/bin/bash | |
# Slack notification script for Munin | |
# Mark Matienzo (@anarchivist) | |
# | |
# To use: | |
# 1) Create a new incoming webhook for Slack | |
# 2) Edit the configuration variables that start with "SLACK_" below | |
# 3) Add the following to your munin configuration: | |
# |
#!/usr/bin/env python | |
# | |
# Very basic example of using Python and IMAP to iterate over emails in a | |
# gmail folder/label. This code is released into the public domain. | |
# | |
# RKI July 2013 | |
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
# | |
import sys | |
import imaplib |
import mimetypes | |
import sys | |
from collections import OrderedDict | |
filename = sys.argv[1] | |
def file_type(filename): | |
type = mimetypes.guess_type(filename) | |
return type |
display.cell <- function(x, bgcol="#DAE6F2", ...) { | |
opar <- par(bg=bgcol, mar=rep(0,4)) | |
plot(c(0,1), c(0,1), type="n", axes=FALSE, xlab="", ylab="") | |
text(.5, .5, as.character(x), ...) | |
lines(c(-0.1,1.1), c(0,0)) | |
par(opar) | |
} | |
format.digits <- function(x) as.character(paste("$", as.character(x), sep=" ")) |