Skip to content

RaniAgus/linux-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux-utils

Scripts para instalar las apps que uso.

zsh Plugins

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

Shortcuts

Rofi launcher and SSH

rofi -show run
rofi -show ssh

Execute zsh after exiting ranger

gnome-terminal -e "zsh -c '. ranger;zsh'"

Cheatsheet

Replace spaces with dashes (all files in folder)

rename -n 's/ /-/g' *

Check video durations (all files in folder)

ls | xargs -n1 -I {} ffmpeg -i {} 2>&1 | grep "Duration:"

Change commit author

grb -i HEAD~N
# Mark all commits for edit and repeat N times:
gcn! --author="Agustin Ranieri <aguseranieri@gmail.com>"
grb --continue

Fix file permissions

git diff --name-only | xargs -i chmod 644 "{}"

Import mongo from multiple JSON files

$ tree .
.
├── collection1.json
├── collection2.json
└── collection3.json
ls | cut -f1 -d. | xargs -n1 -i -p mongoimport --db $DB_NAME --collection {} --file {}.json

Remove Ctrl + p keybinding for display switch

  • Open dconf-editor
  • Navigate to org -> gnome -> mutter -> keybindings -> switch-monitor
  • Then uncheck the box about using the default value and set the custom value to []
  • Restart

Repair grub dual boot

# Install required software
sudo apt install -y os-prober grub-customizer
# Add other OS to grub
sudo os-prober
# Update grub
sudo update-grub
# Check grub configuration
sudo grub-customizer

Repair /boot/efi dual boot

# Find Windows efi partition 
sudo fdisk -l

# Mount it
sudo mkdir /mnt/windows
sudo mount /dev/sda1 /mnt/windows

# Copy Windows entry
sudo cp -r /mnt/windows/EFI/Microsoft/ /boot/efi/EFI

# Remove "noprompt" from linux entry
sudo sed -i 's/ noprompt / /g' /boot/efi/EFI/Pop_OS-*/cmdline

# Add starting menu with timeout
printf "timeout 10\nconsole-mode max\n" | sudo tee /boot/efi/loader/loader.conf > /dev/null

Ref:

Fix dual boot time

sudo timedatectl set-local-rtc 1

image

image

image

  1. Pair all devices with Ubuntu

  2. Pair all devices with Windows

  3. Go back to Ubuntu

  4. Mount Windows device

  5. Go to Windows/System32/config

  6. Get all devices' pairing keys:

chntpw -e SYSTEM # this will open a console
cd \ControlSet001\Services\BTHPORT\Parameters\Keys
ls # shows you your Bluetooth port's MAC address
Node has 1 subkeys and 0 values
  key name
  <aa1122334455>
cd aa1122334455 # cd into that folder
ls  # list the existing devices' MAC addresses
Node has 0 subkeys and 1 values
  size     type            value name             [value if type DWORD]
    16  REG_BINARY        <00aa22ee4455>
hex 00aa22ee4455 # open the value for that MAC address
=> :00000 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX .................
  1. Rewrite the pairing keys in Linux config files:
sudo su # run as superuser
cd /var/lib/bluetooth/
ls # list all pairing keys
nano "00:AA:22:EE:44:55/info"
[LinkKey]
Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  1. Restart bluetooth service:
sudo systemctl restart bluetooth

About

Scripts para instalar las apps que uso

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages