Skip to content

Instantly share code, notes, and snippets.

⌨️
keyboard shredding

Miguel Mota miguelmota

⌨️
keyboard shredding
Block or report user

Report or block miguelmota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miguelmota
miguelmota / mkfile_example.sh
Created Aug 18, 2019
Bash create file of size (mkfile)
View mkfile_example.sh
mkfile 10b 10b.txt
mkfile 10k 10kb.txt
mkfile 10m 10mb.txt
mkfile 1g 1gb.txt
@miguelmota
miguelmota / dezip.js
Created Apr 3, 2014
Uncompress gzip response body in Node.js
View dezip.js
var request = require('request');
var zlib = require('zlib');
request(url, {encoding: null}, function(err, response, body){
if(response.headers['content-encoding'] == 'gzip'){
zlib.gunzip(body, function(err, dezipped) {
callback(dezipped.toString());
});
} else {
callback(body);
@miguelmota
miguelmota / faketime_install.sh
Created Jun 22, 2018
macOS faketime brew install
View faketime_install.sh
brew install libfaketime --build-from-source
# usage
faketime -f "@2020-01-01 00:00:00" node app.js
@miguelmota
miguelmota / README.md
Last active Aug 15, 2019
Multiple accounts with Mutt E-Mail Client (gmail example)
View README.md

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@miguelmota
miguelmota / sed_select_inbetween.sh
Created Aug 15, 2019
Bash sed select content inbetween start and end patterns
View sed_select_inbetween.sh
# don't forget the comma in the middle
sed -n '/some_start_pattern/,/some_send_pattern/p' file.txt
@miguelmota
miguelmota / sed_differences.sh
Last active Aug 15, 2019
Bash sed differences between two files matching column
View sed_differences.sh
awk 'NR==FNR{c[$2]++;next};c[$2] == 0' file1.txt file2.txt
@miguelmota
miguelmota / grep_differences.sh
Created Aug 15, 2019
Bash grep differences between two files
View grep_differences.sh
grep -F -x -v -f file1.txt file2.txt
@miguelmota
miguelmota / postgres_copy_table_differences.sh
Last active Aug 15, 2019
PostgreSQL copy table differences between two databases
View postgres_copy_table_differences.sh
#!/bin/bash
POSTGRES_HOST=your_db_host
POSTGRES_PORT=your_db_port
POSTGRES_USER=your_db_username
POSTGRES_PASS=your_db_password
POSTGRES_DBNAME1=your_db_1_name
POSTGRES_DBNAME2=your_db_2_name
@miguelmota
miguelmota / alacritty.yml
Created Aug 14, 2019
Normal colors for Alacritty terminal
View alacritty.yml
colors:
normal:
black: '0x000000'
red: '0xcc0403'
green: '0x19cb00'
yellow: '0xcecb00'
blue: '0x0d73cc'
magenta: '0x0dcdcd'
cyan: '0x0dcdcd'
white: '0xdddddd'
@miguelmota
miguelmota / remove_tuxera.sh
Last active Aug 14, 2019
Completely uninstall and remove Tuxera NTFS on MacOS (resets trial version)
View remove_tuxera.sh
sudo rm -rf /Applications/Tuxera\ Disk\ Manager.app
sudo rm -rf /Library/Application\ Support/Tuxera\ NTFS
sudo rm -rf /Library/Filesystems/fusefs_txantfs.fs
You can’t perform that action at this time.