Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / how-to-start-colima-automatically-on-macos.md
Last active March 15, 2025 18:16
[How to start Colima automatically on macOS] Instructions for starting Colima automatically on macOS similar to Docker Desktop #macos #colima #docker

⚠️ Note: Since the merge of the commit Homebrew/homebrew-core#149670, starting Colima is as easy as running brew services start colima. You can skip the following work-around.

Steps

  1. Create an executable script to run in foreground and manage colima:
cat <<-EOF | sudo tee /usr/local/bin/colima-start-fg
#!/bin/bash
@fl64
fl64 / main.go
Created December 24, 2020 07:18
golang prometheus exporter example
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"log"
"math/rand"
"net/http"
"time"
@hatelove
hatelove / babel with jest
Last active October 10, 2022 20:59
jest installation
yarn add --dev babel-jest @babel/core @babel/preset-env
@merlos
merlos / GPX File example
Last active January 20, 2025 13:24
Example of GPX file
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="Open GPX Tracker for iOS">
<wpt lat="40.762468446233115" lon="-73.99090283852468">
<time>2019-12-06T14:19:25Z</time>
<name>09:19:25</name>
<desc>Dec 6, 2019 at 09:19:25</desc>
</wpt>
<wpt lat="40.80559910750484" lon="-73.95810627601767">
<time>2019-12-06T14:19:29Z</time>
<name>09:19:29</name>
@afloesch
afloesch / jenkins-in-docker.md
Last active October 8, 2024 03:36
Jenkins in Docker (docker-in-docker)

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active March 12, 2025 23:08
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
Step#1 (clean cache)
>sourceanalyzer -b xvwa -clean
Step#2 (translate source code to byte code)
>sourceanalyzer -Xmx2500M -Xms2500M -64 -verbose -b xvwa -cp **/*.jar **/*.php
Step#3 (scan with rulepack, custom rules, filters, etc)
>>sourceanalyzer -b xvwa -scan -f wvwa.fpr
pipeline {
agent any
parameters {
string(name: 'server', defaultValue: "C:\\HexawareTraining\\Cohort1\\JenkinsLabs\\apache-tomcat-")
string(name: 'emailTo', defaultValue: "[email protected]")
}
triggers {
@alxtz
alxtz / package.json
Created December 18, 2017 09:00
Vue-cli boilerplate 的 package.json
{
"name": "iron-man-demo",
"version": "1.0.0",
"description": "為了 demo 而建的 project",
"author": "Alex Tzeng <[email protected]>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"lint": "eslint --ext .js,.vue src",
@kevinmilner
kevinmilner / synology_surveillance_usb_archiver.sh
Created July 28, 2017 23:38
Synology Surveillance Station USB storage archive workaround cron job
#!/bin/bash
# Synology Surveillance Station doesn't let you store recordings on USB storage, which means that you must
# use the internal (often mirrored) disks. This is less than ideal. Unfortunately, just symbolically
# linking the surveillance store directory to one on USB storage causes surveillance station to fail after
# a day or so. This workaround still uses your main storage for recording, but moves older files to USB storage
# for archival. The moved files themselves are symbolically linked back to the original storage location.
#
# Script should be run regularly, either by editing /etc/crontab or through Synology's built in script scheduling.
# Be sure to edit the user inputs below, and set up SS to keep recordings for longer than the external archive period.