Skip to content

Instantly share code, notes, and snippets.

@jsutlovic
jsutlovic / lscolors.py
Created September 14, 2023 15:45
Show lscolors on macOS
#!/usr/bin/env python3
# Script to parse a line of LSCOLORS and outputs examples of parsed line to stdout
#
# Run tests with python3 -m doctest lscolors.py
# From `man ls`:
#
# The color designators are as follows:
# a black
@jsutlovic
jsutlovic / Directory.Build.props
Created January 6, 2019 07:02
Directory configuration for dotnet development in Docker, WSL and Windows
<Project>
<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/obj/**/*</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/bin/**/*</DefaultItemExcludes>
</PropertyGroup>
<PropertyGroup Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'">
<BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/container/</BaseIntermediateOutputPath>
<BaseOutputPath>$(MSBuildProjectDirectory)/bin/container/</BaseOutputPath>
@jsutlovic
jsutlovic / rr264x-linux-src-v1.5-kernel-4.8.patch
Created December 23, 2018 07:06
Full RocketRaid 26xx v1.5 Driver Patch for 4.x kernels
diff --git a/inc/linux/Makefile.def b/inc/linux/Makefile.def
index f6f5087..862fa63 100755
--- a/inc/linux/Makefile.def
+++ b/inc/linux/Makefile.def
@@ -74,18 +74,27 @@ ifndef KERNELDIR
KERNELDIR := /lib/modules/$(shell uname -r)/build
endif
-MAJOR := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 65536 % 65536)
-MINOR := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
@jsutlovic
jsutlovic / serve.go
Created March 10, 2017 14:51
HTTP File Server in Golang
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func getenvWithDefault(key, fallback string) string {
@jsutlovic
jsutlovic / tmux.conf
Last active August 29, 2015 14:13
tmux config
# Use something easier to type as the prefix.
set -g prefix C-f
unbind C-b
bind C-f send-prefix
# Less stretching to get to the first item.
set -g base-index 1
setw -g pane-base-index 1
# Reload the config.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
@jsutlovic
jsutlovic / print_hex.asm
Created October 7, 2014 03:52
Assembly print hex
[org 0x7c00]
mov dx, 0x1fb7 ; Set the value we want to print to dx
call print_hex ; Print the hex value
jmp $ ; Hang once we're done
%include "print_string.asm"
; Prints the value of DX as hex.
print_hex:
mov bx, 40 ; Assign a value to bx
cmp bx, 4
jl then_block
cmp bx, 40
jl else_if_block
mov al, 'C'
jmp done_block
then_block:
@jsutlovic
jsutlovic / .tmux.conf
Created July 25, 2014 19:31
My tmux config
# Use something easier to type as the prefix.
set -g prefix C-f
unbind C-b
bind C-f send-prefix
# Less stretching to get to the first item.
set -g base-index 1
setw -g pane-base-index 1
# Reload the config.
@jsutlovic
jsutlovic / gotour38.go
Created July 13, 2014 01:38
Go Tour #38
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
p := make([][]uint8, dy)
for y := range p {
p[y] = make([]uint8, dx)
for x := range p[y] {
p[y][x] = uint8((y ^ x))