Skip to content

Instantly share code, notes, and snippets.

@saidone75
saidone75 / dwm-6.2.patch
Last active April 4, 2020 07:37
Change Mod1 key to the "OS" key, Firefox on tag 4, install locally, no manual
diff -u dwm.orig/config.def.h dwm/config.def.h
--- dwm.orig/config.def.h 2020-04-04 08:58:09.048815996 +0200
+++ dwm/config.def.h 2020-04-04 09:02:40.895221417 +0200
@@ -28,7 +28,8 @@
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ { "Firefox", NULL, NULL, 1 << 3, 0, -1 },
+ { "Launcher", NULL, NULL, 1 << 3, 1, -1 },
diff -u dwm.orig/config.def.h dwm/config.def.h
--- dwm.orig/config.def.h 2020-04-04 09:24:38.222114727 +0200
+++ dwm/config.def.h 2020-04-04 09:24:48.593943166 +0200
@@ -12,10 +12,17 @@
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
+static const char col_black[] = "#000000";
+static const char col_red[] = "#ff0000";
+static const char col_yellow[] = "#ffff00";
@saidone75
saidone75 / st-zenburn-theme-0.8.2.patch
Created September 16, 2019 07:43
Zenburn theme for st
diff --git a/config.def.h b/config.def.h
index 0e01717..3073020 100644
--- a/config.def.h
+++ b/config.def.h
@@ -85,40 +85,40 @@ unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
- "black",
- "red3",
@saidone75
saidone75 / st-0.8.2.patch
Created September 16, 2019 07:45
Install locally, strip, no manual
diff --git a/Makefile b/Makefile
index 470ac86..c3de58d 100644
--- a/Makefile
+++ b/Makefile
@@ -42,11 +42,12 @@ dist: clean
install: st
mkdir -p $(DESTDIR)$(PREFIX)/bin
+ strip st
cp -f st $(DESTDIR)$(PREFIX)/bin
@saidone75
saidone75 / creation-time.clj
Created March 4, 2020 16:30
Get file creation time in Clojure using java.nio
(defn creation-time [file]
(.creationTime
(java.nio.file.Files/readAttributes
(.toPath file)
java.nio.file.attribute.BasicFileAttributes
(into-array java.nio.file.LinkOption []))))
@saidone75
saidone75 / install-widevine-chromium.sh
Last active April 10, 2020 05:37
Install latest Widevine DRM plugin on Chromium
#!/bin/bash
if [[ `id -u` -ne 0 ]]; then
echo "Error: you must be root to execute this script!"
exit 1
fi
CHROMIUM_LIB_DIR="/usr/lib/chromium-browser"
TMPDIR="$(mktemp -d -p /tmp -t "tmp.XXXXXXXXXX")"
@saidone75
saidone75 / debian-letsencrypt-x3-fix.sh
Created October 14, 2021 06:17
Debian DST Root CA X3 expiration fix
#!/bin/bash
if [[ `id -u` -ne 0 ]]; then
echo "Error: you must be root to execute this script!"
exit 1
fi
TMPDIR="$(mktemp -d -p /tmp -t "tmp.XXXXXXXXXX")"
cd $TMPDIR
@saidone75
saidone75 / file-attribute.clj
Created March 31, 2022 06:17
Get file attribute in Clojure using java.nio
(:import [java.nio.file Files FileSystems LinkOption])
(defn file-attribute
"Return the value of the specified `attribute` of the file at `file-path`
in the current default file system. The argument `attribute` may be passed
as a keyword or a string, but must be an attribute name understood be
`java.nio.file.Files`."
[file-path attribute]
(Files/getAttribute
(.getPath
@saidone75
saidone75 / uuidv7.clj
Last active June 19, 2024 17:14
UUIDv7 in Clojure
(ns uuidv7
(:require [clojure.string :as str])
(:import (java.security SecureRandom)))
(defn gen-uuid-v7
"Returns an UUIDv7 as a byte seq."
[]
(let [rand-array (byte-array 10)]
(.nextBytes (SecureRandom.) rand-array)
(concat
@saidone75
saidone75 / alfresco-audit-entries-by-user-name.sql
Created July 2, 2024 12:10
Alfresco audit entries by user name
SELECT
COUNT(*) AS entry_count,
s.string_value AS user_name
FROM
alf_audit_entry a
JOIN
alf_prop_value p ON a.audit_user_id = p.id
JOIN
alf_prop_string_value s ON p.long_value = s.id
GROUP BY