Skip to content

Instantly share code, notes, and snippets.

@marcelaraujo
marcelaraujo / gist:9a9fe07c5a4bcaea8c06
Created October 1, 2015 03:22
MacOS disable services
System process daemons that are system-wide provided by mac os x are described by launchd preference files that can be showed with the command:
$ sudo ls -all /System/Library/LaunchDaemons/
Third party process daemons that are system-wide provided by the administrator are described by preference files that can be showed with the command:
$ sudo ls -all /Library/LaunchDaemons/
Launch Agents that are per-user provided by mac os x usually loaded when the user logs in. Those provided by the system can be found with:
$ sudo ls -all /System/Library/LaunchAgents/
Launch Agents that are per-user provided by the administrator and usually loaded when the user logs in. Those provided by the system can be found with:
@troyfontaine
troyfontaine / 1-setup.md
Last active July 23, 2024 23:25
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@GuillaumeSmaha
GuillaumeSmaha / build-stages-status.groovy
Last active March 18, 2022 02:26
Functions to get stages executed and build state
import hudson.model.Action
import com.cloudbees.workflow.flownode.FlowNodeUtil
import com.cloudbees.workflow.rest.external.StatusExt
import org.jenkinsci.plugins.workflow.graph.FlowNode
import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode
import org.jenkinsci.plugins.workflow.cps.nodes.StepEndNode
import org.jenkinsci.plugins.workflow.actions.LabelAction
@UA3MQJ
UA3MQJ / Joken.md
Last active May 16, 2021 21:54
Elixir Joken JWT Examples v1.x

https://github.com/bryanjos/joken - A JSON Web Token (JWT) Library

1. Закодировать JWT - подпись секретным текстовым ключем "my_secret_key"

  token = %{user_id: 123}
  |> Joken.token()
  |> Joken.with_signer(Joken.hs256("my_secret_key"))
  |> Joken.sign()
  |> Joken.get_compact()
@sparkcodeuk
sparkcodeuk / floating-ip-gateway.sh
Created March 2, 2018 21:47
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic)
#!/bin/bash
# Force outbound traffic through the attached floating IP
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
@Stono
Stono / pilot-agent-agent
Created June 25, 2019 16:14
A wrapper entrypoint for istio-proxy, which makes it slightly more graceful shutting down and also adds support for calling envoys quitquitquit endpoint
#!/bin/bash
echo "Starting custom autotrader pilot-agent wrapper..."
echo "Pilot-agent args: $@"
/usr/local/bin/pilot-agent "$@" &
AGENT_PID=$!
echo "Pilot agent started with pid: $AGENT_PID"
log() {
echo "[pilot-agent-agent] $*"
@hungneox
hungneox / WIN10.MD
Last active June 25, 2024 14:17
How Make a Windows 10 USB Using Your Mac - Build a Bootable ISO From Your Mac's Terminal

Most new PCs don't come with DVD drives anymore. So it can be a pain to install Windows on a new computer.

Luckily, Microsoft makes a tool that you can use to install Windows from a USB storage drive (or "thumbdrive" as they are often called).

But what if you don't have a second PC for setting up that USB storage drive in the first place?

In this tutorial we'll show you how you can set this up from a Mac.

Step 1: Download the Windows 10 ISO file

You can download the ISO file straight from Windows. That's right - everything we're going to do here is 100% legal and sanctioned by Microsoft.