Skip to content

Instantly share code, notes, and snippets.

View jniltinho's full-sized avatar
🏠
Working from home

Nilton Oliveira jniltinho

🏠
Working from home
View GitHub Profile
@jniltinho
jniltinho / install-zig.sh
Created February 20, 2024 11:17
Install Zig on Linux
#!/bin/bash
## Links
## Ubuntu|Debian|Linux
## https://ziglang.org/documentation/master/
## https://ziglang.org/learn/getting-started/
## https://zig.guide/build-system/build-modes/
## https://zig.guide/
## https://github.com/C-BJ/awesome-zig
## https://github.com/zigzap/zap
@jniltinho
jniltinho / install-postfixadmin-docker.sh
Last active February 17, 2024 18:31
Install PostfixAdmin Docker
#!/bin/bash
## Links
## https://github.com/postfixadmin/postfixadmin
## https://github.com/postfixadmin/docker
apt update
apt install -y git curl wget docker.io
wget -O /usr/local/bin/docker-compose https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-linux-x86_64
chmod +x /usr/local/bin/docker-compose
@jniltinho
jniltinho / to-utf8.sh
Created February 7, 2024 19:37
Convert to UTF8
#!/bin/bash
## Links
## https://stackoverflow.com/questions/11316986/how-to-convert-iso8859-15-to-utf8
TO="UTF-8"; FILE=$1
FROM=$(file -i $FILE | cut -d'=' -f2)
if [[ $FROM = "binary" ]]; then
echo "Skipping binary $FILE..."
exit 0
fi
@jniltinho
jniltinho / golang-sending-email.go
Last active February 4, 2024 16:57
Postfix and Golang - Sending emails
package main
import (
"fmt"
"net/mail"
"net/smtp"
"strings"
)
var host = "127.0.0.1"
@jniltinho
jniltinho / install_golang.sh
Last active February 3, 2024 15:42
Install Golang on Linux
#!/bin/bash
## Install Golang Stable 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS)
## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html
## Run as root (sudo su)
## Thank's @geosoft1 | @gwmoura
GO_URL="https://go.dev/dl"
GO_VERSION=$(curl -s 'https://go.dev/VERSION?m=text'|head -n1)
GO_FILE="$GO_VERSION.linux-amd64.tar.gz"
@jniltinho
jniltinho / install-rtmp-server.sh
Last active January 26, 2024 16:58
Install RTMP Server
#!/bin/bash
## Install RTMP on Debian 12|Ubuntu 22.04
## https://github.com/bluenviron/mediamtx
## https://github.com/Haivision/srt
## https://github.com/harlanc/xiu
## https://github.com/SuRGeoNix/Flyleaf
## https://github.com/grigory-lobkov/rtsp-camera-view
## https://github.com/patrickhener/goshs
## https://github.com/gwuhaolin/livego
## https://github.com/datarhei/restreamer
@jniltinho
jniltinho / install_rundeck.sh
Last active January 12, 2024 19:10
Install Rundeck on Ubuntu
#!/bin/bash
## Install Rundeck + Mysql on Debian 12|Ubuntu 22.04
## https://linuxways.net/ubuntu/how-to-install-rundeck-on-ubuntu-20-04/
## https://docs.rundeck.com/docs/administration/install/linux-deb.html#installing-rundeck
## https://kifarunix.com/install-rundeck-on-ubuntu/?expand_article=1
## Run as root (sudo su)
apt update
apt install -y vim wget gpg mariadb-server mariadb-client
@jniltinho
jniltinho / pos-install-debian12.sh
Created January 7, 2024 21:02
Pos Instalacao Debian 12
#!/bin/bash
## https://www.tutorlinux.com.br/2023/07/18/pos-instalacao-do-linux-debian-12-bookworm/
## https://www.blogopcaolinux.com.br/2023/06/Guia-pos-instalacao-Debian-12-Bookworm.html
## https://www.linuxcapable.com/how-to-install-latest-linux-kernel-on-debian-linux/
## https://wiki.debian.org/Firefox
apt update && apt upgrade
apt-get install sudo flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
@jniltinho
jniltinho / build-obs-studio-debian12.sh
Last active January 4, 2024 16:33
Build OBS Studio Debian 12
#!/bin/bash
## Build .deb obs-studio Debian 12
## https://github.com/obsproject/obs-studio/wiki/Build-Instructions-For-Linux
## https://linuxgamecast.com/2023/04/obs-linux-basics-building-obs-debian-12-testing/
## https://obsproject.com/forum/threads/debian-obs-studio-build-mini-howto.169680/
## https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/
## Run Docker
## docker run --rm -it -v ${PWD}/pkg:/pkg debian:12 bash
@jniltinho
jniltinho / update-golang.sh
Last active December 23, 2023 00:33
Update Golang *Nix
#!/bin/bash
## Update Golang (Linux/Mac)
/usr/local/go/bin/go version
LOCAL_VERSION=$(/usr/local/go/bin/go version|awk '{print $3}')
## Get Last Stable Version
LAST_VERSION=$(curl -s 'https://go.dev/VERSION?m=text'|head -n1)
OS="linux"
ARCH="amd64"