Skip to content

Instantly share code, notes, and snippets.

View gut5's full-sized avatar
💭
who cares

guts gut5

💭
who cares
  • !the boat
View GitHub Profile
@gut5
gut5 / helpful_scripts.sh
Last active December 24, 2023 13:10
Useful Linux scripts
#Script to find big files on Linux
#change 500M to required size
find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $NF ": " $5 }'
# fstrim with output
sudo fstrim --fstab --verbose
@gut5
gut5 / InitialSetup.sh
Last active February 7, 2022 20:40
InitialSetup.sh
#!/bin/sh
#wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
#sudo mv hosts /etc/hosts
#for opensuse
#sudo zypper install neovim git sqlite sensors podman
# atop
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
@gut5
gut5 / add_timestamp_with_imagemagick.sh
Created December 20, 2017 19:29
Add timestamp to photos using Imagemagick
for img in *jpg; do convert "$img" -gravity SouthWest -pointsize 200 \
-fill red -annotate +30+30 %[exif:DateTime] "time_""$img";
done
select replace(convert(varchar,getdate(),112),'.','') + '_' + REPLACE(CONVERT(varchar(5), GETDATE(), 108), ':', '') '_' +
#these instructions are for Ubuntu 19.04+
#get the deb https://github.com/devkitPro/pacman/releases/latest
sudo dpkg -i devkitpro-pacman.deb
#add this shit to .profile or .bashrc or .bash_profile, doesn't have to be all 3
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
@gut5
gut5 / init.vim
Last active December 14, 2020 13:25
set number
set hlsearch
set incsearch
set foldmethod=indent
syntax enable
filetype plugin indent on
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
@gut5
gut5 / git-things.sh
Created July 9, 2021 19:29
Useful Git things
# for seeing who has committed how much to your project
git shortlog -sn --all --no-merges
# See who last changed lines 5 through 10 of the buttons’ CSS:
git blame -L5,10 _components.buttons.scss
# easier to see diff changes
git diff -w
git diff --word-diff
@gut5
gut5 / ps1
Created February 17, 2022 19:25
ps1
export PS1="\[\033[38;5;92m\][\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;162m\]\@\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;92m\]]\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;50m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;39m\]>\[$(tput sgr0)\] \[$(tput sgr0)\]"
for f in ./*.mkv
do
ffmpeg -i "$f" [...]
done
@gut5
gut5 / gist:e6066ced772ed17ada294c3539ff20b7
Created March 19, 2023 17:58
ffmpeg batch convert mp4 to webm
$folder = "C:\path\to\folder"
$webm = "C:\path\to\webm\folder"
$mp4Files = Get-ChildItem -Path $folder -Filter "*.mp4"
foreach ($file in $mp4Files) {
$fileName = $file.Name
$input = $folder + "\" + $fileName
$output = $webm + "\" + $fileName.Replace(".mp4", ".webm")