Skip to content

Instantly share code, notes, and snippets.

View mathieu-aubin's full-sized avatar
💭
blop!

Mathieu Aubin mathieu-aubin

💭
blop!
  • Montreal, Quebec, Canada
View GitHub Profile
@mathieu-aubin
mathieu-aubin / dlpatent
Last active June 22, 2022 10:02
Download PDF patent files from https://patents.google.com using download url and description
#!/bin/bash
#
# Downloads patent files from patents.google.com as pdf
# Must provide 2 arguments which are.. (quotes encapsulated)
#
# File URL (pdf download link)
# Description or name of patent
#
# File will be saved as PATENT#_DESCRIPTION.pdf
#
@mathieu-aubin
mathieu-aubin / com.vsubhash.bash.twitter-to-pdf.txt
Created February 9, 2022 00:43 — forked from vsubhash/com.vsubhash.bash.twitter-to-pdf.txt
com.vsubhash.bash.twitter-to-pdf.txt is a Unix/Linux shell script for saving all messages posted by a Twitter account as an archive in PDF format.
if [ $# -lt 2 ]; then
echo -e "The format is:\n\t\e[35m`basename $0` \e[35;1mtwitter-handle-or-hashtag number-of-tweets [nojs]\e[0m"
exit
fi
# A backup of all files will be available in this Logs directory
if [ ! -d ~/Logs ]; then
mkdir ~/Logs
fi
cd ~/Logs
@mathieu-aubin
mathieu-aubin / base64-wdata
Created November 8, 2021 14:50
base64 web data
#!/bin/bash
if [ ! -e "${1}" ]; then
echo "File not found";
echo "Usage: $(basename "${0}") input_file";
else
type=$(file --mime-type --brief "${1}");
w="$(echo $type|cut -d/ -f2)";
raw=$(cat "${1}" | base64 -iw0 | sed 's| ||g');
tmpf=$(mktemp);
@mathieu-aubin
mathieu-aubin / grabua.sh
Last active April 23, 2021 14:56
Grab User-Agents from access logs with typical structure
#!/bin/bash
zcat /var/log/*/*access*.gz | grep -Ev '(robots|humans).txt|favicon' | awk -F\" '($2 ~ "^GET /"){print $6}' | \
grep -Eiv "^-$|^$|Wordpress|^WOW$|wget|^curl.+|WhatsApp|Twitter|TOBBOT|GoogleBot|AdsBot|Baidu|Crawl|TurnitinBot|random|knowledge|smurl|thither|urlcheck|Traackr|Spider|^Z$|Zoom|chr\(|test|scrapy|ruby|SafeDNS|Research|Whatweb|semrush|seobility|slack|scan|yahoo|requests|reqwest|queue|serende|yakuza|zmeu|zoxh|xenu|semantic|siri|tagvisit|wapp|p40|PHP|cfnetwork|Pattern|python|seeker|scamadviser|\\x|pinterest|Pocket|thumbor|photon|null|okhttp|panscient|pa11y|OnalyticaBot|fetch|my_linux|powered|node\.js|newspaper|zgrab|gnowit|gzip|lighthouse|Datanyze|7777|MAUI|J2ME|seznam|proxy|detection|libwww|survey|hakai|nmap|go-http-client|PROBT|Nimbostratus|^Mozilla\/[[:digit:]].[[:digit:]][[:digit:]]?$|5.01682558|Mozilla\/5.0 Mozilla\/5.0|Zend|user-agent|symfony|poster|Writter|Rome|project25499|SMTB|^Mozilla [[:digit:]].[[:digit:]]|^Mozilla\/[[:digit:]].[[:digit:]]$|^Mozilla$|WebDav|Ahrefs|aiHitBot|Cloud

An engineering manager that I have the privilege of working with just asked me for three expectations of a principal engineer for a project that he is working on to mentor senior engineers at Twilio. Here is the list that I came up with.

  • Skate to where the puck is going: Are you waiting to be told what to do or are you getting a sense for our product vision and making concrete suggestions for what technical work needs to be done to get us in a good place when it becomes time to execute?
  • Act like an owner: Are you complaining about what's broken or offering solutions and/or alternative ways of thinking that makes it clear to engineers close to the problem that they can play an important role in solving those problems? Do you accept the world as it is or are you willing to provide a compelling vision for how it could be?
  • Teach and lead: You're not getting more hours in the day. Taking on all of the hard work not only makes you a single point of failure, it robs your colleagues of the ability
@mathieu-aubin
mathieu-aubin / play.html
Last active December 19, 2019 02:31 — forked from hzlzh/play.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width,minimum-scale=1.0"/>
<title></title>
</head>
<body>
<style type="text/css">
video {
@mathieu-aubin
mathieu-aubin / mysql_export_users.sh
Created February 21, 2019 16:49
export mysql users
#!/bin/bash
SQLLOGIN='root';
SQLPWD='PASSWORD';
FINAL_SQL_FILE='mysql-exported_users.sql';
UHEADTMP=$(mktemp -t mysqltmp_uheader_XXXXXXX);
USRTMP=$(mktemp -t mysqltmp_usr_XXXXXXX);
USRGRTMP=$(mktemp -t mysqltmp_usrgr_XXXXXXX);
@mathieu-aubin
mathieu-aubin / url-endecode.sh
Created February 5, 2019 00:28
url encoding and decoding in bash
#!/bin/bash
url-encode ()
{
if [[ ! -z ${2} || -z ${1} ]]; then
echo "error: this command needs one and only one value";
echo " enclose spaces or special chars with quotes";
return 1;
fi;
local string strlen encoded pos proto c o;
@mathieu-aubin
mathieu-aubin / perlbrew-links.md
Last active December 4, 2018 06:10
Perlbrew-links
@mathieu-aubin
mathieu-aubin / qstats
Last active November 12, 2018 06:29
Bash QuickStats
#!/bin/bash
#
# qstats (bash QuickStats)
#
# Copyright 2017 Mathieu Aubin <mathieu@zeroserieux.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.