This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to automatically create home directories on demand, and mount them | |
# from BASE (default /export/home) | |
BASE=/export/home | |
ID=$(/bin/id $1 2>/dev/null) | |
if [[ -n "$ID" ]]; then | |
if [[ ! -d "$BASE/$1" ]]; then | |
DSET=$(/usr/sbin/zfs list -H -o mountpoint,zoned,name | gawk -v base=$BASE -v zone=$(zonename) '$1==base && ( $2=="off" || zone != "global" ) { print $3 }') | |
if [[ -n "$DSET" ]]; then | |
/usr/sbin/zfs create $DSET/$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
keylength=8 | |
algo=$1 | |
[[ "$algo" = "aes" ]] && keylength=16 | |
[[ "$algo" = "3des" ]] && keylength=24 | |
encfile=$(mktemp -t _encXXXXXX) && \ | |
keyfile=$(mktemp -t _encXXXXXX) && \ | |
dd if=/dev/urandom of="$keyfile" bs="$keylength" count=1 >/dev/null 2>&1 && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find usr/ -name Makefile \ | |
| xargs perl -nle 'BEGIN { undef $/ } | |
my @m = /^(?![#\.]) (\S[^:=\n]+?:)/mgx; | |
foreach my $m (grep { /\+/ } @m) { | |
print "$ARGV: $m" | |
}' |