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 / Install vcs server using lxc container at openwrt router.md
Last active May 14, 2020 21:48
Install vcs server using lxc container at openwrt router

Install VCS Server on LXC container in OpenWrt

Config LXC Containers

Config fstab btrfs subvolume /containers to hold all LXC Containers
nano /etc/config/fstab

config mount 'lxc'
        option target '/srv/lxc'
        option uuid '68706ead-a626-4209-b3d0-1187b835f803'
        option fstype 'btrfs'
	option btrfs_raid '1'
@arvati
arvati / alpine_motd_generator.md
Last active February 8, 2024 10:56 — 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 / sudo with no password - alpine.md
Last active April 5, 2024 15:06
Alpine with sudo and no password

Alpine with sudo and no password

su root
addgroup -S sudo
addgroup manager sudo
getent group sudo
apk update
apk upgrade
apk --no-cache add openssh nano sudo tzdata
visudo /etc/sudoers.d/nopasswd

Force checkout over existing folder

cd ~/Edifast
svn co --force svn://vcs.casa/edifast/ .
export SVN_EDITOR=nano
svn propedit svn:ignore .
.git
.gitignore
@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 / Clean Messy Windows Explorer Context Menu.md
Created May 20, 2020 21:24
Clean Messy Windows Explorer Context Menu

Open the Registry Editor by hitting Start and typing “regedit.”
Unfortunately, the items populating your context menu are not all located in the same place in the Registry.
You can find most of the context menu items used for both files and folders by drilling down to one of the following keys in the navigation pane on the left:

HKEY_CLASSES_ROOT\*\shell
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers
@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 / Backup Files with Git Protocol.md
Last active April 20, 2024 17:06
Backup Files with Git Protocol

Backup Files with Git Protocol

Setup gpg password (optional)

nano ~/.gnupg/gpg-agent.conf
default-cache-ttl 34560000
max-cache-ttl 34560000
allow-preset-passphrase
@arvati
arvati / copy subversion repos locally.md
Last active May 30, 2020 15:28
copy subversion repos locally

Copy subversion repos locally

Create local server

svnadmin --version
sudo svnadmin create /srv/svn/edifast
sudo chmod -R g+rws /srv/svn/
cd /srv/svn/
sudo find -type d -exec chmod g+s {} + 

Make then use the same UUID. First look info at remote server

@arvati
arvati / create and manage BTRFS snapshots.md
Last active October 22, 2023 11:53
Create and Manage Btrfs Snapshots

Create and Manage Btrfs Snapshots

Mount root subvolume

mount -t btrfs -o subvolid=5,noatime,nodiratime,noacl,nossd 'UUID=68706ead-a626-4209-b3d0-1187b835f803' /mnt/btrfs

List BTRFS subvolumes

btrfs subvolume list -t --sort=path /mnt/btrfs
ID      gen     top level       path
--      ---     ---------       ----