Skip to content

Instantly share code, notes, and snippets.

@htruong
htruong / chroot-to-pi.sh
Last active May 17, 2024 13:12
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@ruffsl
ruffsl / chroot-to-pi.sh
Last active May 17, 2024 13:12 — forked from htruong/chroot-to-pi.sh
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@pchmn
pchmn / 1_aws_ecs_conf.md
Last active May 17, 2024 13:10
Setup an AWS ECS Cluster

Configuring AWS ECS

Configuration of ECS with EC2 instances

Setting up ECS

Create an IAM User

Official doc

Create a key pair

Official doc

@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 17, 2024 13:09
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@projectoperations
projectoperations / README.md
Created May 17, 2024 13:05 — forked from gamma/README.md
How to connect a docker container to the docker daemon on a Synology NAS

Note: This originates from: https://forum.synology.com/enu/viewtopic.php?f=258&t=107508&sid=78d911737c5ecea1f9087bdab13612bf&start=15#p478281

Here are steps that I have modified to work for me. This assumes you have a shared folder named "docker" in volume1.

We need to Symlink /var/run/docker.sock to /volume1/docker/docker.sock, because Synology Docker GUI will not be able to run it when it's pointed directly to /var/run/docker.sock. Also the symlink needs to persist after reboot. To make it do so, you will need to create an automated task in your Synology DSM via "Task Scheduler".

  • Go to "Control Panel" > "Task Scheduler".
  • Click "Create" > "Scheduled Task" > "User-defined Script".
  • On the "Create Task: Window, make sure "User:" is selected as "root" and rename the "Task:" to whatever you like.
  • Click "Schedule" tab. Under "Date - Run on the following days", select "Daily". Under "Time - Frequency", select "Every 1 hour(s)" (just to be on the safe side).
@pppoe252110
pppoe252110 / RandomExtension.cs
Last active May 17, 2024 13:06
A random function to determine a random item from a collection with a chance, with the chance being cast to a value between 0 and 1. Example: chance - 0.1 chance - 0.1 chance - 0.2 become chance - 0.25 chance 0.25 chance - 0.5. This makes it possible not to count a certain chance for hundreds of items in a collection
using System;
using UnityEngine;
public static class RandomExtension
{
public static int ProceedValue(float random, RandomData[] data)
{
var cumulativeSumArray = new float[data.Length];
cumulativeSumArray[0] = data[0].chance;
for (int i = 1; i < cumulativeSumArray.Length; ++i)
@rougier
rougier / fractal-dimension.py
Last active May 17, 2024 13:04
Fractal dimension computing
# -----------------------------------------------------------------------------
# From https://en.wikipedia.org/wiki/Minkowski–Bouligand_dimension:
#
# In fractal geometry, the Minkowski–Bouligand dimension, also known as
# Minkowski dimension or box-counting dimension, is a way of determining the
# fractal dimension of a set S in a Euclidean space Rn, or more generally in a
# metric space (X, d).
# -----------------------------------------------------------------------------
import scipy.misc
import numpy as np