Skip to content

Instantly share code, notes, and snippets.

@swick
swick / silverblue-devel-utils
Last active May 13, 2024 21:25
silverblue-devel-utils
#!/bin/sh
set -euo pipefail
#set -x
MICRODNF_PACKAGES_F38="https://kojipkgs.fedoraproject.org//packages/microdnf/3.9.0/2.fc38/x86_64/microdnf-3.9.0-2.fc38.x86_64.rpm \
https://kojipkgs.fedoraproject.org//packages/libpeas/1.34.0/3.fc38/x86_64/libpeas-1.34.0-3.fc38.x86_64.rpm \
https://kojipkgs.fedoraproject.org//packages/dnf/4.14.0/2.fc38/noarch/dnf-data-4.14.0-2.fc38.noarch.rpm \
https://kojipkgs.fedoraproject.org//packages/libdnf/0.68.0/2.fc38/x86_64/libdnf-0.68.0-2.fc38.x86_64.rpm"
@mikesmullin
mikesmullin / x86-assembly-notes.md
Last active May 13, 2024 21:23
Notes on x86-64 Assembly and Machine Code

Mike's x86-64 Assembly (ASM) Notes

Assembling Binary Machine Code

Operating Modes:

These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.

Modern operating systems, booted inside Real mode,

@MjHead
MjHead / jet-engine-relations-update.php
Created February 2, 2022 09:27
JetEngine. Relations. Update related items
<?php
/**
* Update related item from form action/notification
*
* @param array $args [description]
* @return [type] [description]
*/
function my_update_related_items( $args = array() ) {
$relation = ! empty( $args['relation'] ) ? $args['relation'] : false;

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@nikoheikkila
nikoheikkila / README.md
Last active May 13, 2024 21:18
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@joseluisq
joseluisq / terminal-git-branch-name.md
Last active May 13, 2024 21:18
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@xqm32
xqm32 / clash-config.yaml
Last active May 13, 2024 21:17
clash config with proxy-providers and rule-providers
##### 使用说明 #####
# 1. 请填写 proxy-providers - subscribe - url 为订阅链接
# 2. 下载 https://github.com/Loyalsoldier/clash-rules/archive/refs/heads/release.zip 并解压至 ./profiles/ruleset 文件夹下
# 3. 若需要自动更新 ruleset, 请编辑 rule-providers-config - type 为 http
##### 参考链接 #####
# 1. clash 样例配置文件
# https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file
# 2. clash 规则集
# https://github.com/Loyalsoldier/clash-rules
@pedrogomes29
pedrogomes29 / hadoop-cluster-setup-guide.md
Last active May 13, 2024 21:11
Building a Pseudo-Distributed Hadoop Cluster with HBase, HDFS, YARN and embedded Zookeeper using Docker: A Step-by-Step Guide

Building a Pseudo-Distributed Hadoop Cluster with HBase, HDFS, YARN and embedded Zookeeper using Docker: A Step-by-Step Guide

Introduction

In a recent project, I had to set up a pseudo-distributed Hadoop cluster with HBase, HDFS, YARN and embedded Zookeeper using Docker. This guide aims to simplify the process of setting such a cluster, providing clear instructions and practical insights.

Within the repository, you'll discover not only the setup of the Hadoop ecosystem but also it's integration with a Java service, named hbase-client, which uses both the HBase and the MapReduce Java APIs to interact with the Hadoop Cluster. Additionally, search through the backend folder to explore a Python service, which uses Happybase, enabling indirect interaction with HBase via Thrift.

In the course of this project, I encountered the challenge of lacking an official Docker image for HBase. Over a day was dedicated to crafting a custom Dockerfile, ensuring the seamless

@nunofgs
nunofgs / README.md
Last active May 13, 2024 21:08
Use any RTSP camera with Prusa Connect

I use a cheap Tapo C100 webcam to monitor my 3D prints. It supports RTSP.

Screenshot 2023-07-17 at 23 26 34

Instructions

  1. Go to the Cameras section at https://connect.prusa3d.com
  2. Add a new camera.
  3. Click the QR code link
  4. Click "Start Camera"
@standinga
standinga / AudioPlayground.swift
Last active May 13, 2024 21:01
Swift Playground shows how to play multiple wav files on top of background audio file, using AVAudioPlayerNode, AVAudioMixerNode, AVAudioEngine
import AVFoundation
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class AudioPlayer {
var backgroundAudioFile:AVAudioFile
var topAudioFiles: [AVAudioFile] = []