To restart your X Window Server from the command line in linux, without affecting any non-graphical programs (but losing any unsaved information in your graphical user interface programs), you can use the following:
sudo systemctl restart display-manager
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 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
You want to reset the root password for MySQL in your linux Ubuntu installation.
Follow the steps described https://linuxconfig.org/how-to-reset-root-mysql-password-on-ubuntu-18-04-bionic-beaver-linux