Skip to content

Instantly share code, notes, and snippets.

View BradenM's full-sized avatar

Braden Mars BradenM

  • Hattiesburg, MS
  • 21:35 (UTC -05:00)
View GitHub Profile
@hello-smile6
hello-smile6 / hardbrick.sh
Last active February 7, 2024 13:24
/dev bowling
# DO NOT RUN UNLESS IT'S A VM! I TAKE NO RESPOSIBILITY FOR YOUR ACTIONS WITH THIS.
exit
kill -9 $pid
logout
kill -9 1
pkill init
sudo pkill init
for device in `find /dev`
do
# Don't run synchronously
@gh640
gh640 / use_python_poetry_cache_on_github_actions_workflow.yml
Last active April 29, 2024 15:05
Sample: Use Python Poetry cache on GitHub Actions workflow
name: Use Python Poetry cache on GitHub Actions workflow
on:
push:
branches:
- main
env:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.4.2"
@CircuitSetup
CircuitSetup / printer.cfg
Created June 27, 2021 12:34
CR-30 Config
# This file contains pin mappings for the Creality CR-30 PrintMill. To
# use this config, during "make menuconfig" select the STM32F103 with
# a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
@g2g
g2g / AdbCommands
Created October 7, 2020 21:41 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@efi-mk
efi-mk / network.yaml
Last active January 13, 2023 14:52
A cloud formation script to create a vpc with 2 private subnets and 1 public subnet
AWSTemplateFormatVersion: 2010-09-09
Description: My Network Environment
Resources:
# VPC containing 3 subnets, 1 is public, while the other 2 are private for RDS
MyVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: 'true'
EnableDnsHostnames: 'true'
@hopeseekr
hopeseekr / docker_dedicated_filesystem.md
Created February 3, 2018 04:01
Putting Docker on its own pseudo filesystem

Docker on BTRFS is very buggy and can result in a fully-unusable system, in that it will completely butcher the underlying BTRFS filesystem in such a way that it uses far more disk space than it needs and can get into a state where it cannot even delete any image, requiring one to take drastic actions up to and including reformatting the entire affected BTRFS root file system.

According to the official Docker documentation:

btrfs requires a dedicated block storage device such as a physical disk. This block device must be formatted for Btrfs and mounted into /var/lib/docker/.

In my experience, you will still run into issues even if you use a dedicated partition. No, it seems it requires a standalone

@squidpickles
squidpickles / README.md
Last active January 31, 2024 12:48
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.

Steps

Follow the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for setting up the master node. I've been using Weave Net as the network plugin; it see

@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@Wilfred
Wilfred / dyn_prop.py
Last active November 22, 2023 16:01
dynamically defined properties in python
def attach_dyn_prop(instance, prop_name, prop_fn):
"""Attach prop_fn to instance with name prop_name.
Assumes that prop_fn takes self as an argument.
Reference: https://stackoverflow.com/a/1355444/509706
"""
class_name = instance.__class__.__name__ + 'Child'
child_class = type(class_name, (instance.__class__,), {prop_name: property(prop_fn)})
@SKempin
SKempin / Git Subtree basics.md
Last active May 16, 2024 20:38
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this: