Skip to content

Instantly share code, notes, and snippets.

@eduhenke
eduhenke / update-packages.sh
Created April 1, 2020 17:24
daily prompt to update packages
# put this script in the end of your .(ba|z)shrc file
# checks if it's a new day
if [[ ! -e /tmp/$(date +"%Y%m%d").sem ]]
then
touch /tmp/$(date +"%Y%m%d").sem
if (dialog --title "update packages" --yesno "Let's update our pacman packages?(yay command)" 6 30)
then
clear
@eduhenke
eduhenke / main.py
Created September 12, 2018 04:48
Cut audio dead parts
# inspired by my friend Alfinete
from pydub import AudioSegment
from pydub.silence import split_on_silence
audio = AudioSegment.from_mp3('in.mp3') # or from_<your-audio-extension>
threshold = -60 # audio threshold in dB to trim audio, i've set this manually :P
# split when audio is silent
nonsilent_parts = split_on_silence(audio, silence_thresh=-60)