Skip to content

Instantly share code, notes, and snippets.

@lihop
lihop / default.nix
Created August 16, 2022 12:37
Godot v3.4.4.stable.mono nixpkgs overlay
self: super: {
godot-mono-fhs = with super;
let
arch = "64";
version = "3.4.4";
releaseName = "stable";
subdir = "";
pkg = stdenv.mkDerivation {
name = "godot-mono-unwrapped";
buildInputs = [ unzip ];
@lihop
lihop / gist:165c4bd8645cee8c237d43c05fb6588c
Created November 8, 2021 12:09
Blender 2.93 Programmer Dvorak Keymap
keyconfig_version = (2, 93, 20)
keyconfig_data = \
[("3D View",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items":
[("view3d.cursor3d", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
("transform.translate",
{"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True},
{"properties":
[("cursor_transform", True),
@lihop
lihop / fattr
Last active January 23, 2021 07:43
Utility to set and copy xattr data. Used to track attribution data for works publshed under Creative Commons licenses.
#!/bin/bash
IFS=$'\n'
set -o noglob
program_name=$(basename $0)
sub_help() {
echo -e "Usage: $program_name <subcommand> [options]\n"
echo "Subcommands:"
diff --git a/src/auditd-config.c b/src/auditd-config.c
index 309063b..ac87857 100644
--- a/src/auditd-config.c
+++ b/src/auditd-config.c
@@ -771,8 +771,12 @@ static int dispatch_parser(struct nv_pair *nv, int line,
if ((buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) !=
(S_IRWXU|S_IRGRP|S_IXGRP) &&
(buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) !=
- (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) {
- audit_msg(LOG_ERR, "%s permissions should be 0750 or 0755",
@lihop
lihop / default.nix
Created July 6, 2015 13:02
Trivial nix expression to test shell prompt overriding
with import <nixpkgs> {}; {
test = stdenv.mkDerivation {
name = "test";
shellHook = ''
export PS1="SUCCESS!!! :D "
'';
};
}
@lihop
lihop / install-nix.sh
Last active August 29, 2015 14:23
Script for installing nix 1.9 in home (on another distribution)
#!/bin/bash
# A script for installing the nix package manager in home on another distribution
# The script is designed to be idempotent.
# The script currently uses a couple of ugly hacks to avoid errors with
# the bzlib header and shared object file not being found when compiling nix
# (specifically the bsdiff portion).
# These errors also occur when trying to build nix-1.8
STORE_DIR="$HOME/nix"
@lihop
lihop / Dockerfile
Last active August 29, 2015 14:23
Dockerfile for testing nix 1.9 installation script
FROM ubuntu:14.04
ENV install_script /home/nix/install-nix.sh
RUN apt-get update
RUN apt-get install -y wget \
build-essential \
pkg-config
RUN useradd -ms /bin/bash nix