This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function () { | |
| // Switch between login methods | |
| $("#tab-password").click(function () { | |
| $("#password-login-form").show(); | |
| $("#otp-login-form").hide(); | |
| $(".tab").removeClass("active"); | |
| $(this).addClass("active"); | |
| }); | |
| $("#tab-otp").click(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo “Database Name: ” | |
| read -e dbname | |
| echo “Database User: ” | |
| read -e dbuser | |
| echo “Database Password: ” | |
| read -s dbpass | |
| echo “run install? (y/n)” | |
| read -e run | |
| if [ "$run" == n ] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Function to list repositories | |
| list_repos() { | |
| echo "\nAvailable repositories:" | |
| local i=1 | |
| repos=() | |
| # List repositories from sources.list | |
| while IFS= read -r line; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # List repositories from sources.list | |
| echo "Repositories in /etc/apt/sources.list:" | |
| cat /etc/apt/sources.list | grep -E '^[^#]' | |
| echo "" | |
| # List repositories from sources.list.d directory | |
| echo "Repositories in /etc/apt/sources.list.d/:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo ) | |
| cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) | |
| freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo ) | |
| tram=$( free -m | awk 'NR==2 {print $2}' ) | |
| swap=$( free -m | awk 'NR==4 {print $2}' ) | |
| up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }') | |
| echo "CPU model : $cname" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $serverUptime = getServerUptime(); | |
| $nginxUptime = getNGINXUptime(); | |
| $nginxStatus = getNGINXStatus($nginxUptime['totalSeconds']); | |
| echo json_encode( | |
| array( | |
| "server_uptime"=>$serverUptime, | |
| "nginx_uptime"=>$nginxUptime, | |
| "nginx_status"=>$nginxStatus | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <WiFi.h> | |
| #include <WebServer.h> | |
| /* Put your SSID & Password */ | |
| const char* ssid = "ESP32"; // Enter SSID here | |
| const char* password = "12345678"; //Enter Password here | |
| /* Put IP Address details */ | |
| IPAddress local_ip(192,168,1,1); | |
| IPAddress gateway(192,168,1,1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| #include <VL53L0X.h> | |
| #include <WiFi.h> | |
| #include <HTTPClient.h> | |
| const char* ssid = "YourWiFiSSID"; | |
| const char* password = "YourWiFiPassword"; | |
| const char* serverAddress = "http://yourserver.com/store_data.php"; | |
| VL53L0X sensor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Water Tank Level Monitoring</title> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | |
| <script> | |
| $(document).ready(function(){ | |
| // Function to fetch water level data | |
| function fetchWaterLevel() { | |
| $.ajax({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $servername = "localhost"; | |
| $username = "your_username"; | |
| $password = "your_password"; | |
| $dbname = "your_database"; | |
| // Create connection | |
| $conn = new mysqli($servername, $username, $password, $dbname); | |
| // Check connection |
NewerOlder