Skip to content

Instantly share code, notes, and snippets.

View Cubixmeister's full-sized avatar

Karol Piłat Cubixmeister

View GitHub Profile
@Cubixmeister
Cubixmeister / install-sync-ssh-keys.sh
Last active December 2, 2023 23:54
samber/sync-ssh-keys quick install script - synchronize your ssh keys from github on every login
#!/bin/bash -xe
set -ex
if [[ -z "$SYNC_GH_ORG" ]]; then
read -p "Enter Github Org: " SYNC_GH_ORG
fi
if [[ -z "$SYNC_GH_TEAM" ]]; then
read -p "Enter Github Team: " SYNC_GH_TEAM
fi
@uenoB
uenoB / README.en.md
Last active November 14, 2023 17:20
How to set up QEMU working properly on M1 Mac

English | Japanese

How to set up QEMU working properly on M1 Mac

Last-Update: June 8, 2021.

This document describes how to run Windows 10 for ARM and Linux operating systems properly on Apple Silicon (M1) Mac by using open source software only. The combination of [QEMU] and [Alexander Graf's Hypervisor.framework support patch][Alexander Graf's patch] allows us to run Windows 10 and Linux for 64-bit ARM processors on M1 Mac efficiently. Several webpages such as [How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac] and [QEMU on M1 Mac] describe how to set up a QEMU environment with Alex's patch. While they are helpful for the first trial, additional effort is needed to realize a proper QEMU environment that can be used for our daily business.

@tsavola
tsavola / connpair.go
Created April 1, 2016 00:38
Like socketpair, but for Golang, and TCP instead of Unix sockets
package connpair
import (
"net"
)
func ConnPair() (serverConn, clientConn net.Conn, err error) {
l, err := net.Listen("tcp", "localhost:0")
if err != nil {
return
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

{
"version": {
"name": "13w41a",
"protocol": 0
},
"players": {
"max": 100,
"online": 5,
"sample":[
{"name":"Thinkofdeath", "id":""}
@aadnk
aadnk / AttributeStorage.java
Created September 29, 2013 17:12
Store arbitrary data on an ItemStack safely by using attributes. Use the following attribute class: https://gist.github.com/aadnk/6754159
package com.comphenix.example;
import java.util.UUID;
import org.bukkit.inventory.ItemStack;
import com.comphenix.example.Attributes.Attribute;
import com.comphenix.example.Attributes.AttributeType;
import com.comphenix.example.Attributes.Operation;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
@bemasher
bemasher / intput.txt
Created July 10, 2012 12:51
Named Binary Tag parser written in Golang using reflection to populate native types.
// This is the structure of the binary nbt file
TAG_Compound('Level') {
TAG_Compound('nested compound test') {
TAG_Compound('egg') {
TAG_String('name'): 'Eggbert'
TAG_Float('value'): 0.5
}
TAG_Compound('ham') {
TAG_String('name'): 'Hampus'
TAG_Float('value'): 0.75