Skip to content

Instantly share code, notes, and snippets.

@khenriks
khenriks / zfs_mount.c
Last active June 21, 2023 11:05
Auxiliary mount helper for non-root ZFS mounts
// Compile with:
// cc -DUID=$UID -DUSER=$USER -D_LARGEFILE64_SOURCE -o zfs_mount zfs_mount.c `pkg-config --cflags --libs libzfs`
// then install with:
// sudo cp zfs_mount /usr/local/bin
// sudo setcap cap_sys_admin+ep /usr/local/bin/zfs_mount
#include <libzfs.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
// Userspace ethernet PHY fix for Pine64
// by khenriks@ 2018-03-18
// Free to use and distribute under BSD-2-Clause style license, e.g.
// https://choosealicense.com/licenses/bsd-2-clause/
#include <stdint.h>
#include <string.h>
#include <linux/ethtool.h>
#include <linux/mdio.h>
# Configuration file for abcde CD ripper
#
# After running abcde, further processing with Picard and metaflac is useful
#
# vim: ft=sh
# CD ripping options
CDROMREADERSYNTAX=cdparanoia
CDROM="`drutil status | grep -o '/dev/[^ ]*'`"
CDDBMETHOD=musicbrainz
#include <stdio.h>
#include <omp.h>
#include <pthread.h>
int main() {
omp_lock_t lock;
long x = 0;
omp_init_lock(&lock);
diff --git a/dlls/winemac.drv/cocoa_main.m b/dlls/winemac.drv/cocoa_main.m
index 6682f98..6f48343 100644
--- a/dlls/winemac.drv/cocoa_main.m
+++ b/dlls/winemac.drv/cocoa_main.m
@@ -106,6 +106,9 @@ static void run_cocoa_app(void* info)
*/
int macdrv_start_cocoa_app(unsigned long long tickcount)
{
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
+ TransformProcessType(&psn, kProcessTransformToForegroundApplication);
diff --git a/src/wxterminal/wxt_gui.cpp b/src/wxterminal/wxt_gui.cpp
index b3563b5..94b59d7 100644
--- a/src/wxterminal/wxt_gui.cpp
+++ b/src/wxterminal/wxt_gui.cpp
@@ -237,12 +237,6 @@ IMPLEMENT_APP_NO_MAIN(wxtApp)
bool wxtApp::OnInit()
{
-#ifdef __WXMAC__
- ProcessSerialNumber PSN;
@khenriks
khenriks / mp3fs5.patch
Created February 1, 2012 00:46
Patch to fix mp3fs #5
diff --git a/src/transcode.c b/src/transcode.c
index 13cbf73..bccd7d0 100644
--- a/src/transcode.c
+++ b/src/transcode.c
@@ -499,6 +499,10 @@ trans_fail:
/* Read some bytes into the internal buffer and into the given buffer. */
int transcoder_read(struct transcoder* trans, char* buff, int offset, int len) {
+ /* Client asked for more data than exists. */
+ if (offset > trans->totalsize) {