-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
300 additions
and
46 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# analysis | ||
# | ||
# Various tools for text extraction, representation, and analysis | ||
# | ||
# Author: Dave Eddy <[email protected]> | ||
# Credits: Brendan Gregg http://www.brendangregg.com/ | ||
# License: MIT | ||
# Date: 3/2/2013 | ||
|
||
# Calculate the average of input numbers | ||
# | ||
# $ cat data | ||
# 100 | ||
# 100 | ||
# 0 | ||
# $ avg < data | ||
# 66.666 | ||
avg() { | ||
local f=${1:-1} | ||
awk -F "${2:- }" "length(\$$f) { i+=1; sum+=\$$f; } END { print sum/i }" | ||
} | ||
|
||
# Add commas to a given inputs numbers | ||
# | ||
# $ echo '100000 / 100000000' | commas | ||
# 100,000 / 100,000,000 | ||
commas() { | ||
sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' | ||
} | ||
|
||
# Grab a field from given input | ||
# Adapted from http://www.brendangregg.com/Shell/field | ||
# | ||
# $ echo -e ' three different\tcolumns ' | field 2 | ||
# different | ||
field() { | ||
awk -F "${2:- }" "{ print \$${1:-1} }" | ||
} | ||
|
||
# Poor mans frequency count | ||
# | ||
# $ cat data | ||
# a | ||
# b | ||
# c | ||
# c | ||
# $ cat data | freq | ||
# 1 a | ||
# 1 b | ||
# 2 c | ||
freq() { | ||
sort | uniq -c | sort -n | ||
} | ||
|
||
# Print gaps in numbers (inclusively) | ||
# http://stackoverflow.com/questions/15867557/finding-gaps-sequential-numbers | ||
# | ||
# $ cat data | ||
# 1 | ||
# 2 | ||
# 3 | ||
# 6 | ||
# 10 | ||
# $ cat data | ||
# 4-5 | ||
# 7-9 | ||
gaps() { | ||
awk '$1 != (p+1) { print p+1 "-" $1-1 } { p = $1 }' | ||
} | ||
|
||
# Figure out the max number of given input | ||
# | ||
# $ cat data | ||
# 1 | ||
# 2 | ||
# 3 | ||
# $ max < data | ||
# 3 | ||
max() { | ||
local f=${1:-1} | ||
awk -F "${2:- }" " | ||
length(\$$f) { | ||
if (max == \"\" || \$$f > max) | ||
max = \$$f | ||
} | ||
END { print max; }" | ||
} | ||
|
||
# Figure out the min number of given input | ||
# | ||
# $ cat data | ||
# 1 | ||
# 2 | ||
# 3 | ||
# $ min < data | ||
# 1 | ||
min() { | ||
local f=${1:-1} | ||
awk -F "${2:- }" " | ||
length(\$$f) { | ||
if (min == \"\" || \$$f < min) | ||
min = \$$f | ||
} | ||
END { print min; }" | ||
} | ||
|
||
# Print a summary for input data | ||
# show average, sum, min and max | ||
summarize() { | ||
local f=${1:-1} | ||
awk -F "${2:- }" " | ||
length(\$$f) { | ||
if (max == \"\") | ||
max = min = \$$f; | ||
i += 1; | ||
sum += \$$f; | ||
if (\$$f > max) | ||
max = \$$f | ||
if (\$$f < min) | ||
min = \$$f | ||
} | ||
END { | ||
print \"lines\\t\", i; | ||
print \"min\\t\", min; | ||
print \"max\\t\", max; | ||
print \"sum\\t\", sum; | ||
print \"avg\\t\", sum/i; | ||
}" | ||
} | ||
|
||
# Total a given field using awk | ||
# Taken from http://www.brendangregg.com/Shell/total | ||
# | ||
# $ cat data | ||
# 1 | ||
# 2 | ||
# 4 | ||
# $ cat data | total | ||
# 7 | ||
total() { | ||
awk -F "${2:- }" "{ s += \$${1:-1} } END { print s }" | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
[user] | ||
name = NVolcz | ||
email = [email protected] | ||
name = NVolcz | ||
email = [email protected] | ||
|
||
[alias] | ||
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all | ||
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all | ||
aliases = config --get-regexp alias | ||
autoamend = commit --amend -CHEAD | ||
diffs = diff --staged | ||
wdiff = diff --word-diff | ||
root = rev-parse --show-toplevel | ||
reset-origin = !"git branch -f \"$1\" \"origin/$1\" #" | ||
whoami = "!echo \"$(git config user.name) ($(git config user.email))\"" | ||
please = push --force-with-lease | ||
|
||
[merge] | ||
conflictstyle = diff3 | ||
|
@@ -33,16 +35,30 @@ | |
date = iso | ||
|
||
[filter "lfs"] | ||
required = true | ||
clean = git-lfs clean -- %f | ||
smudge = git-lfs smudge -- %f | ||
process = git-lfs filter-process | ||
required = true | ||
clean = git-lfs clean -- %f | ||
smudge = git-lfs smudge -- %f | ||
process = git-lfs filter-process | ||
|
||
[color "branch"] | ||
current = yellow reverse | ||
local = yellow | ||
remote = green | ||
current = yellow reverse | ||
local = yellow | ||
remote = green | ||
|
||
[fetch] | ||
prune = true | ||
prune = true | ||
|
||
[init] | ||
defaultBranch = main | ||
defaultBranch = main | ||
|
||
[includeIf "gitdir:~/git/controla/"] | ||
path = ~/git/controla/.gitconfig | ||
|
||
[includeIf "gitdir:~/git/springflod/"] | ||
path = ~/git/springflod/.gitconfig | ||
[credential] | ||
helper = | ||
helper = /usr/local/bin/git-credential-manager | ||
credentialStore = secretservice | ||
[credential "https://dev.azure.com"] | ||
useHttpPath = true |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
cleanup() { | ||
echo "Cleaning up..." | ||
rm -f "$DEB_FILE" | ||
} | ||
trap cleanup EXIT | ||
|
||
ASSETS_URL="$(curl -s https://api.github.com/repos/git-ecosystem/git-credential-manager/releases/latest | jq -r '.assets_url')" | ||
|
||
DOWNLOAD_URL="$(curl -s "$ASSETS_URL" | jq -r '.[] | select(.name | test("^gcm-linux_amd64.*\\.deb$")) | .browser_download_url')" | ||
|
||
if [[ -z "$DOWNLOAD_URL" ]]; then | ||
echo "Failed to find the .deb package download URL" | ||
exit 1 | ||
fi | ||
|
||
TEMP_DIR="/tmp" | ||
DEB_FILE="$TEMP_DIR/$(basename "$DOWNLOAD_URL")" | ||
|
||
curl -s -Lo "$DEB_FILE" "$DOWNLOAD_URL" | ||
|
||
sudo apt install "$DEB_FILE" | ||
|
||
# Should I verify the signature? | ||
# https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/linux-validate-gpg.md#debian-package | ||
|
||
# | ||
# Code below is for isntalling gcm with dotnot. It is the preferred | ||
# way according to the documentation but this currently forces the use of | ||
# dotnot 7.0 which is EOL. | ||
# | ||
|
||
## Should I used the scripted installation instead? | ||
## https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install | ||
# | ||
## Since dotnet 7 is required for GCM, we need to install the dotnet backports library: | ||
#sudo add-apt-repository -y ppa:dotnet/backports | ||
## https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#supported-distributions | ||
## https://github.com/git-ecosystem/git-credential-manager/issues/1702 | ||
# | ||
#sudo apt install -y dotnet-sdk-7.0 | ||
# | ||
#dotnet tool install -g git-credential-manager | ||
#git-credential-manager configure |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.