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 April 1, 2025 04:28
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 26, 2025 15:18
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 June 5, 2024 14:28
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"
@davidjb
davidjb / shibboleth-debug.md
Created October 27, 2017 01:41
Shibboleth debugging steps

Shibboleth Debugging

Throught this whole process, if you're unsure whether a Shibboleth login session worked (such as if it looks like your application isn't getting attributes etc), you can test by accessing /Shibboleth.sso/Session after going a /Shibboleth.sso/Login cycle and it'll list various details, or state:

A valid session was not found

if it didn't work or you haven't logged in yet.