Skip to content

Instantly share code, notes, and snippets.

@Cyang39
Cyang39 / alist-upload.md
Created September 8, 2024 02:58
curl 上传 alist 的 bash 脚本

参考这个分享的curl上传方法编写的脚本,目的是简化 token 获取到上传文件的流程。

个人用在定时文件备份中。

#!/bin/bash

# 检查参数数量
if [ $# -ne 6 ]; then
    echo "Usage: $0 --username <username> --password <password> <local-file> <alist-url>"
@fardjad
fardjad / how-to-start-colima-automatically-on-macos.md
Last active May 19, 2025 01:13
[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 May 24, 2025 06:44
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 June 8, 2025 18:55
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",