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 / insert_data.php
Created June 4, 2023 17:24
Insert data in MySQL tables
<?php
$servername = "localhost";
$username = "non-root";
$password = "non-root-password";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error){
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO LED_status (id, status)
@AbhishekGhosh
AbhishekGhosh / create-table.php
Created June 4, 2023 17:16
Create MySQL Table With PHP
<?php
$servername = "localhost";
$username = "non-root";
$password = "non-root-password";
$dbname = "ESP32IoT";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
@AbhishekGhosh
AbhishekGhosh / create-database.php
Last active June 4, 2023 16:43
Create MySQL Database With PHP
<?php
$servername = "localhost";
$username = "non-root";
$password = "non-root-password";
$conn = new mysqli($servername, $username, $password);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
@AbhishekGhosh
AbhishekGhosh / msmtprc
Created May 29, 2023 17:16
msmtprc settings
# common settings
defaults
port 587
auth on
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp/msmtp.log
# outlook smtp settings
@AbhishekGhosh
AbhishekGhosh / mail.php
Created May 29, 2023 16:56
PHP mail testing script
<?php
$to = "recipient@gmail.com";
$from = "sender@hotmail.com";
$subj = "sending email using php mail() function";
$body = "This email is sent using php mail() function. This proves that your msmtp service is correctly configured with php.";
mail($to, $subj, $body);
?>
@AbhishekGhosh
AbhishekGhosh / badge.css
Created May 24, 2023 05:45
WordPress Genesis verified badge CSS
.entry-author-name:after {
content: '\f058';
font-family: FontAwesome;
font-size: 15px;
margin-left:5px;
margin-right:5px;
color:#0274be;}
@AbhishekGhosh
AbhishekGhosh / string.html
Created April 27, 2023 15:45
post-Persistence of vision in DIY Electronics
var binaryStr = "111111111111111111111111000011111111111111111111";
@AbhishekGhosh
AbhishekGhosh / thecuspersistence-of-vision-in-diy-electronics.html
Created April 27, 2023 15:43
persistence-of-vision-in-diy-electronics
B111111111111111111111111000011111111111111111111
<?php phpinfo(); ?>
@AbhishekGhosh
AbhishekGhosh / mariadb.cnf
Created April 13, 2023 18:57
MariaDB 16GB Dedicated Server
# The MariaDB configuration file
# File location /etc/mysql/mariadb.cnf
# Tweak suggested by Abhishek Ghosh, thecustomizewindows.com
# for 16GB dedicated server running Apache2, PHP for WordPress single site
# Test with Major Hayden's MySQL Tuner
# https://github.com/major/MySQLTuner-perl
#
[mysqld_safe]
nice = -15