Skip to content

Instantly share code, notes, and snippets.

View overengineer's full-sized avatar
💾

Alper S. Soylu overengineer

💾
View GitHub Profile
[{"address":"/cnc/info/time/power","value":"{\"type\": \"int\", \"value\": -904953856}, \"quality_code\": \"Good\", \"error_message\": \"\"}"},{"address":"/cnc/info/time/operation","value":"{\"type\": \"int\", \"value\": 617807872}, \"quality_code\": \"Good\", \"error_message\": \"\"}"},{"address":"/cnc/info/time/cutting","value":"{\"type\": \"int\", \"value\": 1048903680}, \"quality_code\": \"Good\", \"error_message\": \"\"}"},{"address":"/cnc/info/time/cycle","value":"{\"type\": \"int\", \"value\": 0}, \"quality_code\": \"Good\", \"error_message\": \"\"}"},{"address":"/cnc/info/name/spindle/relative","value":"{\"type\": \"array\", \"value\": [{\"type\": \"string\", \"value\": \"S1\"}]}, \"quality_code\": \"Good\", \"error_message\": \"\"}"},{"address":"/cnc/info/name/spindle/absolute","value":"{\"type\": \"array\", \"value\": [{\"type\": \"string\", \"value\": \"S1\"}]}, \"quality_code\": \"Good\", \"error_message\": \"\"}"},{"address":"/cnc/info/name/axis/relative","value":"{\"type\": \"array\", \"value\":
@overengineer
overengineer / bluetooth.sh
Created February 22, 2023 20:51
Connect to bluetooth device
#!/bin/bash
NAME=$1
DEVICE=$(bluetoothctl devices | grep $NAME | awk '{print $2}')
stdbuf -oL -eL bluetoothctl connect $DEVICE 2>&1 \
| tr -dc '[[:print:]]' \
| xargs -I{} ~/scripts/notify-send.sh -t 1000 -f $NAME "{}"
success=$?
@overengineer
overengineer / matebook-fix.sh
Last active January 8, 2023 01:22
matebook d15 audio dummy output fix
sudo mv /lib/firmware/intel/sof* sof-backup
wget https://github.com/thesofproject/sof-bin/releases/download/v2.2.4/sof-bin-v2.2.4.tar.gz
tar -xvf sof-bin-v2.2.4.tar.gz
cd sof-bin-v2.2.4
sudo ./install.sh v2.2.4
sudo reboot
# now speaker is visible but still no sound
# tried boot options here, brings back to dummy audio:
@overengineer
overengineer / chatgpt.md
Last active January 6, 2023 15:20
ChatGPT fun

Generate some ancient sacred text curse in style of Long-Term Nuclear Waste Warning Messages Here is a sample ancient sacred text curse in the style of a long-term nuclear waste warning message:

"Beware, ye who disturb the sacred ground. For within this tomb lies a poison unlike any other, a curse that will endure for time immemorial. Its wickedness shall seep into the earth, polluting all that it touches. Its wrath will be felt by those who dare to defile the sacred, and the curse shall be passed down through the ages, to haunt their descendants for generations to come.

"Let this be a warning to all who come after us. Do not disturb the dead or the cursed relics that lie within. Turn away and leave this place, lest you suffer the fate of those who have gone before you. The spirits of the ancients shall rise up to defend their resting place, and woe betide those who dare to cross them.

"Heed this warning, and keep far away. The curse of the ancients shall be upon you, should you dare to defy their will.

@overengineer
overengineer / git_branches.sh
Created December 25, 2022 09:27
Git Branches
#!/bin/bash
set -euo pipefail
MSYS_NO_PATHCONV=0
git clean -ffd
git reset --hard 2>/dev/null 1>/dev/null
git checkout dev
# git fsck && git prune && git gc
@overengineer
overengineer / base.py
Last active November 26, 2021 12:37
Flexible Python Dataclass Base using Munch
from munch import Munch
# Validates annotations
# Adding extra fields is allowed
#
# class Foo(Base):
# a: str
# b: int
#
# foo = Foo(a="hello", b=42, c=True) # This is OK!
@overengineer
overengineer / windows.py
Last active April 6, 2022 09:57
Python Fabric Connection Class for Windows
from fabric import Connection
from scp import SCPClient
import paramiko
# Wraps commands in bash.exe calls
# Also fixes scp problem
class WindowsConnection(Connection):
_default_bash_path = "C:/Program Files/Git/bin/bash.exe"
def resolve_connect_kwargs(self, connect_kwargs):
@overengineer
overengineer / clone_all.sh
Created October 12, 2021 18:38
Clone All My Public Repos
curl -s "https://api.github.com/users/overengineer/repos?per_page=1000" | jq -r '.[] | [ .html_url, .full_name ] | @sh' | xargs -n 2 git clone
@overengineer
overengineer / git-json.sh
Last active July 20, 2022 14:34
git log json format
#!/usr/bin/env bash
# Caution: It can break
# Bash unofficial strict mode
set -euo pipefail
IFS=$'\n\t'
LANG=''
function define() { IFS='\n' read -r -d '' ${1} || true; }
@overengineer
overengineer / contrib.sh
Last active November 10, 2022 15:31
git contributor stats
#!/bin/bash
set -euo pipefail
MSYS_NO_PATHCONV=0
COL=9
if [[ $# -eq 1 ]]; then
COL=$1
fi