This file contains hidden or 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
| services: | |
| # source: https://stackoverflow.com/a/78212726 | |
| unhealthy_container_restarter: | |
| image: docker:cli | |
| network_mode: none | |
| cap_drop: | |
| - ALL | |
| volumes: | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| command: | |
This file contains hidden or 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
| @echo off | |
| SETLOCAL EnableExtensions | |
| SETLOCAL DisableDelayedExpansion | |
| set v_params=%* | |
| set v_params=%v_params:\=/% | |
| set v_params=%v_params:c:=/mnt/c% | |
| REM v_params=%v_params:"=\"% | |
| REM echo calling %~n0 %v_params% | |
| set DISTRO=Ubuntu | |
| C:\Windows\system32\wsl.exe -d %DISTRO% %~n0 %v_params% |
This file contains hidden or 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
| class Program | |
| { | |
| static async Task Main(string[] args) | |
| { | |
| var _usePKCE = false; | |
| // ====================================== | |
| var clientId = "clientId"; | |
| var clientSecret = "clientSecret"; | |
| //_usePKCE = true; // for SPA/Mobile (without backend) |
This file contains hidden or 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
| $hostName = $env:COMPUTERNAME # or the server name that you will use to connect | |
| $hostIP=(Get-NetAdapter| Get-NetIPAddress).IPv4Address|Out-String | |
| $srvCert = New-SelfSignedCertificate -DnsName $hostName,$hostIP -CertStoreLocation Cert:\LocalMachine\My | |
| $srvCert | |
| Export-Certificate -Cert $srvCert -FilePath 'C:\SSL_PS_Remoting.cer' | |
| # import this certificate on the client machine | |
| # Import-Certificate -FilePath c:\SSL_PS_Remoting.cer -CertStoreLocation Cert:\LocalMachine\root\ | |
| Get-ChildItem wsman:\localhost\Listener |
This file contains hidden or 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
| SELECT CONNECTIONPROPERTY('net_transport') AS net_transport | |
| ,CONNECTIONPROPERTY('physical_net_transport') AS physical_net_transport | |
| ,SERVERPROPERTY ('ServerName') as ServerName | |
| ,SERVERPROPERTY ('Edition') as Edition | |
| ,SERVERPROPERTY ('ProductVersion') as ProductVersion | |
| ,CONNECTIONPROPERTY('local_net_address') AS local_net_address | |
| ,CONVERT(BIGINT,CONNECTIONPROPERTY('local_tcp_port')) + 65536 AS actual_tcp_port | |
| ,CONNECTIONPROPERTY('client_net_address') AS client_net_address | |
| ,CONNECTIONPROPERTY('auth_scheme') AS auth_scheme | |
| ,CONNECTIONPROPERTY('protocol_type') AS protocol_type |
This file contains hidden or 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
| function Toggle-Comment | |
| { | |
| $file = $psise.CurrentFile | |
| $textLines = $file.Editor.SelectedText.Split("`n",[System.StringSplitOptions]::None) | |
| $result = "" | |
| foreach ($line in $textLines) | |
| { | |
| if([String]::IsNullOrWhiteSpace($line) -ne $true) | |
| { |
This file contains hidden or 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
| <NotepadPlus> | |
| <UserLang name="LogFile" ext="log"> | |
| <Settings> | |
| <Global caseIgnored="yes" /> | |
| <TreatAsSymbol comment="no" commentLine="no" /> | |
| <Prefix words1="no" words2="no" words3="no" words4="no" /> | |
| </Settings> | |
| <KeywordLists> | |
| <Keywords name="Delimiters">[(0])0</Keywords> | |
| <Keywords name="Folder+"></Keywords> |
This file contains hidden or 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
| const CrossOriginLocalStorage = function(currentWindow, iframe, allowedOrigins, onMessage) { | |
| this.allowedOrigins = allowedOrigins; | |
| let childWindow; | |
| // some browser (don't remember which one) throw exception when you try to access | |
| // contentWindow for the first time, it works when you do that second time | |
| try { | |
| childWindow = iframe.contentWindow; | |
| } catch(e) { | |
| childWindow = iframe.contentWindow; |
This file contains hidden or 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
| #!/bin/bash | |
| # A bash script to update a Cloudflare DNS A record with the external IP of the source machine | |
| # Used to provide DDNS service for my home | |
| # Needs the DNS record pre-creating on Cloudflare | |
| # Proxy - uncomment and provide details if using a proxy | |
| #export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport> | |
| # Cloudflare zone is the zone which holds the record |
This file contains hidden or 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
| FROM alpine:3.11 | |
| ARG SERVICE_USER | |
| ARG SERVICE_HOME | |
| # Default Settings | |
| ENV SERVICE_USER ${SERVICE_USER:-firefox} | |
| ENV SERVICE_HOME ${SERVICE_HOME:-/home/${SERVICE_USER}} | |
| RUN \ | |
| adduser -h ${SERVICE_HOME} -s /sbin/nologin -u 1000 -D ${SERVICE_USER} \ |
NewerOlder