Skip to content

Instantly share code, notes, and snippets.

View doytsujin's full-sized avatar
🎯
Private Account

Alexander Chernov doytsujin

🎯
Private Account
  • @doytsujin.com
  • Toronto, Canada
  • 23:54 (UTC -04:00)
View GitHub Profile
@doytsujin
doytsujin / DWM-ON-OS-X.md
Created March 21, 2024 17:25 — forked from vangberg/DWM-ON-OS-X.md
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

@doytsujin
doytsujin / ssh_key.tf
Created March 13, 2024 19:11 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@doytsujin
doytsujin / README.md
Created March 13, 2024 19:11 — forked from GusAntoniassi/README.md
Terraform external data provider - Shell script with input without jq

This is an example workaround for getting Terraform input variables when you won't have jq available in the executing machine.

Uses sed to parse the input JSON to extract a certain key from the input JSON.

Warning: this hasn't really been well-tested, it will pretty much work only with string values and will likely break for strings that have quotes. Might give you an idea of how to improve it for your implementation though.

Basic
======
[Shift]+[Mod]+[Enter] - launch terminal.
[Mod]+[b] - show/hide bar.
[Mod]+[p] - dmenu for running programs like the x-www-browser.
[Mod]+[Enter] - toggles windows between master and stack.
[Shift]+[Mod]+[2] - to move window to the 2 tag.
@doytsujin
doytsujin / 00-usb-keyboard.rules
Created June 5, 2023 19:55 — forked from PofMagicfingers/00-usb-keyboard.rules
Keyboard layout auto change with udev
ATTRS{idVendor}=="060b", ATTRS{idProduct}=="5252", OWNER="pof"
ACTION=="add", RUN+="/usr/local/bin/usb-keyboard-udev in"
ACTION=="remove", RUN+="/usr/local/bin/usb-keyboard-udev out"
@doytsujin
doytsujin / whisper-audio-to-text.py
Created January 27, 2023 02:42 — forked from rasbt/whisper-audio-to-text.py
Transcribes audio files using OpenAI Whisper
# Setup:
# conda create -n whisper python=3.9
# conda activate whisper
# https://github.com/openai/whisper
# pip install git+https://github.com/openai/whisper.git
# Usage:
# python whisper-audio-to-text.py --audio_dir my_files --out_dir texts
import argparse
@doytsujin
doytsujin / Twelve_Go_Best_Practices.md
Created December 23, 2022 00:54 — forked from pzurek/Twelve_Go_Best_Practices.md
Twelve Go Best Practices
@doytsujin
doytsujin / cli commands.txt
Created November 11, 2022 05:30
rust cli
rustup check # Check for updates to Rust toolchains and rustup
rustup component list # List installed and available components of the current Rust toolchain
rustup install stable
rustup default beta
rustup update # updating to the latest version
rustup toolchain list # list installed toolchains
rustup toolchain install stable-gnu # to install the GNU ABI (application binary interface)
cargo new [OPTIONS] <path>
# create a new Cargo package in the given directory;
@doytsujin
doytsujin / Proxy.scala
Created November 3, 2022 00:36 — forked from mikalv/Proxy.scala
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {
@doytsujin
doytsujin / Proxy.scala
Created November 3, 2022 00:35 — forked from rklaehn/Proxy.scala
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {