All of the following information is based on go version go1.17.1 darwin/amd64.
| GOOS | Out of the Box |
|---|---|
aix |
✅ |
android |
✅ |
| #!/bin/bash | |
| #see https://github.com/ollama/ollama/issues/2006 for why this is needed | |
| set -e | |
| run_nethogs() { | |
| local pid="$1" | |
| nethogs -t -d 0 -P "$pid" | grep --line-buffered "ollama" | |
| } |
| # This file is licensed under the terms of the MIT license https://opensource.org/license/mit | |
| # Copyright (c) 2021-2025 Marat Reymers | |
| ## Golden config for golangci-lint v2.6.2 | |
| # | |
| # This is the best config for golangci-lint based on my experience and opinion. | |
| # It is very strict, but not extremely strict. | |
| # Feel free to adapt it to suit your needs. | |
| # If this config helps you, please consider keeping a link to this file (see the next comment). |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from mpl_toolkits.mplot3d import Axes3D | |
| SIZE = 10 # How big you'd like to draw | |
| fig = plt.figure() | |
| # OR USING `ax = fig.add_subplot(1, 1, 1, projection='3d')` | |
| ax = Axes3D(fig) |
| import imaplib2, time | |
| from threading import * | |
| # This is the threading object that does all the waiting on | |
| # the event | |
| class Idler(object): | |
| def __init__(self, conn): | |
| self.thread = Thread(target=self.idle) | |
| self.M = conn | |
| self.event = Event() |
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.
At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
| /* | |
| Benchmark_RWMutex-4 100000000 18.1 ns/op | |
| Benchmark_Atomic-4 200000000 8.01 ns/op | |
| Benchmark_RWMutex_parallel-4 30000000 46.7 ns/op | |
| Benchmark_Atomic_parallel-4 1000000000 2.61 ns/op | |
| */ | |
| package main |
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <uv.h> | |
| typedef struct req_bundle_s { | |
| uv_loop_t *loop; | |
| uv_fs_t *read_req; | |
| uv_fs_t *writ_req; |
| #!/usr/bin/env python3 | |
| import socket | |
| import struct | |
| import traceback | |
| import subprocess | |
| import time | |
| import signal | |
| import dnslib |