Skip to content

Instantly share code, notes, and snippets.

@2bits
2bits / gist:8c130db703854281f808fbc5be77efe5
Created August 24, 2019 06:58
SortMyQPKGs on a QNAP TS-451+ with QVPN: default gateway not assigned
TS-451+ and QTS-4.3.6.1040 with QVPN acting as a client to my ISP's VPN server.
Below is the output of SortMyQPKGs the first couple of times I tried it.
It always seems to get in the way of my default gateway being chosen
automatically by the NAS.
──────────────────────────────────────────────
SortMyQPKGs (20190417)
[Fri Aug 23 01:13:44 PDT 2019] 'fix' requested
ALPHA=custom, OMEGA=default
@2bits
2bits / gsocket.c.diff
Created November 20, 2012 01:22
glib-2.34.2 patch fixes build errors on OSX in gio/gsocket.c
--- a/gio/gsocket.c 2012-11-09 19:27:29.000000000 -0800
+++ b/gio/gsocket.c 2012-11-19 17:20:18.000000000 -0800
@@ -2383,6 +2383,9 @@
{
#ifndef G_OS_WIN32
gulong avail = 0;
+#ifdef __APPLE__
+ gsize avail_len = sizeof (avail);
+#endif
#else
@2bits
2bits / gfortran472.txt
Created November 18, 2012 22:07
Same conftest, but now built using gfortran-4.7.2
Driving: /usr/local/bin/gfortran -mmacosx-version-min=10.6.8 -v -o conftest -O conftest.f -Wl,-framework -Wl,Accelerate -lm -l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gfortran/4.7.2/gfortran/libexec/gcc/x86_64-apple-darwin10.8.0/4.7.2/lto-wrapper
Target: x86_64-apple-darwin10.8.0
Configured with: ../configure --enable-languages=fortran --prefix=/usr/local/Cellar/gfortran/4.7.2/gfortran --datarootdir=/usr/local/Cellar/gfortran/4.7.2/share --bindir=/usr/local/Cellar/gfortran/4.7.2/bin --with-system-zlib --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --enable-checking=release --disable-stage1-checking --disable-build-poststage1-with-cxx --disable-libstdcxx-pc --disable-nls
Thread model: posix
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.6.8' '-v' '-o' 'conftest' '-O' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gfortran/4.7.2/gfortran/libexec/gcc/x86_64-ap
@2bits
2bits / gfortran.txt
Created November 18, 2012 21:37
Output from gfortran-4.2.1 on OSX 10.6.8: `/usr/local/bin/gfortran -v -o conftest -O conftest.f -Wl,-framework -Wl,Accelerate -lm`
Driving: /usr/local/bin/../Cellar/gfortran/4.2.4-5664/bin/i686-apple-darwin10-gfortran-4.2.1 -mmacosx-version-min=10.6.8 -v -O conftest.f -Wl,-framework -Wl,Accelerate -lm -m64 -o conftest -lgfortranbegin -lgfortran -shared-libgcc
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /Builds/apple/gcc-5664/build/obj/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++,fortran --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
/usr/local/Cellar/gfortran/4.2.4-5664/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/f951 conftest.f -ffixed-form -fPIC -quiet -dumpbase conftest.f -mmacosx-version-min=10.6.8 -m64 -mtune=core2 -auxbase conftest -O -version -I /usr/local/Cellar/gfortran/4.2.4-5664/bin/../lib/gcc/
@2bits
2bits / conftest.f
Created November 17, 2012 03:47
An octave blas conftest.f that fails on OSX 10.6 but succeeds on 10.8
program main
logical lsame,w
external lsame
character c1,c2
c1 = 'A'
c2 = 'B'
w = lsame(c1,c2)
if (w) stop 1
w = lsame(c1,c1)
@2bits
2bits / mpg321-0.3.2.diff
Created November 16, 2012 05:18
mpg321-0.3.2 diff fixes building on OSX.
--- a/mpg321.h 2012-03-25 05:27:49.000000000 -0700
+++ b/mpg321.h 2012-11-15 20:54:28.000000000 -0800
@@ -290,7 +290,7 @@
/* Shared total decoded frames */
decoded_frames *Decoded_Frames;
-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__APPLE__)
/* */
#else
@2bits
2bits / install.log
Created November 6, 2012 06:43
mpd-0.17.2 - crash on stop after playing iTunes m4a on OSX - install log
./configure --enable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/mpd/0.17.2 --enable-bzip2 --enable-flac --enable-shout --enable-fluidsynth --enable-zzip --enable-lame-encoder --enable-audiofile --enable-test --disable-libwrap
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
HOMEBREW_VERSION: 0.9.3
HEAD: c9d7abbf062651ce0161b5b9938d854787c357c0
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit nehalem
OS X: 10.8.2-x86_64
Xcode: 4.5.2
CLT: 4.5.0.0.1.1249367152
LLVM-GCC: build 2336
Clang: 4.1 build 421
@2bits
2bits / deps.txt
Created November 6, 2012 06:37
mpd-0.17.2 - current list of deps Homebrew loads.
audiofile 0.3.4
cmake 2.8.9
faad2 2.7
flac 1.2.1
fluid-synth 1.1.5
gettext 0.18.1.1
glib 2.34.1
lame 3.99.5
libffi 3.0.11
libid3tag 0.15.1b
@2bits
2bits / info_allregisters.txt
Created November 6, 2012 06:34
mpd-0.17.2 - crash on stop after playing iTunes m4a on OSX - info all-registers
(gdb) info all-registers
rax 0x1000007feedfacf 72057628379708111
rbx 0x100000000 4294967296
rcx 0x7f8000 8355840
rdx 0x7c2e00 8138240
rsi 0x100877a00 4303845888
rdi 0x100877a00 4303845888
rbp 0x102980ce0 0x102980ce0
rsp 0x102980cc0 0x102980cc0
r8 0x4 4