Skip to content

Instantly share code, notes, and snippets.

View danielnbalasoiu's full-sized avatar
🥷
🛡️

danielnbalasoiu

🥷
🛡️
View GitHub Profile
@danielnbalasoiu
danielnbalasoiu / repomd_test.sh
Created January 8, 2019 07:04 — forked from jpluimers/repomd_test.sh
Test if a zypper repository cache directory is OK. On openSuSE, you can test it with `for d in /var/cache/zypp/raw/*/repodata; do ~/repomd_test.sh $d; done`
#!/bin/bash
## https://github.com/Tojaj/librepo/issues/16
#set -e # Fail on error
echo "Sanity check"
echo "Testing if directory '$1' exists"
test -e $1 || exit 1
@danielnbalasoiu
danielnbalasoiu / README.MD
Created January 15, 2019 12:30 — forked from RichardBronosky/README.MD
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]).

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable

Examples

@danielnbalasoiu
danielnbalasoiu / pwnedpass.sh
Created April 23, 2019 07:03 — forked from Birch-san/pwnedpass.sh
Detect whether any password in your KeePassXC database was exposed in a data breach (using Troy Hunt's Pwned Passwords API)
#!/usr/bin/env bash
# Licensed by author Alex Birch under CC BY-SA 4.0
# https://creativecommons.org/licenses/by-sa/4.0/
# detects whether any of your passwords have been exposed in a data breach, by
# submitting (prefixes of hashes of) all your passwords to Troy Hunt's
# Pwned Passwords API.
# https://haveibeenpwned.com/Passwords
#!/bin/bash
# exit when the command fails
set -o errexit;
# exit when try to use undeclared var
set -o nounset;
accessKeyToSearch=${1?"Usage: bash $0 AccessKeyId"}

Keybase proof

I hereby claim:

  • I am danielnbalasoiu on github.
  • I am danielnbalasoiu (https://keybase.io/danielnbalasoiu) on keybase.
  • I have a public key ASDbvjQViwh1vqYe5ZGPNFF6iBu1dAxuAxBd_OmbcHWrfgo

To claim this, I am signing this object:

@danielnbalasoiu
danielnbalasoiu / ec2-fingerprint-key
Created November 6, 2019 14:23 — forked from jtriley/ec2-fingerprint-key
Simple Python script that computes both public and private RSA key fingerprints as used by Amazon EC2
#!/usr/bin/env python
import hashlib
import optparse
import paramiko
from Crypto.PublicKey import RSA
def insert_char_every_n_chars(string, char='\n', every=64):
return char.join(
@danielnbalasoiu
danielnbalasoiu / rpm-backup.sh
Created December 18, 2019 13:17 — forked from topiasv/rpm-backup.sh
Sailfish OS RPM Backup
#!/bin/bash
TEMP=`getopt -o ro:lLdvtRsS: --long refresh,output:,list-packages,list-repos,download,verbose,trim-repos,refresh-cache,skip-repos,settings-dir: -n 'rpm-backup' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
REFRESH=false
LREPOS=false
#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/local/docker-registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/tmp/jq
readonly repository_dir=$base_dir/repositories
@danielnbalasoiu
danielnbalasoiu / git.migrate
Created February 17, 2020 15:35 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@danielnbalasoiu
danielnbalasoiu / Dockerfile
Created March 4, 2020 14:38
Alpine dockerfile with build essentials
FROM node:7.8-alpine
LABEL maintainer "Mark Niehe<mark@niehe.ca>"
# Install all build dependencies
# Add bash for debugging purposes
RUN apk update \
&& apk add --virtual build-dependencies \
build-base \
gcc \
wget \