Skip to content

Instantly share code, notes, and snippets.

View moraisaugusto's full-sized avatar
🎯
Focusing

Augusto Morais moraisaugusto

🎯
Focusing
View GitHub Profile
@moraisaugusto
moraisaugusto / wifi-wakeup.sh
Last active November 14, 2020 15:10
wake up wifi when sleep
#!/bin/bash
# this file will reconnect the wifi when you wake up you OS (tested on Arch)
# save this file /usr/lib/systemd/system-sleep
case $1 in
pre)
# unload the modules before going to sleep
;;
post)
sleep 2
systemctl restart wpa_supplicant.service
@moraisaugusto
moraisaugusto / how_to_create_a_timer.md
Last active December 7, 2020 20:12
systemctl/Timer

To make this answer a useful one, a minimal example for a daily automatic scheduled script at 01:30.

  1. Create two files, one service file and one timer file. Both names (.timer and .service) have to match. F.e.:
sudo vim /usr/lib/systemd/system/scheduledScript.service
sudo vim /usr/lib/systemd/system/scheduledScript.timer

(The folder /usr/lib/systemd/system/... is the default folder containing all .service files)

@moraisaugusto
moraisaugusto / externalHDDonLibreELEC.md
Created December 18, 2020 19:24
Add External HDD on LibreELEC

Mount the flash partition (not necessary but... )

mount -o remount,rw /flash

Normally the external HDD is automatically mounted by LibreELEC, so you just need to format is using ext4 partition datatype

umount /dev/sda2 # check which partition was mounted automatically - `df -h`
@moraisaugusto
moraisaugusto / git_visual_contribs.md
Created January 6, 2021 08:55
git timeline evolution
#!/bin/bash
gource -1800x1200 --title "My App" --hide progress --max-user-speed 500 --seconds-per-day 0.15 -e 0.005 --bloom-intensity 0.05 --hide filenames -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -crf 19 -threads 0 -bf 0 output.mp4
@moraisaugusto
moraisaugusto / upgradeNextcloud.md
Last active April 2, 2023 13:58
upgrade Nextcloud using docker image

First Method

create your docker-compose file like this one:

version: '3'

volumes:
 nextcloud:
@moraisaugusto
moraisaugusto / manage_thunderbolt.md
Created March 15, 2021 13:37
Thunderbolt 3 - Linux

To manage thunderbolt 3 connections you need to install the package boltctl from arch repo

$ pacman -S bolt

list all connected devices

$ boltctl
@moraisaugusto
moraisaugusto / rsync_on_libreELEC.md
Created March 15, 2021 22:00
LibreELEC - rsync

Install the network-tools addon (from libreELEC)

This addon will install the rsync in the following folder:

$ which rsync
/storage/.kodi/addons/virtual.network-tools/bin/rsync
@moraisaugusto
moraisaugusto / pulseaudio.md
Last active March 31, 2021 10:14
Pulseaudio

Resolve conflicts for Pulseaudio

First, check if you have a default Pulse Audio configuration (~.config/pulse/default.pa or /etc/config/default.pa).

Remove the local default.pa file and try to start the pulse audio.

mv ~/.config/pulse/default.pa ~/.config/pulse/default.pa-old
pulseaudio -vvvv
@moraisaugusto
moraisaugusto / append_path.md
Created June 13, 2021 20:58
append_path not found

Problem

Case you are having issues like:

/etc/profile.d/perlbin.sh:6: command not found: append_path
/etc/profile.d/perlbin.sh:8: command not found: append_path
/etc/profile.d/perlbin.sh:10: command not found: append_path

Then you need to define a append_path function in your /etc/profile.

@moraisaugusto
moraisaugusto / nextcloud-facerecognition.yaml
Last active June 20, 2021 21:10
Next cloud facerecognition dockerfile
# this example we show how to install Dlib and PDlib from source to build a Nextcloud image
# with Debian and Apache. This Dockerfile uses multistage builds to first build the binaries
# of Dlib and then automatically copy the binaries to the final image. Use it as a guide to
# adapt it to your needs.
# source: https://github.com/matiasdelellis/facerecognition/wiki/Docker
#
# Use a temporary image to compile and test the libraries
#
FROM nextcloud:apache as builder