Skip to content

Instantly share code, notes, and snippets.

View sumeetweb's full-sized avatar
🌞
Exploring

Sumeet Naik sumeetweb

🌞
Exploring
View GitHub Profile
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active July 5, 2024 22:15
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@rameerez
rameerez / mail.example.com.conf
Last active June 26, 2024 08:24
Nginx configuration for Listmonk running on Docker port 9000 using SSL certificates provided by Bitnami on AWS Lightsail
# This file goes in /opt/bitnami/nginx/conf/server_blocks as mail.example.com.conf (make sure to replace the filename with your actual subdomain)
# This Nginx config file assumes we're runing a Bitnami image (thus the non-standard /opt/bitnami paths)
# FULL TUTORIAL to set up Listmonk on AWS Lightsail here: https://rameerez.com/free-mailchimp-alternative-email-marketing-service#listmonk-tutorial
server {
listen 443 ssl;
server_name mail.example.com;
server_tokens off;
ssl_certificate /opt/bitnami/letsencrypt/certificates/mail.example.com.crt;
@arvidkahl
arvidkahl / README.md
Last active July 3, 2021 11:46
Twitter Giveaway bash+js script

This is a script picking winners for a contest where:

  • every winning entry has to mention one other twitter account in a reply
  • double winners are allowed

You'll need a few things installed:

  • jq
  • twarc
  • boxes
@twratl
twratl / AWS SES Email Parser in Lambda
Last active November 14, 2023 14:54
Sample Python Lambda code for parsing emails delivered to S3 buckets via SES and then Lambda invocation from SES - untested
# content provided as part of thread here: https://www.reddit.com/r/aws/comments/cffmxr/how_do_you_strip_the_attachments_from_aws_sessns/
from email.parser import BytesParser
from email import policy
import os
# event will be JSON from SES incoming email rule - NOT an S3 PUT event
def lambda_handler(event, context):
try:
ses_mail = event['Records'][0]['ses']['mail']
@levelsio
levelsio / makebook_obfuscate.php
Last active April 20, 2024 01:51
Obfuscate your ebook so that people who didn't pay can read it, partly
<?php
/*
I wrote this function to progressively obfuscate text in MAKEbook.io. When it KINDA worked, I just used it.
It can take a lot of improvement. I kinda just tweaked the values until it was good enough. It's not SO progressive though.
It takes all the output of your PHP scripts via ob_start(), reroutes that to the obfuscation function.
You should check if user paid for book or not, then either run ob_start or not!
@saleemkce
saleemkce / download_file.php
Created January 24, 2014 18:30
PHP File Download Script - Download large file in chunks.
<?php
/*ini settings*/
set_time_limit(0);
ini_set('memory_limit', '512M');
//DOWNLOAD SCRIPT
$filePath = "G:/Software/versions/..PATH TO DOWNLOAD FILE...zip"; // set your download file path here.
download($filePath); // calls download function
function download($filePath)
{
@irazasyed
irazasyed / downloadFileChunks.php
Last active May 3, 2024 09:57
PHP: File downloader function - Downloading files in chunks.
<?php
/**
* Download helper to download files in chunks and save it.
*
* @author Syed I.R <syed@lukonet.com>
* @link https://github.com/irazasyed
*
* @param string $srcName Source Path/URL to the file you want to download
* @param string $dstName Destination Path to save your file
* @param integer $chunkSize (Optional) How many bytes to download per chunk (In MB). Defaults to 1 MB.