Skip to content

Instantly share code, notes, and snippets.

View dkorunic's full-sized avatar
🏋️
↑↑↓↓←→←→BA

Dinko Korunic dkorunic

🏋️
↑↑↓↓←→←→BA
View GitHub Profile
@mirekmal
mirekmal / configuration.yaml
Last active January 24, 2021 16:38 — forked from AdamNaj/about.md
Z Wave Graph for Home Assistant
panel_custom:
- name: zwavegraph2
sidebar_title: Z-Wave Graph
sidebar_icon: mdi:access-point-network
url_path: zwave
@AdamNaj
AdamNaj / about.md
Last active July 13, 2022 19:50
Z Wave Graph for Home Assistant
@oktalz
oktalz / GAMain.java
Last active October 23, 2018 21:22
My graduate college shutdown method when Genetic algorithm program for finding student schedules was shutting down
...
public static class RunWhenShuttingDown extends Thread {
public void run() {
if (perfect.test()) {
co.println("Shutting down...\n\n\n");
co.println("solution is here,\n");
co.println("The end is near,");
co.println("there is no fear,");
try {
#!/bin/bash
modprobe -r ec_sys
modprobe ec_sys write_support=1
on="\x8a"
off="\x0a"
led(){
echo -n -e $1 | dd of="/sys/kernel/debug/ec/ec0/io" bs=1 seek=12 count=1 conv=notrunc 2> /dev/null
@AnthillBeetle
AnthillBeetle / remember_command
Last active March 6, 2017 22:18
Remember first requested command for the SSH key and refuse to run if command changes.
#!/bin/bash
set -euo pipefail
if [[ $# -ne 1 ]] || [[ "$1" == '--help' ]]; then
cat >&2 <<'EOF'
Insert the following before a key in .ssh/authorized_keys:
command=".ssh/remember_command ID",no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc,no-pty
(On newer systems you can replace all these no-* options with single "restrict".)
Put this script into your ~/.ssh/ directory and make it executable.
It will remember the first requested command for the specified ID,
@scottsb
scottsb / resetting-csync2-cluster.md
Last active October 25, 2021 20:28
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@thuandt
thuandt / XenServer-software-RAID1.md
Last active June 4, 2017 08:26
Instructions for switching to RAID 1 for XenServer 6.2 with GPT

Instructions for switching to RAID 1 for XenServer 6.2 with GPT

  • Create new partition for Local Storage
# gdisk /dev/sda
  • Check /dev/sda partition table
@tylerneylon
tylerneylon / learn.lua
Last active April 28, 2024 22:23
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@bcantrill
bcantrill / cornellcs.txt
Created December 13, 2012 18:29
An old e-mail to the Cornell CS faculty; have things changed in the last 12 years?
From bmc Mon Oct 2 15:12:34 2000
Subject: Undergrad systems curriculum
To: faculty@cs.cornell.edu
Date: Mon, 2 Oct 2000 15:12:34 -0700 (PDT)
X-Mailer: ELM [version 2.4ME+ PL31H (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 4065
Status: RO