Skip to content

Instantly share code, notes, and snippets.

View sylr's full-sized avatar

Sylvain Rabot sylr

View GitHub Profile
echo "[+] Getting \system\\currentcontrolset\\services"
$raw_services = Get-ChildItem -Path hklm:\system\\currentcontrolset\\services | select Name
$services = @()
foreach ($srv in $raw_services) {
$shortname = "$srv".Split("\")[-1]
$shortname = $shortname.Substring(0,$shortname.Length-1)
$services += $shortname
}
@peterhellberg
peterhellberg / graceful.go
Last active November 13, 2024 20:20
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@bmhatfield
bmhatfield / .profile
Last active November 14, 2024 12:11
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else