Skip to content

Instantly share code, notes, and snippets.

View AbhishekGhosh's full-sized avatar
🔒
Happy

Abhishek Ghosh AbhishekGhosh

🔒
Happy
View GitHub Profile
@AbhishekGhosh
AbhishekGhosh / script.js
Created March 28, 2025 18:23
script.js
$(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 () {
@AbhishekGhosh
AbhishekGhosh / wp.sh
Last active March 23, 2025 19:43 — forked from chrisl8888/wp.sh
install wordpress with shell script
#!/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
@AbhishekGhosh
AbhishekGhosh / repo-list-show-delete.sh
Created February 26, 2025 17:45
Bash script Ubuntu repo
#!/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
@AbhishekGhosh
AbhishekGhosh / repo-list.sh
Created February 26, 2025 17:40
List Ubuntu Repo
#!/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/:"
@AbhishekGhosh
AbhishekGhosh / speed.sh
Created April 24, 2016 02:47
Server Speed Test CLI Bash script
#!/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"
@AbhishekGhosh
AbhishekGhosh / uptime.php
Created March 24, 2015 09:22
nginx status php
<?php
$serverUptime = getServerUptime();
$nginxUptime = getNGINXUptime();
$nginxStatus = getNGINXStatus($nginxUptime['totalSeconds']);
echo json_encode(
array(
"server_uptime"=>$serverUptime,
"nginx_uptime"=>$nginxUptime,
"nginx_status"=>$nginxStatus
)
@AbhishekGhosh
AbhishekGhosh / esp32.cc
Created December 2, 2019 16:23
Connect ESP32 Arduino With a Samsung Smart Watch
#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);
@AbhishekGhosh
AbhishekGhosh / water_level.ino
Created March 25, 2024 18:56
water_level.ino
#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;
@AbhishekGhosh
AbhishekGhosh / index.html
Created March 25, 2024 18:55
index.html
<!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({
@AbhishekGhosh
AbhishekGhosh / get_data.php
Created March 25, 2024 18:54
get_data.php
<?php
$servername = "localhost";
$username = "your_username";
$password = "your_password";
$dbname = "your_database";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection