Skip to content

Instantly share code, notes, and snippets.

@partikus
partikus / README.md
Created November 13, 2023 06:45 — forked from lmb/README.md
macOS: use ssh-agent from homebrew

This recipe allows you to use the ssh-agent from homebrew with the auto generated SSH_AUTH_SOCK in /private/tmp. It works because disabling com.openssh.ssh-agent doesn't stop launchd from allocating SSH_AUTH_SOCK. com.homebrew.ssh-agent spawns a shell to remove the socket and then execute the homebrew ssh-agent.

  1. Install openssh from homebrew
  2. Disable the built in macOS agent: launchctl disable gui/$UID/com.openssh.ssh-agent
  3. Copy com.homebrew.ssh-agent.plist into ~/Library/LaunchAgents
  4. Enable the new agent: launchctl bootstrap gui/$UID com.homebrew.ssh-agent.plist
  5. Ensure that the correct agent is running:
@partikus
partikus / README.md
Created January 9, 2022 09:21
docker tips & tricks

Docker Tips & Tricks

Running composer through docker container sharing SSH Auth, users, cache dir etc.

docker run -it --rm \
  --env COMPOSER_HOME \
  --env SSH_AUTH_SOCK=/ssh-auth.sock \
  --user $UID:$GID \
 --volume $SSH_AUTH_SOCK:/ssh-auth.sock \
@partikus
partikus / README.md
Last active March 4, 2021 11:51
improved: Consistent USB device naming in a FreeNAS jail

cc2652 support

keywords: zigbee, zigbee2mqtt, freenas, truenas, jail,

Enhanced version of jail's poststart script.

@partikus
partikus / wielkaorkiestra.js
Created January 21, 2019 16:27
Wielka Orkiestra
// simple JS script to parse and sum of donations for the chosen city
// usage
// 1. copy&paste below script
// 2. choose the city manually
// 3. then call e.g. `sum().then(alert)` or sum().then(sum => { console.log(sum); })
sumDonations = () => {
return [...document.querySelectorAll('.institution .value').values()].map(e => parseFloat(e.innerText)).reduce((a,b) => a + b, 0)
}
@partikus
partikus / styles.css
Created May 13, 2017 08:26
kanboard styles
header {
background-color: rgb(0, 153, 76);
padding: 10px 10px 15px 10px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
}
h1 {
font-weight: normal;
@partikus
partikus / README.md
Created November 5, 2016 17:20
ImageMagick - how to generate images for website

how to generate images for website

In order to convert large and heavy images to light version for websites we can use ImageMagick and Parallel packages.

./convert.sh images/ output/

# OUTPUT
# /output/
@partikus
partikus / Jenkins.md
Last active October 13, 2017 06:58
MyDevil.net - how to use ansible

To keep jenkins running in the background you can use screen.

#!/bin/bash
# jenkins.sh

if ! pgrep "jenkins" > /dev/null; then
        screen -dm java -Xms256m -Xmx512m -Dhudson.udp=-1 -Dhudson.DNSMultiCast$
fi