• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Linux Mint Vera

December 23, 2022

I upgraded to Linux Mint Vera from Una.

ulysses@penguin:~/Code$ neofetch
             ...-:::::-...                 ulysses@penguin 
          .-MMMMMMMMMMMMMMM-.              --------------- 
      .-MMMM`..-:::::::-..`MMMM-.          OS: Linux Mint 21.1 x86_64 
    .:MMMM.:MMMMMMMMMMMMMMM:.MMMM:.        Kernel: 5.15.0-56-generic 
   -MMM-M---MMMMMMMMMMMMMMMMMMM.MMM-       Uptime: 13 hours, 35 mins 
 `:MMM:MM`  :MMMM:....::-...-MMMM:MMM:`    Packages: 2176 (dpkg) 
 :MMM:MMM`  :MM:`  ``    ``  `:MMM:MMM:    Shell: bash 5.1.16 
.MMM.MMMM`  :MM.  -MM.  .MM-  `MMMM.MMM.   Resolution: 3840x2160 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   DE: Cinnamon 5.6.5 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM:MMM:   WM: Mutter (Muffin) 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   WM Theme: Mint-Y-Dark-Aqua (Mint-Y) 
.MMM.MMMM`  :MM:--:MM:--:MM:  `MMMM.MMM.   Theme: Mint-Y-Aqua [GTK2/3] 
 :MMM:MMM-  `-MMMMMMMMMMMM-`  -MMM-MMM:    Icons: Mint-Y-Aqua [GTK2/3] 
  :MMM:MMM:`                `:MMM:MMM:     Terminal: gnome-terminal 
   .MMM.MMMM:--------------:MMMM.MMM.      CPU: AMD Ryzen 7 1700X (16) @ 3.700GHz 
     '-MMMM.-MMMMMMMMMMMMMMM-.MMMM-'       GPU: AMD ATI Radeon R7 240/340 / Radeon 520 
       '.-MMMM``--:::::--``MMMM-.'         Memory: 3864MiB / 15928MiB 
            '-MMMMMMMMMMMMM-'
               ``-:::::-``

ulysses@penguin:~/Code$ neofetch ...-:::::-... ulysses@penguin .-MMMMMMMMMMMMMMM-. --------------- .-MMMM`..-:::::::-..`MMMM-. OS: Linux Mint 21.1 x86_64 .:MMMM.:MMMMMMMMMMMMMMM:.MMMM:. Kernel: 5.15.0-56-generic -MMM-M---MMMMMMMMMMMMMMMMMMM.MMM- Uptime: 13 hours, 35 mins `:MMM:MM` :MMMM:....::-...-MMMM:MMM:` Packages: 2176 (dpkg) :MMM:MMM` :MM:` `` `` `:MMM:MMM: Shell: bash 5.1.16 .MMM.MMMM` :MM. -MM. .MM- `MMMM.MMM. Resolution: 3840x2160 :MMM:MMMM` :MM. -MM- .MM: `MMMM-MMM: DE: Cinnamon 5.6.5 :MMM:MMMM` :MM. -MM- .MM: `MMMM:MMM: WM: Mutter (Muffin) :MMM:MMMM` :MM. -MM- .MM: `MMMM-MMM: WM Theme: Mint-Y-Dark-Aqua (Mint-Y) .MMM.MMMM` :MM:--:MM:--:MM: `MMMM.MMM. Theme: Mint-Y-Aqua [GTK2/3] :MMM:MMM- `-MMMMMMMMMMMM-` -MMM-MMM: Icons: Mint-Y-Aqua [GTK2/3] :MMM:MMM:` `:MMM:MMM: Terminal: gnome-terminal .MMM.MMMM:--------------:MMMM.MMM. CPU: AMD Ryzen 7 1700X (16) @ 3.700GHz '-MMMM.-MMMMMMMMMMMMMMM-.MMMM-' GPU: AMD ATI Radeon R7 240/340 / Radeon 520 '.-MMMM``--:::::--``MMMM-.' Memory: 3864MiB / 15928MiB '-MMMMMMMMMMMMM-' ``-:::::-``

