The other day my sound stopped working on Ubuntu 18.04 desktop. I have no clue why. The sound stopped working overnight for some reason. After some research I found the below command to restart the sound service on Ubuntu:
pulseaudio -k && sudo alsa force-reload
All works now! Give it a try and let me know if it works for you. Follow me on Twitter @itprohelper
I started an Ubuntu EC2 the other day hoping to run Ansible on it and was surprised that Python was not installed. A requirement for Ansible to run on target machines is to have a modern version of Python.
You can just run sudo apt install python but this is not ideal if you need to install python on let’s say 200 Ubuntu Servers.
The raw module to the rescue
Before writing the playbook, you will need to make minor changes to how Ansible connects to remote hosts.
Create a new file in your current directory and call it ansible.cfg. This file will override settings in the default /etc/ansible/ansible.cfg. Example:
[defaults] inventory = hosts remote_user = ubuntu # Use the below if you’re connecting for the first time host_key_checking = False # Location of your .pem you got from AWS private_key_file = ~/.ssh/yourkey.pem
Now create a hosts file:
[ubuntu_server] 18.104.22.168 # This is a sample IP address. Use your IP.
The playbook using the raw module
This playbook will install python on the target host Ubuntu EC2 server:
A .gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Normally, this is placed in the root directory of your repository. This is the recommended way. The patterns in the .gitignore file are relative to the location of the file.
Easiest pattern is a literal file name:
This will ignore any files named .DS_Store which is common in MacOS.
You can ignore entire directories by including their paths and putting a / at the end:
node_modules/ logs/ secret_directory/
If you leave the slash ‘ / ‘ at the end you will match both directories and file names.
This is simple. Open a terminal and follow the steps below. This worked for me on MacOS 10.13.6
Open the Terminal.
Run sudo vim /etc/services
Enter your password
Find the lines assigned to port 22, something like the image below
Replace both ports 22 with your desired ssh port using a number between 1024 and 32,767
Now you need to restart the services. Be sure to do this if you have direct access to the console for your MacOS. If you do it remotely you may loose connection. I could not find a way to ‘restart’ a service on MacOS as we normally do in Linux. You have to ‘unload’ and ‘load’ the service in MacOS. Use the below commands.