Skip to content

Instantly share code, notes, and snippets.

View margani's full-sized avatar
🌍
Happy!

Hossein Margani margani

🌍
Happy!
View GitHub Profile
@margani
margani / index.html
Created March 25, 2020 10:21
Page with JavaScript refresh timer
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Down For Maintenance</title>
<style>
body { background: #fff; font-family: Helvetica,Arial,sans-serif; margin: 0; padding: 0; }
img { border: 0; }
.wrapper { width: 500px; margin: 0 auto; }
@margani
margani / w3wp-app-pools.cmd
Created January 8, 2020 09:35
Which w3wp.exe PID corresponds to which application pool ?
# https://docs.microsoft.com/en-us/archive/blogs/friis/which-w3wp-exe-pid-corresponds-to-which-application-pool
C:\Windows\System32\inetsrv\appcmd list wp
$env:HOME=$env:HOMESHARE
if ((Test-Path $env:HOME) -and (!($env:HOME.contains(':')))){
$DriveLetter = $env:HOMEDRIVE.replace(':','')
New-PSDrive -Name $DriveLetter -PSProvider FileSystem -Root $($env:HOMESHARE) | out-null
}
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
@margani
margani / colored.sh
Last active November 20, 2019 13:05
Show colored bash echo
White='\033[1;37m'
Black='\033[0;30m'
DarkGray='\033[1;30m'
Red='\033[0;31m'
Green='\033[0;32m'
Blue='\033[0;34m'
Purple='\033[0;35m'
Cyan='\033[0;36m'
Yellow='\033[1;33m'
Orange='\033[0;33m'
@margani
margani / docker-registry-compose.yml
Last active November 21, 2019 10:17
Prepare Ubuntu, installs these development tools: Git, Docker, Docker Compose, NodeJS, build-essential, .NET Core, My dotfiles and upgrades Ubuntu to the latest updates.
# docker-compose --file docker-registry-compose.yml --log-level DEBUG up --detach --build
registry:
restart: always
image: registry:2
ports:
- 8150:5000
volumes:
- /home/docker/:/var/lib/registry
@margani
margani / Change windows task bar button width.txt
Created October 23, 2019 13:58
Change windows task bar button width
Goto Computer\HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics in RegEdit
Set/Create MinWidth as a String value and set it to 200 (Minimum value: 38, Maximum Value: 500)
@margani
margani / list-users.ps1
Last active October 9, 2019 09:25
List all local users
# 1
Get-WmiObject -Class Win32_UserAccount
# Sample result:
#2
Get-LocalGroupMember -name users
# Sample result:
#3
Get-LocalUser
@margani
margani / youtube-dl-commands.bat
Created October 3, 2019 08:51
Download videos using youtube-dl
# Download youtube playlist
youtube-dl -o "d:/download/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -f "best[width>=1080][ext=mp4]" https://www.youtube.com/playlist?list=PL-something
publi class Project
{
public void DoScrum()
{
Developers.ForEach(dev =>
{
if(dev.IsMe)
{
Talking.Start(() => {
if(NothingFurtherToSay
@margani
margani / EnableRemoteDesktopWindows.bat
Last active December 6, 2021 05:23
Enable or Disable Remote Desktop in Windows Firewall from Command Prompt #windows #rdp
# Windows Server 2008+ or Windows Vista+
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes