Featured image of post Tools

Tools

Documentation Workflow and Tools

SnapShots

To make quick and efficient snapshots I use ShareX, it can be set to make a lot of thing after snashot has been taken: send to a server, savec file to specific folder, create a thumbnail of the image, upload it to google drive, nextcloud etc…

image

This software can add pixelised/blurred area, add cursor, stamps with numbers to create step by step examples. image

###Automatisation run Powershell as administrator, then

Then we need to convert powershellscript to exe in order to use it as an “action” doable by shareX after capture

Install-Module ps2exe

1
Invoke-ps2exe .\source.ps1 .\target.exe

Image editing

To resize image for online publication, I will use ImageMagik

image

A cheatSheet for commands: https://github.com/yangboz/imagemagick-cheatsheet

Some usefull commands

1
magick mogrify -resize 1000 *.jpg

Change every png to jpg

1
magick mogrify -format jpg *.png

compress jpg

1
magick mogrify -format jpg -quality 80 *.jpg

Video Recording and Editing

usefull links: https://fabacademy.org/2019/labs/barcelona/local/clubs/codeclub/ffmpeg/

https://ottverse.com/change-resolution-resize-scale-video-using-ffmpeg/

I use this command to convert video from my screen recorder (ShareX):

ShareX save video with “ultrafast” preset for encoding, it allow a realtime recording of the screen but it is not optimal for compression. We change compression a posteriori, without changing resolution with

1
ffmpeg -i input.mp4 -c:v libx264 -crf 24 -preset slow output.mp4

To decrease resolution, we can use the above command, $width must be changed with the new width in pixel, the -1 keep the original aspect ratio:

1
ffmpeg -i input.mp4 -vf scale=$width$:-1 output.mp4

Better, we can use this command where iw and ih are the input height and width

1
ffmpeg -i input.mp4 -vf "scale='min(320,iw)':'min(240,ih)'" output.mp4

To keep aspect ratio, it become

1
ffmpeg -i input.mp4 -vf "scale='min(NEW_WIDTH,iw)':-1" output.mp4

To change framerate:

1
ffmpeg -i input.mp4 -filter:v fps=NEW_FRAMERATE output.mp4

Resize a video to 600px width:

1
ffmpeg -i video_name.mp4 -vf "scale='min(600,iw)':-1" video_name-r.mp4

Recompress a video to match a target output size (here 850k, target not always reached exactly):

1
ffmpeg -i "video_name.mp4" -b:v 850k -strict -2 "video_name_ffmpg.mp4"

Other tools

Led Mapper

Some time ago, I heard about a cool software to help creating light effect with abritrary positionned adressable LEDs: LEDMapper. It wiil be usefull for my final project

https://jasoncoon.github.io/led-mapper/

image

image

Powershell usefull commands

Display all files and sizes in KB:

1
Get-ChildItem -Recurse |  Where-Object { !$_.PsIsContainer } | Select-Object -Property Name, Length | Sort-Object -Property Length | ForEach-Object { $_.Name + " " + [Math]::Round($_.Length/1KB,2) + " KB" }

image

Git tricks

To recover from a previous commit, we can use the folling command. Where COMMIT_ID can be found on gitlab web interface under commits section.

1
2
3
git reset --hard COMMIT_ID
git pull
git push -f origin main

Hugo website deployment

We can compile markdown file to html file using hugo on local side, but it create a bunch of additional file that can exceed filesize limit when doing a push on fabacademy gitlab. To avoid this, we can make the hugo compilation on server side using .gitlab-ci.yml file. To modify this file, I follow this tutorial: https://docs.gitlab.com/ee/tutorials/hugo/

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy