chriltola / chatgroup

0 stars 0 forks source link

Tt #2

Open chriltola opened 1 year ago

chriltola commented 1 year ago

Unfortunately, as an AI language model, I do not have access to the current date and time, so I cannot provide an accurate solution to your request. However, I can provide you with a general batch script that you can modify to fit your specific needs.

@echo off set /p start_date="Enter start date (YYYY-MM-DD): " set /p end_date="Enter end date (YYYY-MM-DD): "

for /d %%f in (*) do ( set folder_date=%%~tf set folder_date=!folder_date:~0,10! if !folder_date! geq %start_date% if !folder_date! leq %end_date% echo %%f )

This script prompts the user to enter a start date and an end date in the format of "YYYY-MM-DD". It then loops through all directories in the current directory and checks if their creation date falls within the specified range. If a directory's creation date falls within the range, its name is printed to the console.

chriltola commented 1 year ago

Certainly, here is a batch script that finds folders created after a specific date:

@echo off set /p compare_date="Enter date to compare (YYYY-MM-DD): "

for /d %%f in (*) do ( set folder_date=%%~tf set folder_date=!folder_date:~0,10! if !folder_date! geq %compare_date% echo %%f )

This script prompts the user to enter a date to compare in the format of "YYYY-MM-DD". It then loops through all directories in the current directory and checks if their creation date is greater than or equal to the specified date. If a directory's creation date is greater than or equal to the specified date, its name is printed to the console.

chriltola commented 1 year ago

Certainly, here is a batch script that finds folders created after a specific date and exports the results to a text file:

@echo off set /p compare_date="Enter date to compare (YYYY-MM-DD): "

set output_file=output.txt

echo Folders created after %compare_date% > %output_file% echo. >> %output_file%

for /d %%f in (*) do ( set folder_date=%%~tf set folder_date=!folder_date:~0,10! if !folder_date! geq %compare_date% echo %%f >> %output_file% )

echo Results exported to %output_file%.

chriltola commented 1 year ago

@echo off set /p compare_date="Enter date to compare (YYYY-MM-DD): "

set output_file=output.txt

echo Folders created after %compare_date% > %output_file% echo. >> %output_file%

for /d %%f in (*) do ( set folder_date=%%~tf set folder_date=!folder_date:~0,10! if !folder_date! geq %compare_date% echo %%f >> %output_file% )

echo Results exported to %output_file%.

chriltola commented 1 year ago

i have a batch script that echo only creation date of file. i want to add time of creation file too. please edit this batch script.

@ECHO OFF SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=1,* delims= " %%A IN ('DIR /T:C /A:-D C:\Users\PVisal\Desktop\bat ^|FIND "/"') DO ( SET Cdate=%%A SET Fname=%%B SET Fname=!Fname:~24! ECHO !FnamE!@!CDate! )

pause

chriltola commented 1 year ago

Sure, here's a sample batch script that can convert the date format from dd/mm/yyyy to yyyy-mm-dd:

@echo off setlocal EnableDelayedExpansion

set "date_str=15/03/2022" REM Example date in dd/mm/yyyy format

REM Extract day, month, and year from the input date string for /f "tokens=1-3 delims=/" %%a in ("%date_str%") do ( set "day=%%a" set "month=%%b" set "year=%%c" )

REM Pad day and month with leading zeros if necessary if !day! lss 10 set "day=0!day!" if !month! lss 10 set "month=0!month!"

REM Build the output date string in yyyy-mm-dd format set "new_date_str=!year!-!month!-!day!"

echo %new_date_str% REM Output: 2022-03-15

You can replace the date_str variable with your own input date string. The output date string will be stored in the new_date_str variable. You can modify this script to suit your specific needs.

chriltola commented 1 year ago

Here's an example batch script that compares two dates formatted as dd/mm/yyyy:

@echo off

setlocal EnableDelayedExpansion

set "date1=01/01/2022" set "date2=02/01/2022"

for /f "tokens=1,2,3 delims=/" %%a in ("%date1%") do ( set "day1=%%a" set "month1=%%b" set "year1=%%c" )

for /f "tokens=1,2,3 delims=/" %%a in ("%date2%") do ( set "day2=%%a" set "month2=%%b" set "year2=%%c" )

if %year1% lss %year2% ( echo %date1% is earlier than %date2% ) else if %year1% gtr %year2% ( echo %date1% is later than %date2% ) else ( if %month1% lss %month2% ( echo %date1% is earlier than %date2% ) else if %month1% gtr %month2% ( echo %date1% is later than %date2% ) else ( if %day1% lss %day2% ( echo %date1% is earlier than %date2% ) else if %day1% gtr %day2% ( echo %date1% is later than %date2% ) else ( echo %date1% is the same as %date2% ) ) )

In this example, the dates are hardcoded as variables date1 and date2. You can replace these with your own variables or modify the script to prompt the user for input.

The script first uses a for loop to extract the day, month, and year from each date string and store them in separate variables (day1, month1, year1, day2, month2, year2).

It then uses a series of if statements to compare the years, months, and days of the two dates. If the first date is earlier than the second date, it prints a message saying so. If the first date is later than the second date, it prints a different message. If the two dates are the same, it prints a third message.

chriltola commented 1 year ago

The old upadated status of OneSpan Authentication Server :

I want to upadate new status of this project: now we are in step of preparing implementation. Pentest was signed off since 18/5/2023. we have an issue which cannot remote from Jump-01 server to other server with local user. action require is need to disable NLA on server that we remote to. However, we will implement this project by 30/6/2023.

chriltola commented 1 year ago

The OneSpan Authentication Server project is now in the implementation phase. The pentest was signed off on 18/5/2023. There is an issue with remote access from Jump-01 server to other servers using local user accounts, which requires disabling NLA on the servers being accessed. The project is expected to be fully implemented by 30/6/2023.

chriltola commented 1 year ago

i have a php code to download data from table list. currently, it download all record from database but i only want to download from current list in table.

if (isset($_POST['Export'])) { // Database connection settings $host = "localhost"; $username = "root"; $password = "Password1"; $dbname = "test";

// Connect to database $conn = mysqli_connect($host, $username, $password, $dbname);

// Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } // SQL query to retrieve data from database $sql = "SELECT * FROM atm";

// Execute query and get result $result = mysqli_query($conn, $sql);

$date = date('Y-m-d',strtotime('-1 day')); $formatted_date = $date;

// Create CSV file and write header row $filename = $date."csv"; $header_row = array("Terminal ID", "Date", "Time", "CardInser-PinEnter", "Application Select", "Notes Dispense", "Crypto Process", "CardInsert-NoteTaken", "Note_Present($100,$50,20000,10000)"); $file = fopen($filename, "w"); fputcsv($file, $header_row);

// Loop through data and write rows to CSV file while ($row = mysqli_fetch_assoc($result)) { $data_row = array($row['Name'], $row['Date'], $row['Time'], $row['Card_PIN'], $row['AppSelect'], $row['NoteDi'], $row['Crypto'], $row['Card_Note'], $row['Note_Present']); fputcsv($file, $data_row); }

// Close file and database connection fclose($file); mysqli_close($conn);

// Download CSV file header('Content-Type: application/csv'); header('Content-Disposition: attachment; filename="my_csv_file.csv";'); readfile($filename);

// Delete CSV file from server unlink($filename);

}

chriltola commented 1 year ago

To save a value to a text file in PHP, you can use the fwrite() function to open the file and write the value to it.

Here's an example:

<?php // Open the file in write mode $file = fopen("data.txt","w");

// Write the value to the file $value = "Hello World!"; fwrite($file,$value);

// Close the file fclose($file); ?>

In the code above, we're using fopen() function to open a file named data.txt in write mode. We're then using fwrite() function to write the value "Hello World!" to the file. Finally, we're using fclose() function to close the file.

After running the code, you should see a new file called data.txt in the same directory as your PHP script.

chriltola commented 1 year ago

To save a value to a text file in PHP, you can use the fwrite() function to open the file and write the value to it.

Here's an example:

// Open the file in write mode $file = fopen("data.txt","w");

// Write the value to the file $value = "Hello World!"; fwrite($file,$value);

// Close the file fclose($file); ?>

In the code above, we're using fopen() function to open a file named data.txt in write mode. We're then using fwrite() function to write the value "Hello World!" to the file. Finally, we're using fclose() function to close the file.

After running the code, you should see a new file called data.txt in the same directory as your PHP script.

chriltola commented 1 year ago

To read the content of a text file in PHP, you can use the file_get_contents() function, which reads the entire content of a file into a string.

Here's an example of how to read the content of a file and use it as a value in PHP:

// Read the content of the file $content = file_get_contents("data.txt");

// Print the content echo $content; ?>

In the code above, file_get_contents() function is used to read all the content of the file named data.txt into a string variable called $content. Then we echo $content to display the content of the file.

You can also use fopen() and fread() functions to read the content of a text file in PHP. Here's an example:

// Open the file in read mode $file = fopen("data.txt", "r");

// Read the content of the file $content = fread($file, filesize("data.txt"));

// Close the file fclose($file);

// Print the content echo $content; ?>

In the code above, fopen() function is used to open the file data.txt in read mode and fread() function is used to read the entire content of the file into a string. Then we close the file using fclose() function. Finally, we echo $content to display the content of the file.

chriltola commented 1 year ago

write a project update status: The Pentest was signed off on 18/5/23. However, there is an issue with remote access from Jump server to other servers using local user accounts. Campu ITD has raise this issue to Vendar for escalate on 19/5/23. Campu ITD and Vendar have worked together until issue was fixed on 5/6/23 with solution disabling NLA on the servers being accessed. However, the project is expected to be fully implemented by 5/7/23.

chriltola commented 1 year ago

Project Update Status:

The Pentest was successfully signed off on 18/5/23. However, an issue with remote access from Jump server to other servers using local user accounts was identified by Campus ITD. The issue was escalated to Vendar on 19/5/23 and both teams worked together to find a solution. The issue was resolved on 5/6/23 by disabling NLA on the servers being accessed.

The project is now expected to be fully implemented by 5/7/23. We appreciate the collaboration between Campus ITD and Vendar in resolving the remote access issue. We will continue to provide updates on the project's progress as it moves towards completion.