Skip to content

Instantly share code, notes, and snippets.

View jmftrindade's full-sized avatar
:shipit:
õ.Õ

Joana Trindade jmftrindade

:shipit:
õ.Õ
View GitHub Profile
@jmftrindade
jmftrindade / perf.md
Last active April 5, 2019 15:42
perf

Useful perf commands

perf holy grail

Example commands

Basic counters with e.g., 10 repetitions:

$ perf stat -r 10 command
@jmftrindade
jmftrindade / private_fork.md
Created March 24, 2019 02:17
private fork

Clone repo

git clone --bare git@github.com:someuser/repo.git
cd repo.git
git push --mirror git@github.com:you/private.git
cd ..
rm -rf repo.git

Fetch changes from original repo

@jmftrindade
jmftrindade / PaRMAT.md
Last active February 26, 2021 07:02
RMAT generator

Using PaRMAT:

./PaRMAT -nVertices 10000000 -nEdges 100000000 -sorted -noEdgeToSelf -noDuplicateEdges -sorted -output /tmp/10MV_100ME.rmat
@jmftrindade
jmftrindade / cache.md
Created March 27, 2019 18:58
cache sizes
$ sudo dmidecode -t cache | grep "Installed Size"
@jmftrindade
jmftrindade / readypipe_scraper.md
Created March 28, 2019 19:54
twitter scraper

From article https://readypipe.com/blog/yang-buttigieg/.

from readypipe import requests, starting_task, subtask, schedule, save, get_attempts

URLS = {
    'Andrew Yang': 'https://twitter.com/andrewyang',
    'Bernie Sanders': 'https://twitter.com/BernieSanders',
    'Elizabeth Warren': 'https://twitter.com/ewarren',
    'Cory Booker': 'https://twitter.com/CoryBooker',
@jmftrindade
jmftrindade / tmux.md
Created April 1, 2019 15:15
tmux plugins

Update installed TPM plugins:

$ ~/.tmux/plugins/tpm/bin/update_plugins all
@jmftrindade
jmftrindade / git_submodules.md
Last active February 26, 2021 07:01
git submodules

Update all submodules to latest remote commit:

$ git submodule update --remote --merge
@jmftrindade
jmftrindade / mount.md
Created April 16, 2019 15:52
mount tmpfs or ramfs

guide

$ sudo mkdir -p /mnt/tmpfs
$ sudo mount -t tmpfs -o size=32g tmpfs /mnt/tmpfs
$ df -k

# after you're done..
$ sudo umount /mnt/tmpfs

Debug flags for binary

CXX -gdwarf -ggdb3 -O0 -o <YOUR_BINARY> ...

Valgrind command

$ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=/tmp/valgrind.txt 
@jmftrindade
jmftrindade / disk.md
Last active November 3, 2021 13:51
disk related tasks

Total disk usage

$ df -h --total
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 188G     0  188G   0% /dev
tmpfs                    188G     0  188G   0% /dev/shm
tmpfs                    188G  2.5M  188G   1% /run
tmpfs                    188G     0  188G   0% /sys/fs/cgroup
/dev/mapper/fedora-root   15G   12G  3.1G  80% /