I have 2 issues out of the gate.

  1. Audio is crackling.
  2. Bluetooth does not automatically connect to my Logitech K11 keyboard.

To fix my audio issues, I have to restart pulseaudio.

#!/bin/bash
pulseaudio -k
pulseaudio --start

#!/bin/bash pulseaudio -k pulseaudio --start

You may have to refresh your browser or restart your app to hear audio.

And here’s the command to connect my keyboard. I’ve provided commands how to scan, connect and pair.

#!/bin/bash
# bluetoothctl scan on
# bluetoothctl connect 00:1F:20:A8:EE:1F
# bluetoothctl pair 00:1F:20:A8:EE:1F
# bluetoothctl trust 00:1F:20:A8:EE:1F
# bluetoothctl devices
# bluetoothctl paired-devices
bluetoothctl connect 00:1F:20:A8:EE:1F

#!/bin/bash # bluetoothctl scan on # bluetoothctl connect 00:1F:20:A8:EE:1F # bluetoothctl pair 00:1F:20:A8:EE:1F # bluetoothctl trust 00:1F:20:A8:EE:1F # bluetoothctl devices # bluetoothctl paired-devices bluetoothctl connect 00:1F:20:A8:EE:1F

Output

ulysses@penguin:~$ bluetoothctl connect 00:1F:20:A8:EE:1F
Attempting to connect to 00:1F:20:A8:EE:1F
[DEL] Device 72:D9:FF:CC:41:78 72-D9-FF-CC-41-78
[CHG] Device 00:1F:20:A8:EE:1F Connected: yes
[CHG] Device 00:1F:20:A8:EE:1F Modalias: usb:v046DpB317d0900
[CHG] Device 00:1F:20:A8:EE:1F UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1F:20:A8:EE:1F UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1F:20:A8:EE:1F UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1F:20:A8:EE:1F ServicesResolved: yes
[CHG] Device 00:1F:20:A8:EE:1F WakeAllowed: yes
[CHG] Device 00:1F:20:A8:EE:1F Paired: yes
Connection successful

ulysses@penguin:~$ bluetoothctl connect 00:1F:20:A8:EE:1F Attempting to connect to 00:1F:20:A8:EE:1F [DEL] Device 72:D9:FF:CC:41:78 72-D9-FF-CC-41-78 [CHG] Device 00:1F:20:A8:EE:1F Connected: yes [CHG] Device 00:1F:20:A8:EE:1F Modalias: usb:v046DpB317d0900 [CHG] Device 00:1F:20:A8:EE:1F UUIDs: 00001000-0000-1000-8000-00805f9b34fb [CHG] Device 00:1F:20:A8:EE:1F UUIDs: 00001124-0000-1000-8000-00805f9b34fb [CHG] Device 00:1F:20:A8:EE:1F UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 00:1F:20:A8:EE:1F ServicesResolved: yes [CHG] Device 00:1F:20:A8:EE:1F WakeAllowed: yes [CHG] Device 00:1F:20:A8:EE:1F Paired: yes Connection successful

The connect command performs both connect and pair.

Hoping they patch this soon so I don’t need to run them @reboot in crontab.

Filed Under: Linux

Linux Mint Upgrade

December 20, 2022

Here’s how to upgrade your Linux Mint Desktop.

sudo apt update
sudo apt install mintupgrade

sudo apt update sudo apt install mintupgrade

Then run the upgrade.

sudo mintupgrade

sudo mintupgrade

Filed Under: Linux Tagged With: mint, mintupgrade, upgrade

Open Browser in Bash

November 30, 2022

Here’s a nice little command to open a browser from Bash.

#!/bin/bash
open https://domain.com/path/to/web/page/index.html

#!/bin/bash open https://domain.com/path/to/web/page/index.html

You can use this command to open a web page from your script.

