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 / 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
@AbhishekGhosh
AbhishekGhosh / login.sh
Created August 27, 2022 19:42
Bash Script for SSH Login
#!/usr/bin/expect
set USER [lindex $argv 0]
set HOST [lindex $argv 1]
set PWD [lindex $argv 2]
log_file /var/log/ssh_tmp.log
set timeout 30
log_user 1
set send_slow {1 .01}
send_log "Connecting to $HOST using $USER user\n"
@AbhishekGhosh
AbhishekGhosh / code.php
Last active September 29, 2021 18:41
Ad Invalid Click Protector code
// Install https://wordpress.org/plugins/ad-invalid-click-protector/
<?php
if( aicp_can_see_ads() ) {
// This part will show ads to your non-banned visitors
$adCode = '<div class="aicp">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- responsive_box -->
<ins class="adsbygoogle right-floating-ad"
@AbhishekGhosh
AbhishekGhosh / doorbell.ino
Created March 23, 2021 15:53
Smart doorbell
// connects once upon pressing ESP32 boot pushbutton (GPIO 0) button and sends a message, closes connection
// written by Dr. Abhishek Ghosh, https://thecustomizewindows.com
// released under GNU GPL 3.0
const byte BUTTON=18; // boot button pin (built-in on ESP32)
const byte LED=2; // onboard LED (built-in on ESP32)
#include <WiFi.h>