Skip to content

Instantly share code, notes, and snippets.

  • macOS Ventura (13.4, M1) 環境で確認済み。

Disable mDNS on macOS

  1. sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool YES
  2. Reboot

Enable mDNS on macOS

  1. sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool NO
@cbluth
cbluth / file_response_writer.go
Created March 22, 2020 08:52 — forked from ismasan/file_response_writer.go
Write backend HTTP response to http.ResponseWriter and File
// fileResponseWriter wraps an http.ResponseWriter and a File
// passing it to an http.Handler's ServeHTTP
// will write to both the file and the response.
type fileResponseWriter struct {
file io.Writer
resp http.ResponseWriter
multi io.Writer
}
@zored
zored / main.go
Last active November 3, 2022 02:30
Golang shebang for scripting
//usr/bin/env go run "$0" "$@"; exit "$?"
package main
import "fmt"
func main() {
fmt.Println("ok")
}
@andre3k1
andre3k1 / install-gnu-sed-on-mac-osx.sh
Created July 26, 2018 18:39
How to install gnu sed on Mac OS X and set it as the default
# Check which version of sed is used when you run the `sed` command
# The version that ships with Mac OS X is
# /usr/bin/sed
which sed
# Install gnu-sed using Homebrew
# The `--with-default-names` option configures `sed` to use gnu-sed
# Without that option, you'll need to type `gsed` to use gnu-sed
brew install --default-names gnu-sed
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@tcnksm
tcnksm / main.go
Last active March 11, 2025 09:52
Export all Grafana dashboards via HTTP API in Golang
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
@grawert
grawert / jenkins_check_ssh_credentials.groovy
Created March 28, 2016 06:16
Check credentials by name if they already exist in Jenkins
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
def credentials_for_username(String username) {
def username_matcher = CredentialsMatchers.withUsername(username)
def available_credentials =
CredentialsProvider.lookupCredentials(
StandardUsernameCredentials.class,
Jenkins.getInstance(),
hudson.security.ACL.SYSTEM