Skip to content

Instantly share code, notes, and snippets.

View mavaddat's full-sized avatar
🏠
Working from home

Mavaddat Javid mavaddat

🏠
Working from home
View GitHub Profile
@mavaddat
mavaddat / Backup_cpanel.sh
Created September 29, 2017 06:05 — forked from osrecio/Backup_cpanel.sh
Get Backup Cpanel ( Files & DB's )
#!/bin/bash
LOG="/path_to_save_logs"
echo "Start backup web `date`" >> $LOG
cd /folder_to_save
FECHAF=`date +%Y.%m.%d`
mkdir $FECHAF
cd $FECHAF
FECHA=`date +%-m-%-d-%Y`
@mavaddat
mavaddat / download-latest-release.ps1
Last active June 26, 2019 17:08 — forked from MarkTiedemann/download-latest-release.ps1
Download latest dotnet/codeformatter from GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
@mavaddat
mavaddat / .gitignore
Created July 12, 2019 19:28 — forked from VonC/.gitignore
Simple download and installation script, which can be called from the cloud
/senv.sublime-*
/WindowTabsSettings.txt
####### License: MIT
"""MIT License
Copyright (c) 2020 Mavaddat Javid and Aaron Hall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@mavaddat
mavaddat / svg_to_png.js
Last active October 26, 2021 03:34 — forked from rafaelsq/svg_to_png.js
SVG to Base64 PNG
function svgToPng(svg, callback) {
var svgContent = null;
//check if svg is a path string
if (typeof svg === 'string') {
//get svg element
var client = new XMLHttpRequest();
client.open('GET', svg);
client.onreadystatechange = function() {
svgContent = client.responseText;
@mavaddat
mavaddat / PSObjectComparer.cs
Last active November 28, 2021 01:39 — forked from josheinstein/PSObjectComparer.cs
IComparer for PSObjects in PowerShell
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Linq;
using System.Management.Automation;
using System.Threading;
@mavaddat
mavaddat / google-passwords-delete.js
Last active May 4, 2022 04:36 — forked from captchadex/google-passwords-delete.js
Google Chrome password deleter
// Run this in chrome://settings/passwords
// Works as of Chrome Version 102.0.5005.27
// check if we are at chrome://settings/passwords
if (document.location.href.indexOf("chrome://settings/passwords") == -1) {
console.info("Navigating to chrome://settings/passwords");
document.location.href = "chrome://settings/passwords";
}
const delay = 333;
setInterval(() => {
@mavaddat
mavaddat / .bashrc
Last active January 22, 2022 03:10 — forked from glsorre/keychain.ps1
Windows git and Windows Subsystem for Linux will never prompt ssh passphrase again
# To avoid having to re-type the password for SSH
test -f /usr/bin/keychain && eval $(/usr/bin/keychain --eval --quiet id_rsa)
@mavaddat
mavaddat / powershell_github_auth.ps1
Last active January 19, 2022 21:23 — forked from majorsilence/powershell_github_basic_auth.ps1
Powershell - Github Api - List Pull Requests - Basic Authentication
# See https://developer.github.com/v3/pulls/#list-pull-requests
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
# If using token...
$ghcred = Get-Credential -Message "Please provide your username and GitHub token" -Title "Github Personal Access Token"
$headers = @{"Authorization"="token $($ghcred.Password | ConvertFrom-SecureString -AsPlainText)"}
# Else if using basic
@mavaddat
mavaddat / 1b8b0ca5e8737235dccd.md
Last active January 24, 2022 19:39 — forked from yano3nora/docker_mail_servers.md
[docker: Mail server container] Mail servers by Docker. #docker

About Mail Hog

It is a kind of simple SMTP server and can be used for mail test during development. Because the container is also published on Docker Hub It's also very easy to deploy.

This time, we will just add an SMTP server to the existing docker project. If you want to check the behavior with docker run, please check the document of the distributor.

Installation method