I hereby claim:
- I am gutschilla on github.
- I am gutschilla (https://keybase.io/gutschilla) on keybase.
- I have a public key ASCk5I1y-Qtu_WpC8284ASwAZGdt1tYsmKHwb3WTwx_wKQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #! /bin/bash | |
| # I am exporting variables to have them in my shell after I ran the script. | |
| # I find that convenient. Of course, those can/should be removed in "serious" deployments. | |
| # create a time string between "1:00" and "5:59" | |
| export REBOOT_TIME=`perl -e "print scalar(int 1 + 5 * rand) . q[:] . scalar(int 6 * rand) . scalar(int 9 * rand)"` | |
| export HOSTNAME=`hostname` | |
| export NETWORK_DEVICE=eth0 # might be different in cloud servers |
| https://github.com/houshuang/survey/blob/master/lib/mail/smtp_server.ex |
| ;; backup files | |
| (setq backup-directory-alist `(("." . "~/.saves"))) | |
| (setq backup-by-copying t) | |
| (setq delete-old-versions t | |
| kept-new-versions 6 | |
| kept-old-versions 2 | |
| version-control t) | |
| ;; packages | |
| (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") |
| # Perl: | |
| my %map = ( a => 1, b => 2 ); | |
| my $fn_transform = sub { shift( @_ ) + 1 }; | |
| map {( $_ => $fn_transform->( $map{$_} ) )} keys %map; | |
| # transform all values of a map | |
| map = %{ a: 1, b: 2 } | |
| fn_transform = &( &1 + 1) | |
| Enum.into map, %{}, fn({k, v}) -> {k, fn_transform.(v) } end |