Skip to content

Instantly share code, notes, and snippets.

View android10's full-sized avatar
👇
fernandocejas.com

Fernando Cejas android10

👇
fernandocejas.com
View GitHub Profile
@android10
android10 / oh-my-zsh-powerlevel9k-theme.md
Last active March 10, 2024 10:53
oh-my-zsh with PowerLevel9k on Arch Linux

Attention: This is DEPRECATED in favor of PowerLevel10K, I wrote an article about it:

Install oh-my-zsh with powerlevel9k theme on Arch Linux

This gist aims to facilitate the switching from bash to zsh as our defaut shell. We will be using oh-my-zsh with the powerful theme: Powerlevel9k. You will find all the links below. This process applies mainly for Arch Linux, but can be setup for any other distro (in theory :)). I'm also using Gnome Terminal and pacaur as package manager.

@android10
android10 / install_pacaur.sh
Last active February 16, 2024 03:52
SCRIPT to install Pacaur on Arch Linux: https://wiki.archlinux.org/index.php/AUR_helpers
#ATTENTION: Check the Troubleshooting items below if you have problems, you can also visit my website where I wrote about it.
# LINK: https://fernandocejas.com/blog/engineering/2020-12-28-install-arch-linux-full-disk-encryption/#aur-helper
#!/bin/bash
#Make sure the system is up to date.
sudo pacman -Syu --noconfirm
@android10
android10 / linux-battery-notifier.py
Last active December 17, 2023 20:30
Tiny Python script for Linux Users to notify when Battery Level is low. Use it with a cronjob
#!/usr/bin/env python3
"""
This script aims to alert when the battery
reaches a critical level in the system.
"""
import os
CRITICAL_BATTERY_PERCENTAGE = 8
@android10
android10 / ranger-cheatsheet.md
Last active October 15, 2023 13:19 — forked from heroheman/ranger-cheatsheet.md
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@android10
android10 / build.gradle
Last active August 29, 2023 14:31
Compile and launch android app from the command line.
task deployDebug(type: Exec, dependsOn: 'app:installDebug') {
def rootDir = project.rootDir
def localProperties = new File(rootDir, "local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream {
inputStream -> properties.load(inputStream)
}
def sdkDir = properties.getProperty('sdk.dir')
def adb = "$sdkDir/platform-tools/adb"
@android10
android10 / archlinux-issues.md
Last active May 13, 2023 01:07
Arch Linux Troubleshooting - Also other distros
@android10
android10 / archlinux-larger-font-console.md
Last active February 5, 2023 09:33
Install larger (and cooler) font on Arch Linux Console: https://wiki.archlinux.org/index.php/Linux_console#Fonts
@android10
android10 / install_ubuntu_fonts_rehat.md
Last active November 24, 2022 23:05
Install Ubuntu Fonts on RedHat/Fedora Linux

1 - Open the terminal and type below given command

cd /root
yum install wget       (you can skip this step if wget is already installed)
wget https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-0.83.zip (check the newest version)

2 - Check if the directory /usr/share/fonts exist. If the fonts directory do not exist,you can create yourself.

@android10
android10 / gammastep.sh
Created November 18, 2022 20:15 — forked from quangdinh/gammastep.sh
Sway / Waybar / Wofi / Swaylock config & styles
#!/usr/bin/env bash
pid=$(pgrep gammastep)
if [[ $1 = "toggle" ]]; then
if pgrep -x "gammastep" > /dev/null; then
kill -9 $(pgrep -x "gammastep");
else
gammastep -O ${GAMMASTEP_NIGHT:-3500} &
fi
@android10
android10 / vpn.sh
Created August 20, 2018 15:19
LINUX: Script to facilitate running openvpn from the command line, especially when a Linux/Unix client is used with Access Server, the Access Server is unable to alter the DNS settings on the client in question causing issues on host resolving.
# -----------------------------------------------
# BEFORE USING THIS SCRIPT
# -----------------------------------------------
# 1 - Create a file in /etc/<yourpassfile>.pass which contains the vpn private key password.
# 2 - Set permission for the file: 'sudo chmod 600 /etc/<yourpassfile>.pass' - Owner can read and write.
# 3 - Create an alias in your .bashrc or bash_profile: alias vpn="sudo sh <path to your script>".
# 4 - Set the value of the variable OVPN_FILE_PATH with the path of the .ovpn file.
# 5 - Set the value of the variable OVPN_PRIVATE_KEY_FILE_PATH with the path of the created file in step #1: /etc/<yourpassfile>.pass
# 6 - OPTIONAL: avoid password when executing the script, add this to /etc/sudoers '<your username> ALL=(ALL:ALL) NOPASSWD:<path to your script>'