Skip to content

Instantly share code, notes, and snippets.

@karlisabele
karlisabele / Dockerfile
Created June 13, 2019 10:41
WP plugins and themes pre-installed on docker image
FROM wordpress:php7.1-apache
### This is where you copy all the plugins and themes to the corresponding folders
COPY my-theme /themes/my-theme
COPY my-plugin /plugins/my-plugin
COPY entrypoint.sh /usr/bin/entrypoint
RUN chmod +x /usr/bin/entrypoint
@ryanpcmcquen
ryanpcmcquen / darkify_slack.sh
Last active February 23, 2023 16:08
Darkify your Slack.
#!/bin/sh
# Darkify Slack on Mac OS or Linux.
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh
if [ "`uname -s`" = "Darwin" ]; then
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/dist/ssb-interop.bundle.js"
else
SLACK_INTEROP_JS="/usr/lib/slack/resources/app.asar.unpacked/dist/ssb-interop.bundle.js"
fi
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active August 1, 2024 11:30
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
kubectl get po --all-namespaces | grep Evicted | awk '{print $2, "--namespace", $1}' | xargs kubectl delete pod
func package(config: Configuration) {
}
@merikan
merikan / Jenkinsfile
Last active June 13, 2024 03:56
Some Jenkinsfile examples
Some Jenkinsfile examples
@jasisk
jasisk / mount.sh
Created October 24, 2017 19:37
Mount an APFS ramdisk in High Sierra
SIZE=1024
DISKNAME=ramdisk
MOUNTPATH="$HOME/mnt"
DISK="$(basename $(hdiutil attach -nomount "ram://$(( ${SIZE} * 1024 * 1024 / 512 )))"
diskutil partitionDisk "${DISK}" GPT APFS %noformat% R
newfs_apfs -v "${DISKNAME} "${DISK}s1"
diskutil mount -mointPoint "${MOUNTPATH}" "${DISKNAME}"
@dantio
dantio / nginx.conf
Created May 6, 2017 13:05
Wordpress behind HTTPS/SSL Proxy (nginx, fastcgi)
##
# nginx server with http + ssl/https (no WP)
# /etc/nginx/sites-available/example.com
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://no-ssl:8080;
proxy_set_header Host $host;
@jonico
jonico / Jenkinsfile
Last active May 11, 2024 09:58
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",