Skip to content

Instantly share code, notes, and snippets.

View oliveirarthur's full-sized avatar
💻

Arthur Oliveira oliveirarthur

💻
View GitHub Profile
@oliveirarthur
oliveirarthur / 1_pop_os_enable_hibernation.sh
Last active March 19, 2025 02:13
Shell script that enables hibernation on Pop_OS! and based on [this article](https://support.system76.com/articles/enable-hibernation/)
#!/bin/bash
set -e
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "This script must be run as root."
exit 1
fi
@oliveirarthur
oliveirarthur / fix_cedilla.sh
Last active June 29, 2025 12:36 — forked from ericdouglas/keyboard.md
Cedilla under C (ç) in 'US international' keyboard layout in Linux
#!/bin/bash
# Update GTK cache to include support for the cedilla module in English
GTK3_CACHE_FILE="/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache"
if [ -f "$GTK3_CACHE_FILE" ]; then
sudo sed -i 's/\("cedilla" "Cedilla" "gtk30" \)/\1en:/' "$GTK3_CACHE_FILE"
fi
GTK2_CACHE_FILE="/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache"
if [ -f "$GTK2_CACHE_FILE" ]; then
  1. Create the project in the Firebase Console
  2. Setup a new "Service account" in the Firebase project settings
    1. Open the Project settings from the left sidebar
    2. Go to the "Service accounts" tab
    3. Under "All service accounts" click in the link that goes to the GCP console
    4. On the left sidebar, click "Service accounts" -> "Create service account"
    5. Type a name, assign the following roles: "Artifact Registry Repository Administrator", "Cloud Functions Admin", "Firebase Viewer", "Service Account User"
    6. Click done
    7. Select the service account you just created from the list
    8. Go to the "Keys" tab -> "Add Key" -> "Create new key" -> "JSON" -> Click "Create"
#!/bin/sh
# BETA in 2022-05-14
(
echo "Installing curl, git, vim"
sudo dnf update && sudo dnf install -y \
curl \
git \
vim
# Step 1. Stop docker daemon.
/etc/init.d/docker stop
# Step 2. Make sure that there are no docker related processes.
ps aux|grep docker
# Step 3. Move the contents of /var/lib/docker to your new location.
mv /var/lib/docker /home/
# Step 4. Create a softlink to default location.
@oliveirarthur
oliveirarthur / ubuntu.bashrc
Last active May 17, 2025 04:35
Aliases and functions for Ubuntu-based distros
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

tsc

  • --listEmittedFiles Print names of generated files part of the compilation.
  • --listFiles Print names of files part of the compilation.
  • --watch | -w Run the compiler in watch mode. Watch input files and trigger recompilation on changes. The implementation of watching files and directories can be configured using environment variable. See configuring watch for more details.
@oliveirarthur
oliveirarthur / after-install.deb.sh
Last active May 17, 2025 03:55
Convenience script for installing applications after formatting your machine
#!/bin/bash
set -e
install_basics() {
echo "Installing curl, git, vim"
sudo apt-get update && sudo apt-get install -y curl git vim
echo "Git configuration:"
read -p 'git config --global user.name: ' userName
@oliveirarthur
oliveirarthur / php
Last active March 13, 2025 03:11
Example of how to use docker containers as Linux executables
#!/bin/sh
# sudo ln -s /path/to/this/script/php /usr/bin/php
# sudo chmod +x /usr/bin/php
# OR
# create a function in ~/.profile
docker run \
--rm \
-i \
@oliveirarthur
oliveirarthur / embedded-file-viewer.md
Created July 3, 2018 22:46 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links