Filed Under: HTML, Linux Tagged With: bash, browser, open

Bash Any Key

November 29, 2022

Here’s the script to add pauses in your Bash script.

echo "please wait until web page loads ... "
read -p "Press any key to continue... " -n1 -s

echo "please wait until web page loads ... " read -p "Press any key to continue... " -n1 -s

You can also put it inside a function and call it multiple times.

function press_any_key {
  echo "please wait until web page loads ... "
  read -p "Press any key to continue... " -n1 -s
}
press_any_key

function press_any_key { echo "please wait until web page loads ... " read -p "Press any key to continue... " -n1 -s } press_any_key

Filed Under: Linux Tagged With: any, bash, key, pause, press

Crontab on macOS Monterey

November 29, 2022

A recent OS upgrade rendered the crontab to malfunction on macOS Monterey. It turned out the system just needed a reset of System Preferences > Security & Privacy > Privacy tab, and to make sure cron has full access to disks. Once you flipped that, your crontab should start working. Hope that helps.

Filed Under: Linux Tagged With: cron, mac os, monterey, reset

Crop Factor Calculator

November 13, 2022

If you’re into photography, you would know what crop factor means. I have a Nikon D90 camera with a crop factor of 1.5. For example, if you use a 24mm full frame lens on a D90, the focal length will be 36mm. So, here’s a handy bash script that calculates the crop factor by multiplying the full frame focal length by 1.5.

#!/bin/bash
if [ $# -eq 0 ]
  then
    echo "Usage: cropfactor.sh 24"
    exit
fi
a=$(echo "1.5 * $1" | bc)
echo "Cropfactor focal length is: " $a"mm."

#!/bin/bash if [ $# -eq 0 ] then echo "Usage: cropfactor.sh 24" exit fi a=$(echo "1.5 * $1" | bc) echo "Cropfactor focal length is: " $a"mm."

Result

ulysses@penguin:~/Code$ ./cropfactor.sh 24
Cropfactor focal length is:  36.0mm.

ulysses@penguin:~/Code$ ./cropfactor.sh 24 Cropfactor focal length is: 36.0mm.

Filed Under: Linux Tagged With: 1.5, bash, crop, d90, factor, nikon

Bulk FFMPEG Resize

October 31, 2022

Here’s how to resize videos and pictures using FFMPEG.

Bulk Resize Pictures

for filename in *.JPG; do 
  ffmpeg -i "$filename" -vf scale=-1:720 final/"$filename";
done

for filename in *.JPG; do ffmpeg -i "$filename" -vf scale=-1:720 final/"$filename"; done

Bulk Resize Video and Create Thumbnail

for filename in *.MP4; do 
  ffmpeg -i "$filename" -s 1080x720 -pix_fmt yuv420p -crf 18 "$filename".mp4; 
  ffmpeg -ss 00:00:00 -i "$filename" -vframes 1 "$filename".jpg;
done

for filename in *.MP4; do ffmpeg -i "$filename" -s 1080x720 -pix_fmt yuv420p -crf 18 "$filename".mp4; ffmpeg -ss 00:00:00 -i "$filename" -vframes 1 "$filename".jpg; done

Filed Under: Linux Tagged With: bulk, ffmpeg, pictures, resize, videos

Vim Cheatsheet

October 27, 2022

Almost all are not able to remember all the shortcuts that are available for the vi or vim editor. I will call it vim throughout this article. There are several cheatsheets out there, but the one that works for me is the one provided by rtorr in Github. I use the cheatsheet often. I suggest that you start small. At the very least learn how to navigate in vim. Once you feel comfortable doing that, you can learn other advanced shortcuts such as editing, search and replace, working with multiple files and many much more. I hope you’ll find the cheatsheet as helpful as it has done for me. Again if you missed the link above, I posted it below.

Vim Cheatsheet

Filed Under: Linux Tagged With: cheatsheet, commands, vi, vim

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Interim pages omitted …
  • Go to page 123
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023