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
awk '{ print $1 }' file.txt # Print column one from each line in file.txt | |
cat file.txt | awk '{print $2}' # Print column two from each line of piped input. | |
awk '{ print $3 $5 $NF }' file.txt # Print columns 3 & 5 and number of colums/fields on each line of file.txt. | |
awk 'BEGIN{ s=0 } { s+= $3 } END{ print s }' file.txt # Sum up column 3 and print at the end of input (BEGIN=pre input, END=EOF) | |
awk 'BEGIN{n=0}{n+=$NF}END{print n/$NR}' file.txt # Print the average number of of fields per record in file.txt | |
awk '/foo/' file.txt # Print lines that contain 'foo' in file.txt | |
awk '/foo/{print $0}' file.txt # Print all records on lines that contain 'foo' in file.txt | |
awk '/foo/{print $2}' file.txt # Print column 2 from all lines that contain 'foo' in file.txt | |
awk '$2=="foo"{print $1}' file.txt # Print column 1 fro |
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 | |
# Ensure wxallowed in /usr/local in fstab | |
# Inventory should have for each obsd host: ansible_python_interpreter=/usr/local/bin/python become_method=doas | |
# | |
# ./bootstrap-openbsd-new.sh hostname user | |
ANSIBLE_USER=control | |
INVENTORY=hosts | |
# Add host key to known_hosts | |
ssh-keyscan -H $1 >> ~/.ssh/known_hosts |
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
--- | |
- hosts: openbsd | |
become: yes | |
become_method: doas | |
gather_facts: no | |
tasks: | |
- name: "Download bsd.rd" | |
#shell: "cd /; ftp http://cloudflare.cdn.openbsd.org/pub/OpenBSD/6.3/`uname -m`/bsd.rd" | |
shell: "cd /; ftp https://cdn.openbsd.org/pub/OpenBSD/6.3/`uname -m`/bsd.rd" | |
- name: "Download SHA256.sig" |
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
echo OFF | |
ipconfig /flushdns | |
net stop COMSysApp | |
taskkill /F /IM iexplore.exe | |
taskkill /F /IM dllhost.exe | |
taskkill /F /IM taskhost.exe | |
taskkill /F /IM taskhostex.exe | |
del /Q %LocalAppData%\Microsoft\Windows\WebCache\*.* | |
net start COMSysApp | |
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351 |