Skip to content

Instantly share code, notes, and snippets.

@enrialonso
enrialonso / alsamixer_autorestore_settings_every_reboot.md
Last active October 29, 2022 23:51
Auto restore custom settings for alsamixer every reboot

Edit your alsamixer settings

alsamixer

Store the changes on a file

alsactl --file /home/<>/.config/asound.state store
@enrialonso
enrialonso / proxy_aws_ec2_user_data.md
Created October 10, 2021 19:59
Proxy on AWS EC2 install on user data. Squid proxy.

Easy bash script for install Squid proxy on AWS EC2 instance, can put this script on the userdata and the instance run and install automaticaly the script.

#!/bin/bash
sudo apt update -y
sudo apt install tinyproxy -y
echo "Allow <YOUR_LOCAL_IP>" >> /etc/tinyproxy/tinyproxy.conf
sudo /etc/init.d/tinyproxy restart
@enrialonso
enrialonso / get_cpu_temp_raspbery_pi_4.md
Created October 9, 2021 23:20
Get temperature of CPU Raspberry PI 4 from bash script

Get temperature of CPU Raspberry PI 4

#!/bin/bash
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))

echo CPU temp"="$cpuTemp1"."$cpuTempM"'C"