You would like to have a list of your subdomains for a specific domain (hosted zone), that are hosted in Amazon’s Route 53.
You can install the aws cli docker image from here https://github.com/cgswong/docker-aws if you don’t want to install the aws cli in your computer.
You can afterwards start the container with:
docker run -it cgswong/aws:latest
Then configure it by running the following and adding your credentials and zone:
efe9881d4fd:/tmp# aws configure
AWS Access Key ID [None]: aws_access_key_id
AWS Secret Access Key [None]: aws_secret_access_key
Default region name [None]: eu-central-1
Default output format [None]:
Then run the first command to get a list of the hosted zones and get the id of the hosted zone you want to find the subdomains for:
3efe9881d4fd:/tmp# aws route53 list-hosted-zones
"Comment": "HostedZone created by Route53 Registrar",
Then pick the HOSTEDZONEID and run the following to get a list of subdomains for that domain:
3efe9881d4fd:/tmp# aws route53 list-resource-record-sets --hosted-zone="HOSTEDZONEID" | grep "Name" | uniq
You would like to have a list of IPs or MAC address for the device in your network
Use the ARP protocol’s command:
$ arp -a
dv1.home (192.168.1.102) at 48:xx:xx:xx:xx:xx [ether] on wlp4s0
dv2.home (192.168.1.127) at a4:xx:xx:xx:xx:xx [ether] on wlp4s0
You would like to find out your public IP from the command line without using an online service
Use dig like the following line (taken from https://www.cyberciti.biz/faq/how-to-find-my-public-ip-address-from-command-line-on-a-linux/):
dig +short myip.opendns.com @resolver1.opendns.com
you could also add it as an alias:
alias myip=”dig +short myip.opendns.com @resolver1.opendns.com”
To get a list of all the installed crontab jobs on a server use the following (taken from https://stackoverflow.com/a/134944)
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
You would like to find out the exact model from your Thinkpad X1 laptop, by using your linux command line.
Use the following command:
kosmas:$ sudo dmidecode | grep -A3 '^System Information'
[sudo] password for kosmas:
Product Name: 20HRCTO1WW
Version: ThinkPad X1 Carbon 5th
To correctly stop an autossh running process use the following (taken from https://superuser.com/a/1008029):
sudo pkill -3 autossh
You would like to use autossh to keep a connection open (ie database) between two hosts, but while the ssh equivalent command to start a tunnel works, the autossh does not.
You might be seeing the following errors (using AUTOSSH_DEBUG=1):
autossh: ssh exited prematurely with status 255; autossh exiting
or if you look at /var/logs/syslog you could also see entries like the following:
apparmor="DENIED" operation="open" profile="snap.autossh.autossh" name="/home/autossh/.ssh/id_rsa.pub" pid=7447 comm="ssh" requested_mask="r" denied_mask="r" fsuid=1002 ouid=1002
You have used snap to install autossh which is not allowed by apparmor.
Remove the snap package and install autossh as a normal debian package:
sudo snap remove autossh
sudo apt install autossh
To connect your new Shivr headphones but it would probably work with other bluetooth headphones too, find the MAC address from your headphones (by connection with an Android device first) and do the following from the command line:
sudo apt install bluez-tools
bt-device -l (that will list the available devices)
bt-device -c AA:11:22:33:44:BB
and make sure you change your Music Player Daemon Output (Audio Volume Settings -> Applications) settings to use your new headphones.
You want to run a command in a hosted server but you don’t have su permissions. There are directories that have different owners/permissions, so you would like to see them.
Use the tree command and save the output in a file if you have many directories:
tree -pufid /home/directory_to_check > /home/user/permissions.txt
taken from the answer here: https://unix.stackexchange.com/a/82374
Trying to access or set up the mysql-workbench tool in linux you get the error about forgot_password.
Install the gnome-keyring
sudo apt install gnome-keyring