• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Windows Curl Command

January 11, 2023

If you have to download a file from the Internet on a Windows server, can certainly use the browser. But if the browser is rendering the file instead of downloading them, you may have to use the curl command which is already pre-installed on most Windows servers. Just open the command line. Here’s the the curl command to download a file.

curl.exe --output index.txt --url https://website.domain/index.txt

curl.exe --output index.txt --url https://website.domain/index.txt

Filed Under: Misc Tagged With: curl, download, server, windows

AWS List Account Aliases

December 26, 2022

Here’s how to list account aliases. I have four profiles in my credentials. I’m looping through all four and printing the aliases.

#!/bin/bash
file='results-aws-account-aliases.txt'
> $file
declare -a account=("default" "one" "two" "three")
for i in "${account[@]}"
do
    echo '----------------------' >> $file
    echo 'Account: '$i >> $file
    aws iam list-account-aliases \
    --profile $i 
done

#!/bin/bash file='results-aws-account-aliases.txt' > $file declare -a account=("default" "one" "two" "three") for i in "${account[@]}" do echo '----------------------' >> $file echo 'Account: '$i >> $file aws iam list-account-aliases \ --profile $i done

Filed Under: Cloud Tagged With: accounts, aws, iam, list

Linux Screen

December 26, 2022

Just documenting the Linux Screen command.

Install screen first.

yum install screen
dnf install screen
apt install screen
zypper install screen

yum install screen dnf install screen apt install screen zypper install screen

Start a new screen.

screen -S one
screen -S two
screen -S three

screen -S one screen -S two screen -S three

Detach from screen.

Ctrl+a+d

Ctrl+a+d

List active screens.

screen -ls 
There is a screen on:
        15575.one   (Detached)
        15581.two   (Detached)
        15593.three (Detached)
1 Socket in /var/run/screen/S-root.

screen -ls There is a screen on: 15575.one (Detached) 15581.two (Detached) 15593.three (Detached) 1 Socket in /var/run/screen/S-root.

Reattach to an existing screen.

screen -r one
screen -r two
screen -r three

screen -r one screen -r two screen -r three

If there’s only one active screen, you can run screen -r without the name.

screen -r

screen -r

To exit or quit a screen, reattach and run exit.

screen -r three
# exit
[screen is terminating]

screen -r three # exit [screen is terminating]

Filed Under: Linux Tagged With: attach, detach, list, screen

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

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

Copyright © 2023