Jump to content

ajoo

Members
  • Posts

    871
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ajoo

  1. 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 !
  2. 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
  3. 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.
  4. 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.
  5. 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 !
  6. 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 !
  7. 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 !
  8. 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 !
  9. 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.
  10. 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 !
  11. 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 !
  12. 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.
  13. 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 !
  14. 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 !🙏
  15. 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 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 !
  16. Any way that we can count and get the total absents in the query itself. I tried as below SELECT recno , DATEDIFF(@prevlog, TimeOfLogout) - 1 as absents , @prevlog := TimeOfLogout as TimeOfLogout , @tot := @tot+ absents as total FROM ( SELECT recno , TimeOfLogout FROM india_sessdata WHERE StudentLogin = 'nina12345' ORDER BY TimeOfLogout DESC ) as sorted, (SELECT @tot:=0) t JOIN (SELECT @prevlog:=NULL) as initialise; but it gives this error below 😒 Thanks
  17. Thank you Guru Barand ! It will take me some more time to decode your code but it works great !! Thanks loads !
  18. Hi Psycho, The absents is not part of the table. It was there to show what I wanted as output. So all absents have to be calculated on the fly and then summed to get to the figure of 15 absents on date 30th. Some kind of iterative loop is needed I guess. Thanks.
  19. hi all ! I have the following set of data The first 2 columns are the data, the 3rd column, absent, is what I wish to calculate at each level of entry and finally then sum of all the absents till that particular entry. So here for example on RecNo 30, the total of all absents so far is 15. I wish to do this using mysql alone. Any help appreciated. Thanks !
  20. Hi all ! I managed to find the solution. For anyone interested, the following code / command manages it. $graph->setupYAxis(n,'color'); where n is an integer. Thanks !
  21. Hi all ! I am using the phpgraphlib library for charting. I am using a bar-graph. (example 3 on https://github.com/elliottb/phpgraphlib/commit/d5096c8cbb38d75452f4d7036b7a64979b5e19db). I am displaying the dates on the x-axis. However the dates only show the month and date but the year is cutoff. Is there some way to get the x-axis to move up to accommodate the complete date along the x-axis? Thank you.
  22. Hi Benanamen, Can it be installed along with xampp on the same machine or would it conflict. Thanks.
  23. Hi, This is a probably a wrong way of inserting new email into the DB and can result in race conditions. You should be inserting the new email directly into the DB and your column for ermail ids should be unique so that it throws an exception for duplicate entries.
  24. Hi, Kindly ignore the question. I think the sql is incorrect. Thanks.
×
×
  • 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.