i want to code a playbook which IF a user exists changes the pw of it. The playbook should be able to take n User’s and change the pw of those Users. At the moment im having the issue that the when is empty due to the loop, i tried using with_items: {{ user_exists.results }} but this is somehow not
Tag: linux
Make permanent connection with MySQL (Apache Spark)
If I execute these commands in spark-shell it correctly returns the data in the “people” table: The problem is if I close spark-shell and return it open, the connection to the database is not maintained. Answer As per Spark’s documentation, SparkContext and HiveContext get created inside the…
Find lines starting with “t”, continue with a vowel and total length 4
I have a file with containing 300+ words. I need to find lines starting with “t”, continue with a vowel and total length of 4. Then i need to convert them in to a format where each line have one word. With this I’m able to format the file but i cant figure out how can i select words with
HiveMQ systemctl service not listening to port
I am trying to set up HiveMQ on my Amazon EC2 instance (ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414) using this guide: http://www.hivemq.com/docs/hivemq/latest/#hivemqdocs_installation_for_specific_operating_systems After installing I can succesfully run HiveMQ using: Change directory to H…
C read() : Invalid arguments
I am trying to read from a nbd device with function read() Here is the code: argv[2] is a nbd device: /dev/nbd0 MSGDEBUG is defined to print __FILE__, __LINE__ and __FUNCTION__ and I got the error msg: Error!!! dedup.c: 554: main read: Invalid argument err: 0 Aborted Am I doing something wrong? Answer read re…
How to install JavaPackage on ubuntu
I came across a debian application by the name JavaPackage which can create a debian installation file (.deb) form a java binary (.tar.gz) which you can then install using dpkg -i application_name.deb. With Ubuntu being a debian-based linux distribution, it is possible that it can be installed on ubuntu as we…
BASH: How to copy the name of the file and insert it into the text using script?
So I need to create a lot of text files. Each of the text file is named AAAAA.txt, BBBBB.txt, CCCCC.txt and etc etc. Within each text file, all the content is as follows: 1.Copy “to-be-replaced”.txt into the folder EXCLUSIVE. 2.Copy the gs file to replace the existing gs file. 3.The .projectdata s…
How to restart a service using sytemd when it crashed based on only certain signals
Basically, I just want to achieve the same functionality as that of init.d’s monitor using systemd I have a service which runs as a daemon. If that service crashes due to some reason, I want to restart it using systemd. When I went through other questions and answers related to this, I found that we can…
Convert multiple SFTP command lines to a single line command line
How do I convert this EOF into a one line sftp command-line? Answer Your question has nothing to do with SFTP/sftp. It’s just a generic shell question. So use any method that a shell allows, for example
How to display a few line from the last few lines for a given number of files?
I have a folder with many different files. I want to display a specific line from the last 100 line of a list of files. So far I have tried both Grep and Tail but neither gave me exactly what I want: Example: the folder has the following files: file_1.txt file_2.txt file_3.txt other_file.txt other_file2.txt C…