Skip to content

Instantly share code, notes, and snippets.

View RustyNails8's full-sized avatar

Sumit Das RustyNails8

View GitHub Profile
@RustyNails8
RustyNails8 / SendMailPowerShell.ps1
Created February 19, 2019 02:02
Send Mail Powershell
<# Encrypted AES Key and Password as Secure String are stored on \\myUNCpath #>
$encryptedSecureKey = Get-Content \\myUNCpath\smtpKEY.txt
$encryptedSecureString = Get-Content \\myUNCpath\smtprelay.txt
$secureKey = ConvertTo-SecureString -String $encryptedSecureKey
$secureString = ConvertTo-SecureString -String $encryptedSecureString -SecureKey $secureKey
$cred = New-Object System.Management.Automation.PSCredential('Domain\User', $secureString)
@RustyNails8
RustyNails8 / SendMailGoLang.go
Created February 19, 2019 02:04
Send Mail with Go
package main
import (
"log"
"net/smtp"
)
var (
from = "[email protected]"
msg = []byte("TEST VM STOP")
@RustyNails8
RustyNails8 / bash-smtp-auth-email
Created June 9, 2019 07:56 — forked from fbatschi/bash-smtp-auth-email
How to send an email from bash via SMTP Auth
echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <[email protected]>" [email protected]
@RustyNails8
RustyNails8 / WebTableScraper.py
Created November 22, 2020 18:22
Scrape tables from any website
import pandas as pd
url = r'https://en.wikipedia.org/wiki/List_of_S%26P_500_companies'
tables = pd.read_html(url) # Returns list of all tables on page
print(tables)
sp500_table = tables[0] # Select table of interest
print(sp500_table)
# https://stackoverflow.com/questions/6325216/parse-html-table-to-python-list
@RustyNails8
RustyNails8 / Git-graph-alias
Last active December 13, 2020 11:09
Alias for git graph command line
```
[alias]
lg = lg1
lg1 = lg1-specific --all
lg2 = lg2-specific --all
lg3 = lg3-specific --all
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'

RED for Pending/Backlog/Not Started #f03c15

YELLOW for In Progress/Started/Testing #ffff00

GREEN for Completed/Done #c5f015

@RustyNails8
RustyNails8 / README-Badge.md
Created October 16, 2022 06:19
Badges in README

README.md

Closed in Dev Developers

README.md

Open in Dev Developers

#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@RustyNails8
RustyNails8 / .bashrc
Created January 3, 2023 06:14
GitHub Codespaces bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@RustyNails8
RustyNails8 / countdown.ps1
Created February 10, 2023 05:21
Countdown in powershell
for ($seconds=10; $seconds -gt -1; $seconds--) {
Write-Host -NoNewLine ("`rseconds remaining: " + ("{0:d4}" -f $seconds))
Start-Sleep -Seconds 1
}