Skip to content

Instantly share code, notes, and snippets.

@joshimoo
joshimoo / CreateProjectFolders.cs
Created June 3, 2014 12:17
Unity Project Structure Template
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
public class CreateProjectFolders : ScriptableObject
{
// Add menu to the main menu
[MenuItem("Custom/Project/Create Project Folders")]
static void SetupProjectFolders()
public class ExampleFactory extends EntityFactory{
public static Entity createEntity(Vector2f pos) {
Entity banana = createEntity(EntityType.PROJECTILE, pos);
/**
* Here are some ways to use the CollidedWithEvent.
* CollidedWithEvent is a custom Event that I wrote.
* @see de.tu_darmstadt.gdi1.gorillas.entities.events.CollidedWithEvent
*/
CollisionEvent collision = new CollisionEvent();
@joshimoo
joshimoo / create-longhorn-support-bundle-via-curl.md
Created February 12, 2021 11:39
how to create a longhorn support bundle when the ui is not working

longhorn/longhorn#2118 (comment)

The longhorn-ui uses websockets to communicate with the backend, the icons on the bottom right are the statuses of the websocket connections. Can you generate a support bundle manually, below are instructions to do this via curl please replace the longhorn-backend.xip.io with your own exposed service.

The easiest is to expose longhorn backend service, as shown below: expose backend service

// requesting support bundle via post
@joshimoo
joshimoo / update_volume_tag.txt
Last active March 3, 2021 19:40
Manually update a volumes node tag
# tag your nodes where you want to schedule the replicas to with the tag `linkerd`
# afterwards we need to modify the volume to limit it to the nodes taged with `linkerd`
`kubectl get volumes.longhorn.io -n longhorn-system`
NAME STATE ROBUSTNESS SCHEDULED SIZE NODE AGE
already-tag2 attached healthy True 1073741824 jmoody-lh-dev-work2 31m
test-tag attached degraded False 1073741824 jmoody-lh-dev-work3 35m
# find the volume that you want to edit the node tag of
# in my case we are going to pick the volume `test-tag`
@joshimoo
joshimoo / longhorn-ui-with-traeffic.md
Last active March 25, 2021 15:09
Longhorn UI with traeffic / metallb load balancer

https://forums.rancher.com/t/longhorn-ui-with-traefik/16742

I managed it to route the longhorn-ui via my traefik. So I can answer my question by myself. Here is my receipt:

1.) first remove the default service provided by Longhorn deployment: kubectl delete service longhorn-frontend -n longhorn-system

2.) next create a service definition (longhorn-service.yaml)

apiVersion: v1
@joshimoo
joshimoo / lh-trace-generation.sh
Created June 16, 2021 14:05
longhorn strace instructions for perf investigation
# TODO: someone should write this a batch script
# <PID> = 24999
# create a directory for the log files
# and execute all commands inside of that directory
mkdir lh-trace
cd lh-trace
# pstree to determine the processes
# will create single file of the form pstree.log