Jump to content
#StayAtHome ×

ajoo

Members
  • Content Count

    822
  • Joined

  • Last visited

Community Reputation

2 Neutral

About ajoo

  • Rank
    Prolific Member

Recent Profile Visitors

7,425 profile views
  1. HI, I have been trying to create a passwordless user using Ansible. However it fails at the point where the SSH key is to be placed. Below is the playbook that I am using. Text --- - hosts: test1 become: yes tasks: - name: Make sure we have a 'wheel' group group: name: wheel state: present - name: Allow 'wheel' group to have passwordless sudo lineinfile: dest: /etc/sudoers state: present regexp: '^%wheel' line: '%wheel ALL=(ALL) NOPASSWD: ALL' validate: 'visudo -cf %s' - name: Add sudoers users to wheel group user: name: "adminn" groups: wheel append: yes state: present createhome: yes - name: Set up authorized keys for the adminn user authorized_key: user: adminn key: "{{ item }}" with_file: - /home/vagrant/.ssh/id_rsa.pub which ends giving the following error. I have set up the system using vagrant wherein i have a control and node server with default user vagrant that already has a passwordless access from control to the node. This is a new user that I wish to create. I referred to this article . Hoping that someone can help me resolve this error. Thanks all !
  2. Hi, I have been trying to automate the setting up od ssh keys on host machines using ansible. I have setup a master and test machine using vagrant on centos7. It automatically creates the vagrant user on both machines with sudo rights. Now I do not wish to manually copy the public key from the master to the node machine. I would rather have ansible do it. It always gives the following error: My sshd_config has PasswordAuthentication = yes. Yet it does not ask for the password. If I try and ssh into the server directly from the terminal i get the following error : and again it does not ask for the password. Looking for any suggestion and stuff I can try. Thanks all !
  3. ajoo

    simple file copying

    Hi Kicken, Thanks for the response, I'll think about your suggestion and decide what to do. I'll look into gulp. I have no idea what it does. Thanks
  4. ajoo

    simple file copying

    Yes, I need to remove the commented out code as well as the comments ( probably less than the commented code) from the files and then use those on the live server. Thanks.
  5. ajoo

    simple file copying

    Hi Requinix, To begin with, I am using the GIT. The new files are generated during testing and debugging. I am using the linux to remove the comments from the files. The comments, besides the normal comments, can be a number of echos, exits, etc. scattered throughout my files across the project that i keep commenting on and off as needed. i want to remove all those and get my final files that I would use to set up on the VPS. Yes Maybe I can setup a git for these cleaned files as well and use that to install the project on the vps. Hence I need to find a way to copy and paste files from a maintained file. Thanks.
  6. ajoo

    simple file copying

    Hi requinix ! Hope you are doing good. hmm, you got most of it correct Well I have a a project in development whose copy i wish to create and remove all comments from it before uploading to the vps. The development site gets cluttered with so many additional files during development. The main files, added or deleted are only a few. So it becomes really cumbersome to separate the wheat from the chaff. I thought if I can have a list of files with path then i can simply maintain that list and use that to copy and paste from the dev to the other location. Thanks !
  7. ajoo

    simple file copying

    Hi all, I wish to copy files from source to destination but the source and destination information has to be read from a file. As an example, I wish to copy from 1. e:/dev/eb/fran/*.* to e:/prod/eb/fran/*.* 2. e:/dev/eb/inc/*.* to e:/prod/eb/inc/*.* and so on. More generally I would like a put the source and destination information in a file as below 1. e:/dev/eb/fran/A.html e:/prod/eb/new_fran/A.html 2. e:/dev/eb/inc/B.php to e:/prod/eb/new_inc/B.php and so on and then use it to copy the files. Thanks !
  8. Hi, I got this, so no worries. For the curious, I had the wrong network ip address. I was using the lan address while using wifi network. Thanks all !
  9. Hi, I am using vagrant to fire up my local server. My hosts file for firing the server using the mobile network is as below: and my corresponding Vagrantfile is :- With these settings I am able to access my website using chrome on windows. However if I change the settings for using the Office WIFI, i.e. comment out the lines for Mobile Wifi and un-comment those for the Office Wifi, I get the following error. I am sure that previously I have made the switch numerous times and it worked. I wonder why I am unable to switch networks !? I have cleared the DNS Cache as well as the chrome browsing data but that did not help either. Hoping that someone can shed some light on this. Thanks all !
  10. ajoo

    string checks

    hmm, So I can finally use isset($_POST["whatever"]) && is_string($_POST["whatever"]) && trim($_POST["whatever"]) != "" because, as you said, if it's a string, it won't be false or null. Thanks.
  11. ajoo

    string checks

    Hi ! @ gw1500se : While it's complicated I don't think it would require a regex since it's also basic. @requinix : Since this is an input received via ajax, someone can try and doctor the input to try and break the code. Hence I had the == false as well. And since a string won't be equal to false, I am thinking that it may be necessary to check that the input received is indeed a string. Wouldn't that be so ? Would you still go ahead with your code that you pasted above? Thanks !
  12. ajoo

    string checks

    Hi, The following seems to work but still allows for a non string 0. (isset($str) && $str !==false && $str !==''){ . . . } Maybe I need to check for an is_string as well. I was hoping to find something simpler if it exists. Thanks !
  13. Hi, I wish to check for a condition that a string received is not white space or false or null but it should allow the string '0'. This must be a very simple problem but it is definitely quite confusing. Thanks loads.
  14. Hi Guru Barand, Just saw this. Thanks for the insight into the handling of holidays and pointing out the flaw. Thank you so much, Truly grateful !
  15. Hi Guru Barand, Thanks loads for your help, Sir, so far, there is no further query that requires this data. It will be displayed on the home page of the tutor, so that he can see instantly the 'gap' ( the no of days elapsed between the current and last login) in logins of the students as well as 'absents', the totals number of days the student has been irregular in the program. He can then use this information to check this rate and minimize it or take suitable action. For this I am actually using a complete separate table. I am doing it wrong as.I am storing the latest values of login and other parameters like lastlogin date, scores, calculated absents etc for each student in table A by taking them off from another table B that stores the same information for each day since the child registers. Then I am using this table A with latest values to display the status, lastlogin date and scores and gaps and absents etc after due calculation in php on the tutor's home page. Creating table A from B is incorrect since its duplication of data. With this query, I will to remove table A completely and do the calculations on the fly of gaps and absents and scores ( which were on the fly in any case but I was storing them in table A) to display them on the tutor home page. Thanks loads !🙏
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.