- Create a blob
- Create a tree
- Create a commit
- Create (or update) a ref
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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "log" | |
| "github.com/google/gopacket" | |
| "github.com/google/gopacket/pcap" | |
| ) |
NOTICE: This guide is no longer relevant, as a lot has changed over time and Go supports Apple Silicon natively just fine now!
Follow these short instructions on how to compile Go for Apple Silicon (M1). From here on out, we may simply refer to it as the "ARM device".
This entire process should only take about 5-10 minutes, but please read through everything carefully, in order to avoid any potential issues along the way.
Note that at the time of writing this, Go was not yet officially available for Apple's ARM.
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 mcr.microsoft.com/dotnet/core/sdk:3.1-focal | |
| USER root | |
| RUN cd /tmp | |
| # now get the key: | |
| RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | |
| # now install that key | |
| RUN apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | |
| # now remove the public key file exit the root shell | |
| RUN rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB |
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
| $Global:Listener = [HashTable]::Synchronized(@{}) | |
| $Global:CnQueue = [System.Collections.Queue]::Synchronized((New-Object System.collections.queue)) | |
| $Global:space = [RunSpaceFactory]::CreateRunspace() | |
| $space.Open() | |
| $space.SessionStateProxy.setVariable("CnQueue", $CnQueue) | |
| $space.SessionStateProxy.setVariable("Listener", $Listener) | |
| $Global:newPowerShell = [PowerShell]::Create() | |
| $newPowerShell.Runspace = $space | |
| $Timer = New-Object Timers.Timer | |
| $Timer.Enabled = $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
| # Write local | |
| git config --local commit.gpgsign false | |
| # Read local (if never set, can be an empty value) | |
| git config --local commit.gpgsign |
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 ConvertFrom-SecureStringToPlainText ([System.Security.SecureString]$SecureString) { | |
| [System.Runtime.InteropServices.Marshal]::PtrToStringAuto( | |
| [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) | |
| ) | |
| } | |
| New-Alias -Name s2p -Value ConvertFrom-SecureStringToPlainText |
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 | |
| set -ex | |
| if docker plugin inspect loki > /dev/null; then | |
| echo "Loki plugin already installed" | |
| else | |
| docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions | |
| fi |
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
| <# | |
| References: | |
| - https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netframework-4.5 | |
| - https://github.com/poshbotio/PoshBot/blob/master/PoshBot/Implementations/Slack/SlackConnection.ps1 | |
| - https://www.leeholmes.com/blog/2018/09/05/producer-consumer-parallelism-in-powershell/ | |
| #> | |
| $client_id = [System.GUID]::NewGuid() | |
| $recv_queue = New-Object 'System.Collections.Concurrent.ConcurrentQueue[String]' |