Skip to content

Instantly share code, notes, and snippets.

@Maurifc
Maurifc / wav_to_mp3.sh
Created June 2, 2025 11:49
Convert all wav in the current folder to mp3
#!/bin/bash
set -e
# Find all .wav files and convert them
for wav_file in *.wav; do
# Check if any .wav files exist
if [ -e "$wav_file" ]; then
# Get filename without extension
filename="${wav_file%.*}"
# Convert to mp3
  1. Move executable to ~/applications
mv ~/Download/my.AppImage ~/Applications
  1. Create an .desktop file
    code ~/.local/share/applications/myapp.desktop
if [[ " $* " == *" --install-requirements "* ]]; then
INSTALL_REQUIREMENTS="true"
fi
@Maurifc
Maurifc / docker-install.sh
Last active September 29, 2024 20:15
Docker install script
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh
sudo usermod -aG docker $USER
# serve static .html files from $ROOT/termos/ dir
location /termos/ {
autoindex on;
try_files $uri $uri.html =404;
}
@Maurifc
Maurifc / echo-service.yaml
Created July 23, 2024 13:02
k8s-http-echo
apiVersion: v1
kind: Service
metadata:
labels:
app: echo
name: echo
spec:
ports:
- port: 80
name: http
@Maurifc
Maurifc / mongodb-create-user.js
Created August 1, 2023 12:33
Commands to create a MongoDB user
// Change database
use mydb
// Create user
db.createUser(
{
user: "john",
pwd: "123567",
roles:["readWrite"]
}
@Maurifc
Maurifc / create_mongodb_user.js
Created May 29, 2023 13:43
Snippet for creating mongodb user
// Backup
db.createUser({
user: "bkp",
pwd: "PASSWORD-123",
roles: [
{ role: "readAnyDatabase", db: "admin" },
{ role: "backup", db: "admin" }
]
})
@Maurifc
Maurifc / bash_for_in.sh
Last active October 17, 2022 13:49
'for in' structure for bash scripts
#!/usr/bin/env bash
list=(
atena-api,
atena-client
)
for i in ${list[@]};
do
helm upgrade --install $i . -n production -f values-usa-master.yaml
@Maurifc
Maurifc / bash-script-boilerblate.sh
Last active November 19, 2022 13:19
Bash - A boilerplate for a bash script
#!/bin/bash
ACTION=$1
function help(){
echo -e \
"Usage:
1. Export ESSENTIAL_VARIABLE varible with...
$ export ESSENTIAL_VARIABLE=<KEY_PATH>