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
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 follow the example for working with skaffold by using the skaffold dev command but you are getting the following error:
kosmas:getting-started (master)$ skaffold dev
WARN[0000] Your Skaffold version might be too old. Download the latest version (1.0.1) at https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
Download the latest release from here https://github.com/GoogleContainerTools/skaffold/releases and follow the instructions for installing it in your system (ie linux):
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v1.0.1/skaffold-linux-amd64 && chmod +x skaffold && sudo mv skaffold /usr/local/bin
You have a docker container with an application running in a port different than port 80 (ie port 3000), and would like to access it without specifying the port, by using the domain name only.
Use the nginx proxy_pass as follows:
server {
listen 80;
server_name your_server_domain_name.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
}
}
You are using the dump files from MySQL (earlier version than 5.7 – that has -skip-definer option in mysqlpump), that outputs the DEFINER keyword in Functions and Views, which causes en error when trying to import in a different database that the users do not exist.
Use the following in your database dump to remove these keywords:
For FUNCTIONS
sed -i 's/DEFINER=\S*\sFUNCTION/FUNCTION/' mysql_dump
For VIEWS
sed -i '/50013\sDEFINER/d' mysql_dump
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:
System Information
Manufacturer: LENOVO
Product Name: 20HRCTO1WW
Version: ThinkPad X1 Carbon 5th
You would like to find the files modified between certain times using find
Use the following find command using the -newerXY parameter to specify times you want to look for (ie betwen 2019-09-23 06:00:00 and 2019-09-23 10:00:00)
find . -type f -newermt "2019-09-23 06:00:00" ! -newermt "2019-09-23 10:00:00" | xargs ls -tral
Gitlab has some predefined variables that can be used in the CI/CD scripts.
The full list of the variables can be found here: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
To use the build directory variable you need to use the CI_PROJECT_DIR
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[7471]: 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.