Skip to content

Instantly share code, notes, and snippets.

View atc0005's full-sized avatar

Adam Chalkley atc0005

View GitHub Profile
@StarBuckR
StarBuckR / main.go
Last active April 29, 2024 07:50
Golang Ldap Authentication, Bind and Search, including Anonymous Bind
package main
import (
"fmt"
"log"
"github.com/go-ldap/ldap/v3"
)
const (
@zulhfreelancer
zulhfreelancer / local-ruby-gem.md
Last active December 4, 2023 21:17
How to use a local Ruby gem in Rails project?

Situation

You are working on a Rails app that uses a gem named abc. This gem is hosted on RubyGems and the source code of the gem is available at https://github.com/your-username/abc.

You created a new branch locally for your gem (new-feature). You wanted to modify the gem and load it directly to your local Rails app. And, you don't want to push the gem changes to GitHub and publish the gem to RubyGems just yet.

You want all the changes that you made in your local gem directory get reflected immediately in your local Rails app without requiring you to run gem build and gem install command in the gem's local directory.

Steps

package main
import (
"encoding/json"
"io/ioutil"
"net/http"
"os"
"regexp"
"time"
)
@bindiego
bindiego / binwu.go
Created August 30, 2019 10:24
Golang get fully qualified domain name / hostname
package main
import (
"fmt"
"os"
"os/exec"
"strings"
"bytes"
//"time"
)
@rich-nahra
rich-nahra / openssl_commands.md
Created May 16, 2019 14:30 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@shaneutt
shaneutt / LICENSE
Last active May 14, 2024 15:02
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@miguelmota
miguelmota / crypto.go
Last active November 2, 2022 21:19
Golang SHA256 hash example
package crypto
import (
"crypto/sha256"
)
// NewSHA256 ...
func NewSHA256(data []byte) []byte {
hash := sha256.Sum256(data)
return hash[:]
@andrewsomething
andrewsomething / main.go
Last active August 29, 2022 16:19
Report download statistics for GitHub release assets
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"strings"
"text/tabwriter"
@simonw
simonw / how-to.md
Last active March 26, 2024 23:21
How to create a tarball of a git repository using "git archive"