Skip to content

Instantly share code, notes, and snippets.

View arvati's full-sized avatar
💭
Studying online

Ademar Arvati arvati

💭
Studying online
View GitHub Profile
@arvati
arvati / firedemo.js
Created April 8, 2019 23:34 — forked from Easter-Egg/firedemo.js
Firebase client for Mithril
// mithrilFire usage demo
// using firebase database "dinosaur-facts"
var Dinosaurs = {
model: function() {
// return a firebase reference to our database
return new Firebase('https://dinosaur-facts.firebaseio.com');
},
controller: function() {
var data = Dinosaurs.model();
@arvati
arvati / gist:42df49d6abeccf103843e1a9358ee891
Last active April 9, 2019 11:49 — forked from julianlam/expose-directory-on-host-to-lxc-container.md
Exposing a directory on the host machine to an LXC container

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
  • Both of these paths are relative to the host machine.
@arvati
arvati / alpine_motd_generator.md
Last active June 5, 2024 05:46 — forked from ergoz/motd_generator.sh
Dynamic motd generator for Alpine Linux (/etc/periodic/15min/motd)

Make a dynamic motd for your server

create a crond script to dynamic create an motd message to users

rc-service crond start && rc-update add crond
nano /etc/periodic/15min/motd
chmod a+x /etc/periodic/15min/motd
run-parts --test /etc/periodic/15min

Contents of /etc/periodic/15min/motd

@arvati
arvati / Como atualizar fork com as mudanças do original.md
Last active May 17, 2020 18:18 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?

Como atualizar fork com as mudanças do original

Adicione um novo remote; pode chamá-lo de "upstream":

git remote add upstream https://github.com/usuario/projeto.git

Obtenha todos os branches deste novo remote, como o upstream/master por exemplo:

git fetch upstream

Certifique-se de que você está no branch master:

@arvati
arvati / generate-ssh-key.sh
Created May 23, 2020 19:34 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@arvati
arvati / self-signed-certificate-with-custom-ca.md
Created June 11, 2020 20:13 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

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

SMBNetFS

Install and setup

sudo apt-get install smbnetfs
mkdir ~/.smb
cp /etc/smbnetfs/smbnetfs.conf ~/.smb
cp /etc/samba/smb.conf ~/.smb
@arvati
arvati / screen.md
Created June 20, 2020 17:14 — forked from fredrick/screen.md
GNU Screen Cheat Sheet

#GNU Screen Cheat Sheet

##Basics

  • ctrl a c -> cre­ate new win­dow
  • ctrl a A -> set win­dow name
  • ctrl a w -> show all win­dow
  • ctrl a 1|2|3|… -> switch to win­dow n
  • ctrl a " -> choose win­dow
  • ctrl a ctrl a -> switch between win­dow
  • ctrl a d -> detach win­dow
@arvati
arvati / .config pass tools browserpass and qtpass using windows wsl wrappers.md
Last active June 27, 2023 01:05 — forked from christian-weiss/passInWslBashWrapper.bat
pass tools browserpass and qtpass using windows wsl wrappers

pass tools browserpass and qtpass using windows wsl wrappers

Inside wsl Alpine v3.12

sudo apk update
sudo apk add browserpass pass nano
cd ~/
wget https://gist.github.com/arvati/1d9ae3091017e3ba1209fd76552cd344/raw/44c4af0f86e056e94954580943d2980741f02ff5/pinentry-wsl-ps1.sh
chmod ug=rx pinentry-wsl-ps1.sh
#echo "pinentry-program /home/$USER/pinentry-wsl-ps1.sh" >> ~/.gnupg/gpg-agent.conf
echo "pinentry-program \"/mnt/c/Program Files/Git/usr/bin/pinentry.exe\"" >> ~/.gnupg/gpg-agent.conf
@arvati
arvati / . Qemu networking using TAP Interface on Windows 10.md
Last active February 28, 2024 03:23 — forked from extremecoders-re/qemu-networking.md
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network