Install 7z and extract the ISO to the current directory
# apt-get install -y p7zip-full
# 7z x VMware-VMvisor-Installer-5.5.0-1331820.x86_64.iso
Install 7z and extract the ISO to the current directory
# apt-get install -y p7zip-full
# 7z x VMware-VMvisor-Installer-5.5.0-1331820.x86_64.iso
# while true; do date | tr '\n' ' ' && /usr/local/nagios/libexec/check_smtp -H somemailhost -p 25 ; sleep 5s; done;
Fri Aug 7 11:15:35 MST 2015 SMTP OK - 0.108 sec. response time|time=0.108085s;;;0.000000
Fri Aug 7 11:15:41 MST 2015 SMTP OK - 0.111 sec. response time|time=0.111096s;;;0.000000
Fri Aug 7 11:15:46 MST 2015 SMTP OK - 0.110 sec. response time|time=0.110013s;;;0.000000
find all the files in a directory. Take out the first dot . put in by find. Remove slashes (can’t be a character in a filename). Use fold -w 1 (–width) the width option limits column output to 1 character, which puts each character on it’s own line. Don’t count spaces (we don’t care about them). Sort the output, count how many occurrences of each character happened. Sort output by least to most occurrences of characters.
find . -type f | sed -e 's/\.//' -e 's/\// /g' | fold -w 1 | grep -v '^ $' | sort | uniq -c | sort -nk1
1 '
7 ^
22 ,
29 (
29 )
40 #
51 =
72 ~
214 @
312 :
672 Y
1141 +
1217 J
1497 Z
2813 G
3696 U
3727 H
5168 O
5654 N
5700 X
5721 K
10185 R
10590 W
11414 F
12412 A
13114 E
13424 C
13904 z
15369 Q
15698 j
18746 I
20582 S
30232 M
39547 q
44301 B
44946 P
54675 7
74749 9
74777 L
78077 T
83720 8
86739 D
87151 4
92824 k
93168 y
94261 5
96495 w
105734 V
135527 6
193306 f
215943 0
239003 g
274810 3
284082 v
291777 1
305769 h
329499 _
353852 2
397075 b
493086 m
513388 p
523439 d
539160 x
654812 -
697485 l
717868 a
728134 n
843460 t
862742 u
883640 .
1059771 i
1060749 c
1109991 o
1227620 r
1326244 s
1440326 e
I needed to create a large directory structure for some testing. I hacked together this quick script that makes a small or large directory tree easily. You define how many branch points there are and how many branches each branch has all the way from the trunk to the leaves.
#!/bin/bash i=0; l=0; levels=2 dirsperlevel=3 rm -rf tree mkdir tree && cd tree while [ $i -lt $levels ]; do for j in `find . -mindepth $i -maxdepth $i -type d` do pushd $j > /dev/null 2>&1 for k in `seq 1 $dirsperlevel`; do mkdir $k; done; popd > /dev/null 2>&1 done; i=$(($i+1)) l=`echo "($dirsperlevel^$i)+$l"|bc` done; echo "$l dirs created in ./tree"
using 2 levels, and 3 directories per level we get 12 total directories created like so:
# mktree.sh
12 dirs created in ./tree
# find tree
tree
tree/2
tree/2/2
tree/2/3
tree/2/1
tree/3
tree/3/2
tree/3/3
tree/3/1
tree/1
tree/1/2
tree/1/3
tree/1/1
using something like 6 levels and 6 directories per level would give us 55,986 total directories.
How did we boot?
# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.13.0-35-generic root=UUID=a2081a7a-23ac-4aaa-9a42-3fafd21937c4 ro nomdmonddf nomdmonisw nomdmonddf nomdmonisw
Needed to do this to use a wildcard cert (GoDaddy) (CSR/key generated by openssl), on a new exchange 2010 deployment
openssl pkcs12 -export -certfile fordodone.com.crt -inkey fordodone.com.key -clcerts -out fordodone.com.key.p12
When importing to certificates, it complains that it doesn’t have any content, but after certutil repair store it seems to work. No time, movin on.
# apt-get install ufsutils
# mkdir /mnt/freebsd && mount -t ufs -o ufstype=ufs2,ro /dev/sda2 /mnt/freebsd
# for i in {1..14}; do echo -n "ftp$i: "; ping -c 1 ftp$i.us.freebsd.org | grep icmp_req | awk '{print $8}' | cut -d = -f2; done;
ftp1: 21.2
ftp2: 53.9
ftp3: 53.8
ftp4: 21.3
ftp5: 63.8
ftp6: 67.1
ftp7: 21.0
ftp8: 66.8
ftp9: 21.2
ftp10: 66.4
ftp11: 83.8
ftp12: 22.6
ftp13: 39.9
ftp14: 56.5
Use declare
to see what functions are active for your shell. The -F
flag lists them and the -f
flag lists and shows how they are defined:
# function myfunc(){ echo "foo: $@"; }
# myfunc bar
foo: bar
# declare -f
declare -f myfunc
# declare -F
myfunc ()
{
echo "foo: $@"
}
Use tmpfs:
mkdir /tmp/tmpfs && mount -t tmpfs -o size=8G tmpfs /tmp/tmpfs