Skip to content

Instantly share code, notes, and snippets.

View rhiroyuki's full-sized avatar
🏠
Working from home

Ricardo Eihara rhiroyuki

🏠
Working from home
  • Brazil
View GitHub Profile
#! /bin/bash
main () {
sudo pacman -Syu --noconfirm
sudo pacman -S tmux \
zsh \
neovim \
fzf \
fd \
jq \
# CEDILLA
# replace ć with ç when using US international with dead keys' keyboard layout in Linux
sudo echo "GTK_IM_MODULE=cedilla" >> /etc/environment
sudo echo "QT_IM_MODULE=cedilla" >> /etc/environment
# keyboard layouts
# localect changes the settings that should be used in programs (including Xorg server) started after, while setxkbmap changes keyboard options for the currently running Xorg server. Also setxkbmap allows more fine-grained control, and allows switching between varios layouts during runtime. (https://superuser.com/a/1330439)
# https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration
# list current keyboard layout
setxkbmap -query
# list available models/options/variants
localectl list-x11-keymap-models

Ecto

Getting the first record

In ActiveRecord

User.first

In Ecto

kubectl get pods --all-namespaces
kubectl config get-contexts
kubectl config use-context {some-context-here}
kubectl exec -it --namespace {namespace} {pod-name} bash
kubectl --namespace {namespace} delete pod {pod-name}
def old_method
100000.times do
sleep(1)
end
end
def new_method
100000.times do
sleep(2)
end

Installing rmagick in old ruby versions on Arch:

$ sudo pacman -S libmagick6 # Make sure it's the most recent updated 6 version.

$ PKG_CONFIG_PATH=/usr/lib/imagemagick6/pkgconfig gem install rmagick -v 2.16.0

Make sure imagemagick6 is in the last version: rmagick/rmagick#785

# DOCKER
# Running docker without sudo:
sudo usermod -aG docker $USER
# You need to logout in order to apply the settings
# To get more information about each command and its parameters
# type $docker command --help
# ex: docker stop --help