Skip to content

Instantly share code, notes, and snippets.

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

mdimai666 mdimai666

🏠
Working from home
View GitHub Profile
@mdimai666
mdimai666 / vs2022_run_wt.md
Last active May 17, 2024 21:44
Run windows terminal as External tool in Visual Stidio 2022

Extental Tools edit windows

[Menu -> Tools -> External Tools...]

Title = wt

Command = cmd.exe

Arguments = /c start wt -w $(SolutionFileName) --title "$(ProjectFileName)" -d "$(ProjectDir)"

Initial Directory = $(ProjectDir)

@mdimai666
mdimai666 / pwsh_prompt.ps1
Created April 20, 2024 03:15
PowerShell prompt
function prompt
>> {
>> Write-Host ("PS " + $(get-date) +">") -nonewline -foregroundcolor White
>> return " "
>> }
//index.razor
@page "/"
@using HtmlAgilityPack
@using Microsoft.AspNetCore.Components.RenderTree
@using Microsoft.AspNetCore.Components.Rendering
@using System.Text.RegularExpressions
@using System.Reflection
@*<SurveyPrompt Title="How is Blazor working for you?" />*@
@mdimai666
mdimai666 / Deploy.prod.ps1
Created September 8, 2021 00:47
dotnet net5 ssh deploy script
#prerequire config ssh public key
$dateStamp = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$host_destination = "~/web/WebApp/bin/Release/net5.0"
$host_name = "hostname.com"
$Host.PrivateData.ErrorBackgroundColor = "Red"
$Host.PrivateData.ErrorForegroundColor = "White"
echo '>>Deploy'
@mdimai666
mdimai666 / wordpress.nginx.conf
Created May 21, 2020 14:38
NGINX configuration for wordpress
server {
#listen 80;
set $root_path '/var/www/wordpress/';
root $root_path;
index index.php; # index defined to be served under directory
server_name _;
include d_ssl;
@mdimai666
mdimai666 / copy-file-with-newdatename.ps1
Created January 24, 2020 23:02
copy file to one drive with new name for test on device
using namespace System.IO
$oneDriveDir = 'C:\Users\D\OneDrive\AMAI\Share\MR'
Write-Output "copy apk"
$dateStamp = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$fName = 'src-cordova\platforms\android\app\build\outputs\apk\release\app-release.apk'
<VirtualHost *:88>
ServerAdmin [email protected]
ServerName vk.localhost
ServerAlias vk.localhost
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
@mdimai666
mdimai666 / .conkyrc
Created January 10, 2020 21:59
System monitor Conky settings file
conky.config = {
alignment = 'top_right',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'cornflowerblue',
default_outline_color = 'white',
default_shade_color = 'white',
double_buffer = true,
draw_borders = false,
//docker-build.ps1
docker build --rm -f "Dockerfile" -t mdimai666/doc1:latest "."
//docker-run.ps1
docker rm node1 -f
docker run --rm -d -p 3000:3000/tcp --name node1 mdimai666/doc1:latest
//scripts
"scripts": {
"dockerbuild": "pwsh docker-build.ps1",
@mdimai666
mdimai666 / vscode-python-workspace-integrateVenvForIntellisense.json
Last active December 28, 2019 01:45
VSCode include intellisense if use venv
{
"python.pythonPath": "${workspaceFolder}/../venv/Scripts/",
"editor.formatOnSave": true,
"python.autoComplete.extraPaths": [
"${workspaceFolder}/../venv/Lib/site-packages/"
]
}