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 / month.md
Last active April 28, 2024 19:55
Move files with date in file name to directories
#!/bin/bash

declare -a months=("01 - Janeiro" "02 - Fevereiro" "03 - Março" "04 - Abril" "05 - Maio" "06 - Junho" "07 - Julho" "08 - Agosto" "09 - Setembro" "10 - Outubro" "11 - Novembro" "12 - Dezembro")

for ano in /mnt/data/media/Pictures/Dropbox/video/*; do
    if [  -d "${ano}" ] && [ $((10#$(basename "${ano}"))) -le 2024 ]; then
        for folder in "${ano}"/*; do
            pasta=$(basename "${folder}")
 nro=$((10#${pasta}))
@arvati
arvati / reboot.md
Last active April 20, 2024 19:26
Reboot Openwrt
@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 / 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
@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

@arvati
arvati / install draftsight beta.txt
Last active February 17, 2024 05:08
Install DraftSight Beta Linux
#wget http://dl-ak.solidworks.com/nonsecure/draftsight/2019SP2/draftSight.deb
wget http://dl-ak.solidworks.com/nonsecure/draftsight/2019SP3/draftSight.deb
sudo dpkg -i draftSight.deb
sudo apt-get install -f
sudo apt install faketime menulibre
cd /opt/dassault-systemes/DraftSight/Linux/
env --unset=XDG_CURRENT_DESKTOP --unset=DESKTOP_SESSION --unset=GNOME_DESKTOP_SESSION_ID faketime '2019-12-01 08:15:42' "/opt/dassault-systemes/DraftSight/Linux/DraftSight"
sudo nano /usr/share/applications/dassault-systemes_draftsight.desktop
@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 / install Anbox on debian buster.txt
Last active February 5, 2024 21:36
Install Anbox on Debian Buster and use android apps
sudo snap install --devmode --beta anbox
snap restart anbox.container-manager
sudo apt install android-tools-adb anbox
ls /lib/modules/`uname -r`/kernel/drivers/android/binder_linux.ko
ls /lib/modules/`uname -r`/kernel/drivers/staging/android/ashmem_linux.ko
sudo modprobe ashmem_linux
sudo modprobe binder_linux
@arvati
arvati / Transferir WSL de uma máquina para outra.md
Last active December 16, 2023 17:08
Transferir WSL de uma máquina para outra
@arvati
arvati / . Install Jupyter Hub on LXC container in OpenWrt.md
Last active December 14, 2023 16:03
Install Jupyter Hub on LXC container in OpenWrt

Install Jupyter Hub 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'