Jump to content

ajoo

Members
  • Content Count

    831
  • Joined

  • Last visited

Posts posted by ajoo


  1. Thanks requinix, 

    image.png.80fefc2c872b257df1a1ffb1db4a94d7.png

    So while I got this working, strangely I still have   

    httpd -t -c httpd.conf give the following :-

    image.thumb.png.06d396687ccf6bea1675498470eaf701.png

    and the file at image.png.b45b1af272339e1f7904d4118f9993be.png

     is neither empty nor missing and is also the right format. Incidentally, this same certificate I used in my windows 10 that gave the lock.

    image.png.83c0d62f174530608b8bfe07c97fe868.png

    Also shouldn't a syntax error cause the server to not restart or reload? 

    Any suggestions how this can be further invetigated? Anything else that I look into ? My logs, all of them are set to warn and were totally clear. 

    Thanks loads ! 


  2. Hi !

    SO i got the certificate to my windows machine and installed it. The hosts file on the machine has an entry for my locally hosted website. And while I got the padlock I got a 404 error message. 

    image.png.2d4e5e532f7861db6ba168d035f6bec0.png

     

    I'ld like to mention that I am using vagrant to spin up 2  machines for me, a host and a server.  I then use the host to setup the server using ansible. Thus my server is twice removed from my windows machine. I then copied the keys as suggested by requinix from the server to my windows machine and got the result shown above. 

    I hope someone can suggest what issues could be causing this 404 error.

    Thanks !

     


  3. Hi Kicken, 

    Thanks for the reply. 

    I have a VM instance on my computer so that makes the VM to be another computer. The certificates and the key are on the VM hosting the site as that's how they are placed by default there when they are be installed. Possibly the certificate, which i believe holds the key, needs to be uploaded to the main machine from where I browse the site and installed there as well for selfsigned certificates though I don't know for sure and I don't know where. Possibly in the trusted certificates somewhere in the control panel and possibly in the browser too. 

    Maybe you can confirm or refute some of the points I make above. Thanks !    


  4. Quote

    IIRC you take the public key

    ūüėē¬†so which is the public key !? surely you woudn't be referring to the public key of the server ?? where and how to install it on the¬†computer ?

    Meanwhile I looked up another certificate issuer that professes to be there only for the localhost testing as of now, namely mkcert. It comes bundled with the trust authority and is easily installed. It is, except that the end result was still the same. Chrome did not accept and gave the same error as before. 

    Sorry if my questions are too noobish but this is totally new to me.

    Thanks ! 


  5. Hi requinix !!

    Thanks for the response ! I hope you are doing good. 

    I have already read up on what you mention but i it's confusing.

    I have already generated a selfsignied certficate. On my VM localhost I have the following so far:

    At /etc/pki/tls/certs/ : testnode.csr, testnode.pem, testnode.conf and testnode.combined.pem

    At /etc/pki/tls/private/testnode.key 

    Quote

    You can download and store the public key on your computer and tell it to trust that

    So do i need to download /etc/pki/tls/private/testnode.key from the VM onto my host computer ? On some of the questions answered on stack exchange, the mention a key like root_CA.key / root_CA.pem I don't know if that is the key you are talking about. I don't see that being generated on my computer.

    Quote

    Or you can create a certificate signing authority, trust that

    How can I do this ? Maybe a thread or an article / tutorial on this that you can point to. I'ld be happy. 

    I will try out the Letsencrypt bit later with an actual domain.

    Thanks loads and keep safe.¬†ūüôŹ

     

     


  6. The following is the error that In have been receiving. 

    Quote

    Your connection is not private

    Attackers might be trying to steal your information from testnode.dev (for example, passwords, messages, or credit cards). Learn more

    NET::ERR_CERT_AUTHORITY_INVALID

    Hopefully someone can suggest something.

    Thanks !


  7. Hi all !

    I have been trying to use selfsigned cerificate on my VM for testing. I have tried to do so by following the tutorial here and with utter failiure. No matter what I try, the selfsigned certificate simply won't change the URL bar to the safe green. I always end up with the "your connection is not private" message. The URL says not secure instead of the green padloc and the https is crossed out by 2 lines. it leaves me wondering if selfsigned certficates are not accepted by chrome or firefox any longer. Has anyone else suffered from a similar problem and can have some words of advice for me ! 

    Thanks loads !! 

      


  8. 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.

     

    Quote

    PLAY [test1] *************************************************************************************************************************

    TASK [Gathering Facts] ***************************************************************************************************************
    ok: [test1]

    TASK [Make sure we have a 'wheel' group] *********************************************************************************************
    ok: [test1]

    TASK [Allow 'wheel' group to have passwordless sudo] *********************************************************************************
    changed: [test1]

    TASK [Add sudoers users to wheel group] **********************************************************************************************
    changed: [test1]

    TASK [Set up authorized keys for the adminn user] ************************************************************************************
    fatal: [test1]: FAILED! => {"changed": false, "msg": "Either user must exist or you must provide full path to key file in check mode"}
            to retry, use: --limit @/vagrant/ansible2/playbook.retry

    PLAY RECAP ***************************************************************************************************************************
    test1                      : ok=4    changed=2    unreachable=0    failed=1
     

    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 !


  9. 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:

    Quote

    TASK [Gathering Facts] ***************************************************************************************************************
    fatal: [web01]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
            to retry, use: --limit @/vagrant/playbook.retry
     

        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 :

    Quote

    Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

     and again it does not ask for the password.

    Looking for any suggestion and stuff I can try. 

    Thanks all !

     

     

     


  10. 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 

     

     


  11. 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.


  12. 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. 


  13. 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 !

     


  14. 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 !

     

     


  15. 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:

    Quote

    # localhost name resolution is handled within DNS itself.
    #    127.0.0.1       localhost
    #    ::1             localhost
    #    0.0.0.1    mssplus.mcafee.com

    #    192.168.111.17    franchisee.com        # Using Office WIFI

        192.168.89.18    franchisee.com        # Using Mobile WIFI

     

    and my corresponding Vagrantfile is :-

    Quote

    # -*- mode: ruby -*-
    # vi: set ft=ruby :

    Vagrant.configure("2") do |config|
        config.vm.box = "syone/lamp"

       # config.vm.network "public_network", ip: "192.168.111.17"     # Using Office WIFI
        config.vm.network "public_network", ip: "192.168.89.18"    # Using Mobile WIFI      
            #Vagrant v2.0+

        .

        .

     

    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.

    Quote

    This site can’t be reached

    franchisee.com took too long to respond.

    Try:

    Checking the connection

    Checking the proxy and the firewall

    Running Windows Network Diagnostics

    ERR_CONNECTION_TIMED_OUT

    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 !

     


  16. 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.

     

     


  17. 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 ! 

     

     


  18. 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 !


  19. 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.


  20. 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 !ūüôŹ

     

     

     

     

     

     

     

     


  21. Hi Guru Barand, 

    I modified your code just a trifle to get the table in the inverse order, and that makes it more accurate as a row has a complete information now for the query that I wish to execute. 

    Here's the code modified just so as also some var names,

    SELECT recno
    , timeoflogout
    , gaps
    , @tot := @tot + IFNULL(gaps,0) as absents
    FROM (
    SELECT recno
     , DATEDIFF(timeoflogout, @prevlog ) - 1 as gaps
     , @prevlog := timeoflogout as timeoflogout
    FROM (
       SELECT recno
    		, timeoflogout
       FROM ajoo 
       ORDER BY timeoflogout ASC
     ) as sorted
     JOIN (SELECT @prevlog := NULL, @tot := 0) as initialise
    )recs;

    which gives the output as

    Quote

    +-------+-----------------------------+--------+-----------+
    | recno | timeoflogout               | gaps | absents |
    +-------+-----------------------------+--------+-----------+
    |     4   | 2019-09-30 13:13:15 | NULL |       0     |
    |    21  | 2019-10-02 07:47:35 |    1     |       1     |
    |    23  | 2019-10-03 13:28:17 |    0     |       1     |
    |    24  | 2019-10-04 21:41:17 |    0     |       1     |
    |    25  | 2019-10-05 11:18:18 |    0     |       1     |
    |    26  | 2019-10-15 16:56:55 |    9     |      10    |
    |    27  | 2019-10-18 16:37:43 |    2     |      12    |
    |    28  | 2019-10-19 12:31:23 |    0     |      12    |
    |    29  | 2019-10-21 15:23:54 |    1     |      13    |
    |    30  | 2019-10-24 17:37:35 |    2     |      15    |

    The row that I now wish to examine is the last row of the table. It seems quite tricky to me to retrieve this value as if I invert the order to pick the first row, the calculated field remains at the last, unchanged, and If i use the recno reference at the end of the query (WHERE recno = 30), the calculated field becomes 0. 

    So How do I retrieve the last row values from the above table, if possible, without creating a temporary table and then querying it?

    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.