Skip to content

Instantly share code, notes, and snippets.

View squashbrain's full-sized avatar

Chris McClenny squashbrain

  • WideOrbit Inc
  • Jasper, AL
View GitHub Profile
@fabriciocolombo
fabriciocolombo / gist:4279304
Created December 13, 2012 20:00
Capturing console output with Delphi
//Anonymous procedure approach by Lars Fosdal
type
TArg<T> = reference to procedure(const Arg: T);
procedure TForm1.CaptureConsoleOutput(const ACommand, AParameters: String; CallBack: TArg<PAnsiChar>);
const
CReadBuffer = 2400;
var
saSecurity: TSecurityAttributes;
hRead: THandle;
@hakobe
hakobe / client.go
Created September 23, 2016 16:33
golang unix domain socket
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@hotsoft-desenv2
hotsoft-desenv2 / Delphi-Execute-a-Console-Program-and-Capture-Its-Output.pas
Created December 19, 2017 11:42
Delphi Execute a Console Program and Capture Its Output
function ExecAndCapture(const ACmdLine: string; var AOutput: string): Integer;
const
cBufferSize = 2048;
var
vBuffer: Pointer;
vStartupInfo: TStartUpInfo;
vSecurityAttributes: TSecurityAttributes;
vReadBytes: DWord;
vProcessInfo: TProcessInformation;
vStdInPipe : TAnoPipe;
@nakabonne
nakabonne / aes256-gcm.go
Created December 19, 2020 06:19
Example of AES-256 GCM encryption with a key derived from password
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"fmt"
"log"
@0187773933
0187773933 / GolangSSHTunnelForwardAndReverse.go
Last active September 3, 2024 04:05
Golang SSH Forward and Reverse Tunnel
package main
import (
"context"
"fmt"
"os"
"os/signal"
"path"
"sync"
"syscall"
@NHAS
NHAS / sshKeygen.go
Last active May 2, 2023 12:47
Generate SSH private key (Ed25519)
package main
import (
"crypto/ed25519"
"crypto/rand"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
)
@shobhitic
shobhitic / index.html
Last active May 31, 2023 16:38
Showcase NFTs from a specific collection with Enumerable module - https://youtu.be/7P2nnpU-HoQ
<html>
<head>
<title>Show NFTs</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
</head>
<body>
<div id="root">
</div>
<script>