This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set proxy settings if behind an enterprise proxy by using these in PS profile | |
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://proxy:port') | |
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials | |
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true | |
# Set proxy settings for git | |
git config --global https.proxy http://username:password@proxy:port | |
git config --global http.sslVerify false | |
# Type the command to install Chocolatey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Shows Windows native credential dialog on PowerShell 7.x and VS Code. | |
.DESCRIPTION | |
The cmdlet utilizes Windows native code based on P/Invoke calls. The parameters and output are the same as Get-Credential cmdlet. Based on the example: https://www.developerfusion.com/code/4693/using-the-credential-management-api/ | |
.SYNTAX | |
Get-WinCredential [[-UserName] <string>] -Message <string> [<CommonParameters>] | |
.EXAMPLE | |
Get-WinCredential | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# allow running: Set-ExecutionPolicy Bypass -Scope Process -Force | |
# src: https://gist.github.com/apfelchips/792f7708d0adff7785004e9855794bc0 | |
# goal: install all basic tools / pin software with working autoupdate mechanism / specialized stuff is commented out | |
# misc: Windows Store .appx downloader https://store.rg-adguard.net/ | |
# Check Permissions | |
if ( -Not( (New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) ){ | |
Write-Error -Message "Script needs Administrator permissions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
settings.Image = FontAwesome4.Instance.GetImage(new FontAwesome4.Properties(FontAwesome4.Type.ArrowCircleODown) | |
{ | |
SetFontFileSaveLocation = "font.ttf", | |
ForeColor = Color.FromArgb(255, 193, 7), | |
Size = 30, | |
BackColor = BackColor, | |
BorderColor = Color.White, | |
ShowBorder = false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// There are three modes can be used. | |
// Mode 1: Percentage mode | |
ProgressBar progressBar = new ProgressBar(); | |
progressBar.Show(); | |
progressBar.Update(0.01); | |
// Mode 2: Item count mode | |
ProgressBar progressBar = new ProgressBar(100); | |
progressBar.Show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServicePointManager.SecurityProtocol = VitNX3.Functions.Web.Config.UseProtocols(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string request = Post("https://site.com/auth", "client_id=43435&key=create"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gets the clipboard text | |
GetClipboardText GetClipboard = new GetClipboardText(); | |
string output = GetClipboard.GetText(); | |
// Sets the clipboard text | |
string input = "Hello World!"; | |
await SetClipboardText.Run(() => System.Windows.Forms.Clipboard.SetText(input)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private PerformanceCounter PCounter = new PerformanceCounter(); | |
// Your code | |
PCounter.Start();// Start measure | |
// Your code for measurements | |
double interval = PCounter.End(); // Result interval in seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random | |
import shutil | |
import string | |
from os import system | |
from random import randrange | |
import time | |
import requests | |
import uuid | |
from bs4 import BeautifulSoup as BSHTML |
NewerOlder