Skip to content

Instantly share code, notes, and snippets.

View RBFraphael's full-sized avatar
🙂

Raphael Batista Fontão RBFraphael

🙂
View GitHub Profile
@RBFraphael
RBFraphael / mint-post-install-user.sh
Last active December 12, 2024 12:14
Post install script for Linux Mint 22 - User mode
#!/usr/bin/env bash
NGROK_AUTHTOKEN='<put your ngrok authtoken here>'
GIT_USER='<put your git username here>'
GIT_EMAIL='<put your git user email here>'
C_YELLOW=`tput setaf 220`
C_RESET=`tput init`
check_root_user() {
@RBFraphael
RBFraphael / mint-post-install.sh
Last active December 12, 2024 12:05
Post install script for Linux Mint 22
#!/usr/bin/env bash
CURRENT_USER=$1
HOME="/home/$CURRENT_USER"
# Change URLs below with updated ones
DEB_DOCKER="https://desktop.docker.com/linux/main/amd64/docker-desktop-amd64.deb"
DEB_DRAWIO="https://github.com/jgraph/drawio-desktop/releases/download/v24.7.17/drawio-amd64-24.7.17.deb"
DEB_GOOGLE_CHROME="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
DEB_HYPER="https://releases.hyper.is/download/deb"
@RBFraphael
RBFraphael / ubuntu-post-install-user.sh
Last active October 25, 2024 02:01
Ubuntu Post-Install Script for Ubuntu 24.04 - User Mode
#!/usr/bin/env bash
C_YELLOW=`tput setaf 220`
C_RESET=`tput init`
check_root_user() {
if [ "$(id -u)" -e 0 ]; then
echo 'This script is intended to be run as non-root users'
exit
fi
@RBFraphael
RBFraphael / ubuntu-post-install.sh
Last active October 25, 2024 00:08
Ubuntu Post-Install Script for Ubuntu 24.04
#!/usr/bin/env bash
CURRENT_USER=$1
HOME="/home/$CURRENT_USER"
# Change URLs below with updated ones
DEB_URL_DOCKER="https://desktop.docker.com/linux/main/amd64/docker-desktop-amd64.deb"
DEB_URL_VBOX="https://download.virtualbox.org/virtualbox/7.1.4/virtualbox-7.1_7.1.4-165100~Ubuntu~noble_amd64.deb"
VBOX_EXT_PACK="https://download.virtualbox.org/virtualbox/7.1.4/Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack"
DEB_URL_DRAWIO="https://github.com/jgraph/drawio-desktop/releases/download/v24.7.17/drawio-amd64-24.7.17.deb"
@RBFraphael
RBFraphael / add-open-with-code.sh
Last active October 22, 2024 22:08
Add Visual Studio Code as option for opening folders in Linux distributions
#!/bin/sh
sed -i '/MimeType/c\MimeType=text/plain;inode/directory;application/x-code-workspace;' /usr/share/applications/code.desktop
update-desktop-database
@RBFraphael
RBFraphael / database.js
Last active December 30, 2023 17:56
Electron SQLite Example
const path = require("path");
const fs = require("fs");
const { app } = require("electron");
const sqlite3 = require("sqlite3").verbose();
// Build the database path and output to the console
const appDataPath = app.getPath("appData");
const databasePath = path.join(appDataPath, "database.sqlite");
console.log(`Database Path: ${databasePath}`);
@RBFraphael
RBFraphael / ApiService.ts
Created August 11, 2023 15:40
Service TypeScript
import axios, { AxiosError } from "axios";
const WebApi: any = axios.create({
headers: {
'Content-Type': "application/json",
'Accept': "application/json",
}
});
const PublicApi: any = axios.create({
@RBFraphael
RBFraphael / envvars.js
Created June 20, 2023 15:36
envvar NodeJS helper
const { exec } = require("child_process");
const appPath = process.env.PATH.split(";").filter((segment) => segment.trim().length > 0).filter((segment) => segment.indexOf("node_modules") > -1);
export function getVar(variable, callback){
exec(`echo %${variable}%`, (err, stdOut, stdErr) => {
if(err == null){
if(callback){
callback(stdOut);
}