Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / how-to-start-colima-automatically-on-macos.md
Last active February 2, 2024 05:09
[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 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
@afloesch
afloesch / jenkins-in-docker.md
Last active April 23, 2024 11:15
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 April 16, 2024 12:18
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: "timothyjames.short@gmail.com")
}
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 <alxtz.tw@gmail.com>",
"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.
@braian87b
braian87b / mwan3-notes.md
Last active October 22, 2023 12:33
How to get MWAN3 Working Properly on OpenWRT / LEDE

In experience to get a proper working multiple wan configuration using mwan3 starting from scratch you should:

Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3

The official documentation seems to be very detailed and up to date, I recommend reading those first: https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3 but I recommend to give a look at my config file below, since my approach for policyes is very nice.

First of all: Activate conntrack, docs says that is important and neccesary to get MWAN3 work properly, and it is needed to reboot: