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 / 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
@margani
margani / install-chocolatey.ps1
Last active May 31, 2024 20:52
Essential chocolatey packages #windows #choco #install #apps
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
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
@margani
margani / customized-angular-app-generation.txt
Last active September 11, 2017 11:07
Creating new angular app with customized flags
ng new general-app --verbose --skip-tests --directory app --style less --routing
@margani
margani / JsonSerializationProgram.cs
Created February 10, 2017 09:51
This code demonstrates 4 methods of json serialization and deserialization
class JsonSerializationProgram
{
static void Main(string[] args)
{
var person = new Person
{
firstName = "John",
lastName = "Doe",
dateOfBirth = new MyDate
{