Skip to content

Instantly share code, notes, and snippets.

@pryorda
pryorda / dump_memory.sh
Created October 19, 2019 05:18
Dump Process Memory
#!/bin/bash
grep rw-p /proc/$1/maps \
| sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' \
| while read start stop; do \
gdb --batch --pid $1 -ex \
"dump memory $1-$start-$stop.dump 0x$start 0x$stop"; \
done
# use strings on file after.
#!/bin/bash
grep rw-p /proc/$1/maps \
| sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' \
| while read start stop; do \
gdb --batch --pid $1 -ex \
"dump memory $1-$start-$stop.dump 0x$start 0x$stop"; \
done
# use strings on file after.
@pryorda
pryorda / count_by_day.sh
Last active November 7, 2019 20:22
Get Count of Prometheus values by Day
#!/bin/bash
startdate=2019-10-01
enddate=$(date -I)
d="$startdate"
while [ "$d" != "$enddate" ]; do
current=$d
d=$(date -I -d "$d + 1 day")
data=$(curl -s 'http://prometheus/api/v1/query_range?query=probe_http_status_code\{job="kubernetes-services",instance=~".*conversion.*"\}&start='$current'T00:00:00.000Z&end='$d'T00:00:00.000Z&step=15s')
@pryorda
pryorda / gist:c9592983e6ac68b8ffe7b888324d83cc
Created January 22, 2020 18:30
Grant privs on windows script
<# -- UserRights.psm1 --
The latest version of this script is available at https://gallery.technet.microsoft.com/Grant-Revoke-Query-user-26e259b0
VERSION DATE AUTHOR
1.0 2015-03-10 Tony Pombo
- Initial Release
1.1 2015-03-11 Tony Pombo
- Added enum Rights, and configured functions to use it
@pryorda
pryorda / fasstterrrr.sh
Last active June 10, 2021 08:36
Faster Rsync
find /media/files/ -printf "%P\n" > file_list.txt
mkdir -p split_file_list/
split -l 100000 file_list.txt split_file_list/
ls split_file_list/ |parallel -j9 --ungroup rsync --super -e \"ssh -i /home/user/.ssh/key\" --rsync-path=\"sudo rsync\" -aAvp --files-from=split_file_list/{} /media/files/ ubuntu@nfs-server1.*.com:/mnt/data
@pryorda
pryorda / gist:1957ed26da0aefa60c207cf97fc0d18e
Last active December 6, 2024 06:54
Copy between repos
#!/bin/bash
TARGET_ACCOUNT_REGION="us-west-2"
SRC_PROFILE="temp-ignitebankstest"
DEST_PROFILE="temp-ignitebanksqa"
DESTINATION_ACCOUNT_REGION="us-west-2"
DESTINATION_ACCOUNT_BASE_PATH="304374835924.dkr.ecr.$DESTINATION_ACCOUNT_REGION.amazonaws.com"
REPO_LIST=($(aws ecr --profile ${SRC_PROFILE} describe-repositories --query 'repositories[].repositoryUri' --output text --region $TARGET_ACCOUNT_REGION))
REPO_NAME=($(aws ecr --profile ${SRC_PROFILE} describe-repositories --query 'repositories[].repositoryName' --output text --region $TARGET_ACCOUNT_REGION))
@pryorda
pryorda / Process
Last active December 6, 2024 06:53
Clear Windows Update History
https://www.elevenforum.com/t/clear-windows-update-history-in-windows-11.2509/
powershell -windowstyle hidden -command "Start-Process cmd -ArgumentList '/s,/c,net stop usosvc & net stop wuauserv & del %systemroot%\SoftwareDistribution\DataStore\Logs\edb.log & del /f /q C:\ProgramData\USOPrivate\UpdateStore\* & net start usosvc & net start wuauserv & UsoClient.exe RefreshSettings' -Verb runAs"
Second Run this
https://www.elevenforum.com/t/reset-windows-update-in-windows-11.3808/
@pryorda
pryorda / install choco
Last active December 6, 2024 06:52
INstalled Choco apps
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install -y packages.config
@pryorda
pryorda / gist:86cd1df5d5729f0ee1d4571dda289e1e
Last active December 6, 2024 06:35
My ublock Settings
{
"timeStamp": 1706126581694,
"version": "1.55.0",
"userSettings": {
"autoUpdate": false,
"externalLists": "https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters/-/raw/main/bpc-paywall-filter.txt\nhttps://raw.githubusercontent.com/liamengland1/miscfilters/master/antipaywall.txt",
"importedLists": [
"https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters/-/raw/main/bpc-paywall-filter.txt",
"https://raw.githubusercontent.com/liamengland1/miscfilters/master/antipaywall.txt"
]
We couldn’t find that file to show.