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 / .local_zsh
Last active September 4, 2023 13:22
asdf + conda
`.tool-versions`
```
python anaconda3-2021.11
```
create a `.local_zshrc` file
```
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
@moraisaugusto
moraisaugusto / change_browser_using_xdg.md
Created February 19, 2022 01:18
change default browser using xdg

check the default web browser using

xdg-settings --list
xdg-settings get default-web-browser
echo $BROWSER
@moraisaugusto
moraisaugusto / wakeup-from-usb.sh
Last active September 22, 2021 22:05
wakeup sleep mode from usb keyboard
# find out your keyboard usb device
$ lsusb
...
Bus 001 Device 007: ID feed:1203 kb68 kb68
...
$ sudo su
$ echo enabled > /sys/bus/usb/devices/usb7/power/wakeup
@moraisaugusto
moraisaugusto / check-wrong-utf8-char.sh
Created September 21, 2021 14:59
Find wrong utf-8 chars in a large file
# Assuming you have your locale set to UTF-8 (see locale output), this works well to recognize invalid UTF-8 sequences:
grep -axv '.*' file.txt
# Grep man page:
# -a, --text: treats file as text, essential prevents grep to abort once finding an invalid byte sequence (not being utf8)
# -v, --invert-match: inverts the output showing lines not matched
# -x '.*' (--line-regexp): means to match a complete line consisting of any utf8 character.
@moraisaugusto
moraisaugusto / docker-compose.yml
Created June 20, 2021 21:13
nextcloud + Bucket (docker-compose)
version: '3'
volumes:
nextcloud:
db:
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
@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
@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 / 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 / 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 / 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