Skip to content

Instantly share code, notes, and snippets.

@Cobesz
Cobesz / update_wordpress_and_plugins.sh
Last active February 28, 2023 14:11
Small bash script to update all wordpress webapplications - only minor updates
#!/bin/bash
array=($(ls /home/))
for i in "${array[@]}"; do #loop through all users in home folder
if [ $i = user_1 ] || [ $i = user_2 ]; then #exclude certain users
echo "Skipped $1"
else
echo $i
cd /home/$i/<path>/<to>/<wordpress>/<dir>/*
@Cobesz
Cobesz / convert webm_to_mp4.sh
Created September 30, 2022 15:44
Gnome screenshot tool allows you to record screencasts in webm format. For some usecases (documentation for example) I want to convert this screencast to a mp4 format so I can easily share it to contacts in Whatsapp/Telegram/Signal or some other application that doesn't support webm playback.
#!/bin/bash
INPUT="$1"
OUTPUT="$(basename "${INPUT%.*}")"
ffmpeg -i "${INPUT}" \
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \
"${OUTPUT}.mp4"
@Cobesz
Cobesz / convert_screencast_to_gif.sh
Created September 30, 2022 15:39
Gnome screenshot tool allows you to record screencasts in webm format. For some usecases (documentation for example) I want to convert this screencast to a gif format so I can easily place it inside other documents. (Markdown files for example as they don't support webm yet).
#!/bin/bash
INPUT="$1"
OUTPUT="$(basename "${INPUT%.*}")"
ffmpeg -i "${INPUT}" \
-vf "fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
-loop -1 \
"${OUTPUT}.gif"
gifsicle --optimize=3 --output "${OUTPUT}-optimized.gif" --resize-height 600 "${OUTPUT}.gif"
@Cobesz
Cobesz / displays.sh
Last active December 6, 2020 16:11
#!/bin/bash
xrandr --output HDMI-0 --mode 1920x1080 --rate 60.00 \
--output DVI-D-0 --mode 1920x1080 --rate 60.00
sleep 5
xrandr --output HDMI-0 --primary --mode 1920x1080 --rate 60.00 \
--output DVI-D-0 --mode 3840x2160 --rate 60.00

Keybase proof

I hereby claim:

  • I am cobesz on github.
  • I am cobesz (https://keybase.io/cobesz) on keybase.
  • I have a public key ASDTT3cBcxmKTPQRH4b3ipDN2u1svwlIRjmWtbWB1rIjcwo

To claim this, I am signing this object: