$ lsblk
$ wipefs -a /dev/sdb
# quick wipe target device
$ pvcreate /dev/sdb
$ pvs
$ vgs
This file contains 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
#!/usr/bin/python3 | |
*_, name = url.split('/') | |
if not name: | |
*_, name, _ = url.split('/') |
This file contains 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 | |
#for i in {1..100}; | |
#do | |
# curl https://randomuser.me/api/ >> conference_attendance.json | |
#done | |
curl https://randomuser.me/api/?results=700 >> conference_attendance.json | |
echo '"Lastname","Forename","Age","City","Country"' > conference.csv | |
jq -rC '[.results[] | select(.dob.age > 21) | {person: [.name.last, .name.first, .dob.age, .location.city, .location.country]}] | sort_by(.name.last) | reverse | .[] | add | @csv' conference_attendance.json >> conference.csv |
This file contains 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 -F"," '{gsub("\"", "", $0); gsub(",", "\t", $0); if ($1 !~ /#\s.*/) print }' report.csv > clean_report.tsv |
This file contains 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 -F',' 'NF>1{printf("%s\t%d\n", $1, ($2 + $3))}' clenske_prispevky.csv \ | |
| pr --columns=3 --double-space --number-lines --first-line-number=1 \ | |
--date-format=%Y-%m-%d --header='Zostatok clenske prispevky' > Zostatok_clenske.txt |
This file contains 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 | |
function completego() | |
# Bash completion for go | |
{ | |
local wordlist; wordlist=$(go help | awk 'NR==9, NR==26{ printf "%s%s", $1, sp = NR==26? "\n": " "}') | |
complete -W "${wordlist}" go | |
} | |
completego |
This file contains 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 | |
trap "sudo systemctl enable --now clamav-freshclam.service" EXIT | |
sudo systemctl stop clamav-freshclam.service | |
sudo freshclam |
find /usr -name sysexits.h
/*
* SYSEXITS.H -- Exit status codes for system programs.
*
* This include file attempts to categorize possible error
* exit statuses for system programs, notably delivermail
- 1xx (Informational): The request was received, continuing process
- 2xx (Successful): The request was successfully received, understood, and accepted
- 3xx (Redirection): Further action needs to be taken in order to complete the request
- 4xx (Client Error): The request contains bad syntax or cannot be fulfilled
- 5xx (Server Error): The server failed to fulfill an apparently valid request
OlderNewer