Skip to content

Instantly share code, notes, and snippets.

@marc-queiroz
marc-queiroz / mysql-docker.sh
Created November 23, 2021 14:11 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@marc-queiroz
marc-queiroz / freeotp_backup.md
Created January 22, 2021 12:36 — forked from kontez/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@marc-queiroz
marc-queiroz / verify-eth-sig.js
Last active August 5, 2020 14:36 — forked from alexanderattar/verify-eth-sig.js
Example of how to sign a message with web3 and recover the address that signed it
var ethUtil = require('ethereumjs-util');
var data = 'Login';
var message = new Buffer(data);
var msgHash = ethUtil.hashPersonalMessage(message);
var privateKey = new Buffer('62debf78d596673bce224a85a90da5aecf6e781d9aadcaedd4f65586cfe670d2', "hex")
var sig = ethUtil.ecsign(msgHash, privateKey);
var signature = ethUtil.toBuffer(sig)
@marc-queiroz
marc-queiroz / git+overleaf+github.md
Created July 7, 2020 19:49 — forked from jnaecker/git+overleaf+github.md
Using Overleaf as your TeX editor but getting your files to Github

git + overleaf + github

Setup

Connect Overleaf and your local repo

  1. Make a new project on Overleaf.
  2. In the share menu, copy the link from "Clone with git"
  3. On your computer:
    • use cd to navigate to where you want to put your project
@marc-queiroz
marc-queiroz / i3_screenshot_config
Created March 10, 2020 17:21 — forked from schtibe/i3_screenshot_config
Screenshot keybindings with i3 and scrot that are copied to the clipboard
bindsym Print exec "scrot -e 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'; sleep 1; exec notify-send 'screenshot has been saved to ~/tmp'"
bindsym $mod+Print --release exec "scrot -ue 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'; sleep 1; exec notify-send 'screenshot has been saved to ~/tmp'"
bindsym $mod+Shift+Print --release exec "notify-send 'selection will be saved to ~/tmp'; scrot -se 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'"
@marc-queiroz
marc-queiroz / how-to-fix-tmux-fail.md
Created January 16, 2020 20:10 — forked from sv0/how-to-fix-tmux-fail.md
How to fix tmux error "terminal open failed: missing or unsuitable terminal: rxvt-unicode-256color"

If tmux fails with an error terminal open failed: missing or unsuitable terminal: rxvt-unicode-256color

log in to your remote host and create .terminfo/r in your home directory:

mkdir -p .terminfo/r

copy terminal information file to remote machine:

scp /usr/share/terminfo/r/rxvt-unicode* remote.host:.terminfo/r/

@marc-queiroz
marc-queiroz / make_certs.sh
Created November 18, 2019 17:19 — forked from mediaupstream/make_certs.sh
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
# test.example.com.key
# test.example.com.crt (includes ca-certs)
@marc-queiroz
marc-queiroz / system-sleep-xhci.sh
Created November 14, 2019 17:48 — forked from ioggstream/system-sleep-xhci.sh
Disable broken xhci device before suspend and avoid freeze.
#!/bin/sh
#
# This script should prevent the following suspend errors
# which freezes the Dell Inspiron laptop.
#
# Put it in /usr/lib/systemd/system-sleep/xhci.sh
#
# The PCI 00:14.0 device is the usb xhci controller.
#
# kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
@marc-queiroz
marc-queiroz / rambox-css-style
Created October 16, 2019 19:52 — forked from orevial/rambox-css-style
Rambox : Add a custom CSS style to a service
function applycss(css){
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('style');
s.setAttribute('type', 'text/css');
s.appendChild(document.createTextNode(css));
head.appendChild(s);
}
applycss('
// css from userstyles.org without the @-moz-document wrapper