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 / fix_git-bash_path.sh
Created April 21, 2023 11:36
fix git-bash path to invoke bash not windows version of command like find, or sort
# just put this in .bashrc
export PATH=/bin:/usr/bin:$PATH
#or pipe this command to .bashrc
find /usr/bin -type f | while IFS= read -r file ;
do
name=${file##*/};
echo "${file}" | sed -E "s|(.*)|alias "${name}"='\1'|";
done

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@adrianbiro
adrianbiro / md2epub.md
Created April 9, 2023 14:17
markdown to epub3 with pandoc add metadata

Generate EPUB3 from markdown file

pandoc --from markdown --to epub3 go_performance.md \
    --output go-perfbook.epub \
    --table-of-contents \
    --epub-cover-image=Golang-3.jpg \
    --metadata-file=metadata.yaml

metadata.yaml or with CLI flags --metadata title='title of book' --metadata author='author name'

@adrianbiro
adrianbiro / shiftNlines.sh
Created April 3, 2023 17:36
shift N lines from file and save header
#!/usr/bin/bash
if [[ ${#} -eq 0 ]]; then
echo -e "Usage:\n\t${0} <input_file> <output_file> <number_lines_to_shift>"
exit 1
fi
infile=${1:?}
outfile=${2:?}
numlines=${3:?}
# add header
@adrianbiro
adrianbiro / CloneAllGithubRepos.ps1
Created February 21, 2023 14:34
Clone All Github Repos
<#
.SYNOPSIS
Clone all user repos froom github
.DESCRIPTION
.NOTES
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user
https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/Git_FAQ.html#How_do_I_clone_a_repository_with_all_remotely_tracked_branches.3F
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
@adrianbiro
adrianbiro / 01.bash_shortcuts_v2.md
Created February 21, 2023 08:07 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@adrianbiro
adrianbiro / Fedora35Hibernation.md
Created February 21, 2023 08:06 — forked from eloylp/Fedora35Hibernation.md
Fedora 35 hibernation with swapfile, only for hibernation and resume

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
@adrianbiro
adrianbiro / banana_phone_IMEI.md
Created February 20, 2023 08:44
banana phone IMEI

zdroj Wilder

buy here

show IMEI on android

To show IMEI, ICCID and SN on android.
Go to phone app and write *#06#

generate custom root CA certificate

openssl req -x509 -newkey rsa:4096 -keyout customRootCA.key -out customRootCA.cer -days 365

generate leaf certificate

openssl req -x509 -newkey rsa:4096 -keyout leafCert.key -out leafCert.cer -days 365 -subj “/C=/ST=/L=/O=/CN=”

generate certificate request for the leaf certificate

openssl x509 -x509toreq -days 365 -in leafCert.cer -signkey leafCert.key -out leafCert.req

sign the leaf certificate request with custom root CA certificate