Skip to content

Instantly share code, notes, and snippets.

@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active June 4, 2023 05:53
Backup android app, data included, no root needed, with adb
View android-backup-apk-and-datas.md

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

@AnatomicJC
AnatomicJC / xfs-dedup.md
Last active May 16, 2023 13:43
XFS reflinks deduplication with duperemove and fdupes
View xfs-dedup.md
View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@AnatomicJC
AnatomicJC / ansible-setup-with-mitogen.md
Last active February 19, 2023 17:12
Ansible 2.14.2 setup with mitogen
View ansible-setup-with-mitogen.md

Create requirements.txt file:

ansible==7.2.0
ansible-lint==6.10.0
jmespath
dnspython
git+https://github.com/mitogen-hq/mitogen.git@a47b9f3631ba3c37bf0410c6a4960c3eec152454
@AnatomicJC
AnatomicJC / zfs-docker.md
Last active February 15, 2023 11:52
ZFS and Docker
View zfs-docker.md

Create a dedicated ZFS docker pool with deduplication disabled in case of dedup enabled on your system:

zfs create -o mountpoint=/var/lib/docker -o dedup=off rpool/docker

Sometimes, you don't want ZFS for docker storage. ZFS can be sadly quite painful with Docker in Docker and similar scenarios. It might be best to avoid the problem by creating a volume in your ZFS pool, formatting that volume to ext4, and having docker use "overlay2" on top of that, instead of "zfs".

zfs create -s -V 30G rpool/docker

mkfs.ext4 /dev/zvol/rpool/docker

@AnatomicJC
AnatomicJC / gitlab-pipeline-pull-n-push-example.sh
Created February 4, 2022 13:17
go-passbolt-cli gitlab pipeline example
View gitlab-pipeline-pull-n-push-example.sh
# Set the configuration file containing the private OpenPGP key and passphrase
cat ${PASSBOLT_CLI_CONFIG} | base64 -d > /root/.config/go-passbolt-cli/go-passbolt-cli.toml
# Login to gitlab CI registry
# CI_REGISTRY_* variables are dynamically set by gitlab
docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
###
# login to Docker HUB registry / fetch password from passbolt
###
@AnatomicJC
AnatomicJC / go-passbolt-cli-create-resource.sh
Created February 4, 2022 13:11
go-passbolt-cli create resource
View go-passbolt-cli-create-resource.sh
passbolt create resource \
 - name "docker.com token for gitlab" \
 - username "username@domain.tld" \
 - password "Ch4ng3-m3-pl35E" \
 - uri "https://docker.io"
@AnatomicJC
AnatomicJC / passbolt-user-creation-automation-example.bash
Created February 4, 2022 13:05
passbolt user creation automation example
View passbolt-user-creation-automation-example.bash
#!/usr/bin/env bash
set -euo pipefail
TMPGNUPGHOME=$(mktemp -d)
EMAIL="email@domain.tld"
PASSPHRASE="strong-passphrase"
FIRSTNAME="John"
LASTNAME="Doe"
KEYSIZE=2048
@AnatomicJC
AnatomicJC / .vimrc
Last active August 18, 2021 20:38
vimrc file
View .vimrc
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
runtime! debian.vim
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
@AnatomicJC
AnatomicJC / xfs-write-cache.md
Last active August 5, 2021 20:45
XFS write-cache
View xfs-write-cache.md

/etc/systemd/system/xfs-write-cache.service

[Unit]
Description=Set XFS Write cache to write through

[Service]
Type=oneshot
User=root
Group=root
ExecStart=/usr/lib/systemd/system-sleep/xfs-write-cache