Skip to content

Instantly share code, notes, and snippets.

At Home

Zé Roberto Andrade Jr. zeandrade

At Home
  • home
  • Curitiba, Brasil
View GitHub Profile
zeandrade /
Created May 11, 2021
generate a random password and save the string in a PDF file
# !/bin/sh
# generate a random password and save the string in a PDF file
# 7 letters ( upppers and lowers), except "l" and "O" to better legibility
# 4 numbers (1 to 9)
# 3 special chars of @,! or _
convert --version > /dev/null 2>/dev/null || (echo "Error: you need imagemagick" && exit )
passwd_p1=`tr -dc 'A-NQ-Za-km-z' </dev/urandom | head -c 7`
passwd_p2=`tr -dc '1-9' </dev/urandom | head -c 4`
passwd_p3=`tr -dc '@!_' </dev/urandom | head -c 3`
zeandrade /
Created Jun 3, 2019
Script to display squid's access log output in human-readable format.
#!/usr/bin/env python3
Translate the squid access log output to an human friendly format.
- copy this script to some $PATH dir (ex. /usr/local/bin)
- set permission: chmod a+x
usage: zcat /path/log/access.log.gz |
cat /path/log/access.log | -s > ~/myfile.txt
tail -F /path/log/access.log | -s | less
zeandrade / Verifying my Peepeth
Last active May 25, 2019
Verifying my Peepeth
View Verifying my Peepeth
Verifying my identity on 0x0ab2ad1e52a78fa2534025bb222130219f2f03cc

Keybase proof

I hereby claim:

  • I am zeandrade on github.
  • I am zeroandrade ( on keybase.
  • I have a public key ASASRbsE9hxyICg5CujkrxMIpkmA8mqcKT0VgiZ9QS8nPgo

To claim this, I am signing this object:

zeandrade /
Last active Jul 4, 2018 — forked from cbwar/
Python: Human readable file size
def sizeof_fmt(num, iec=True):
"""Readable file size
:param num: Bytes value
:type num: int
:param iec: default True, set iec pattern (powers of 1024),
False set si pattern (powers of 1000)
:type iec: boolean
:rtype: str