Skip to content

Instantly share code, notes, and snippets.

@joaomagfreitas
joaomagfreitas / dlt_viewer_install.bash
Last active August 15, 2023 10:30
(debian/ubuntu One click DLT Viewer Install script
#!/usr/bin/env bash
# This is an one-click install script using the instructions listed on the official dlt-viewer repo: https://github.com/COVESA/dlt-viewer/blob/master/INSTALL.md
# This script is intended to be run on Debian / Ubuntu based systems.
banner="
___ __ ______ _ __ ____ ____ _ __ ____ ___
/ _ \ / / /_ __/____| | / // _// __/| | /| / // __// _ \
/ // // /__ / / /___/| |/ /_/ / / _/ | |/ |/ // _/ / , _/
/____//____//_/ |___//___//___/ |__/|__//___//_/|_|
@joaomagfreitas
joaomagfreitas / docker_install.bash
Last active August 14, 2023 19:15
(debian/ubuntu/elementaryos) One click Docker Install script
#!/usr/bin/env bash
# This is an one-click install script using the instructions listed on the official Docker docs: https://docs.docker.com/engine/install/debian/
# This script is intended to be run on Debian / Ubuntu based systems.
banner=" _____ __
/__ / ____ _____/ /_____ _____
/ / / __ \/ ___/ //_/ _ \/ ___/
/ /__/ /_/ / /__/ ,< / __/ /
/____/\____/\___/_/|_|\___/_/
@joaomagfreitas
joaomagfreitas / snoweffect.js
Created January 5, 2023 12:58
Plug n Play Global DOM Snow Effect
https://embed.im/snow/?utm_source=tldrnewsletter
<script src="https://app.embed.im/snow.js" defer></script>
/* https://embed.im/snow */
var embedimSnow = document.getElementById("embedim--snow");
if (!embedimSnow) {
function embRand(a, b) {
return Math.floor(Math.random() * (b - a + 1)) + a
}
@joaomagfreitas
joaomagfreitas / n.bash
Created December 29, 2022 13:04
Install/Upgrade Node.js
sudo npm i -g n
sudo n i 18.12.1
@joaomagfreitas
joaomagfreitas / compress_images.bash
Last active December 8, 2022 09:57
compress images in a directory (webp)
images_path="*.png"
if ! [[ -z "$1" ]];
then
echo images_path=$1
fi
for file in $images_path
do
cwebp -q 80 "$file" -o "${file%.*}.webp"
@joaomagfreitas
joaomagfreitas / gen.js
Last active December 8, 2022 00:09
association table mixer
function getRandomInt(max) {
return Math.floor(Math.random() * max) + 1;
}
function genPairs(a, b, o) {
let c = 0;
while (c <= b) {
const d = getRandomInt(b);
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
@joaomagfreitas
joaomagfreitas / kali-linux-apt-setup.bash
Created March 5, 2022 11:25
Setup Kali Linux via apt
#!/bin/bash
# Tutorial provided by: https://dev.to/zuoshihua/deploy-kali-linux-with-gui-on-the-cloud-3me0
## Kali apt repository setup
sudo apt update && apt upgrade
echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" | sudo tee /etc/apt/sources.list
curl https://archive.kali.org/archive-key.asc | sudo apt-key add
sudo apt update
function downloadObjectAsJson(exportObj, exportName){
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj));
var downloadAnchorNode = document.createElement('a');
downloadAnchorNode.setAttribute("href", dataStr);
downloadAnchorNode.setAttribute("download", exportName + ".json");
document.body.appendChild(downloadAnchorNode); // required for firefox
downloadAnchorNode.click();
downloadAnchorNode.remove();
}
@joaomagfreitas
joaomagfreitas / university_projects.md
Last active March 8, 2021 18:52
Remarkable University Projects

Marks are in the scale of 0 to 20 (0/20)

From oldest to newest:

2018

CDIO-IL 2017/2018 - https://github.com/freitzzz/cdioil-2017-g003-backup (19/20)

My first experience in working on a project that is not merely like all university end of semester group projects. Scrum and CDIO frameworks were "sort of" applied in a project along the fourth semester (2º year) of ISEP BSc in Informatics Engineering course, in which three teams of 8 students developed software for a client.