Skip to content

Instantly share code, notes, and snippets.

@valgur
valgur / find_dynamic_deps.py
Created July 2, 2024 07:26
Find all dynamic libraries needed by ELF or MachO executables recursively
#!/usr/bin/env python3
import fnmatch
import platform
import sys
from pathlib import Path
from pprint import pprint
from elftools.elf.dynamic import DynamicSection
from elftools.elf.elffile import ELFFile
from macholib.MachO import MachO
@valgur
valgur / merged_deploy.py
Last active June 28, 2024 17:06
Conan deployer to merge all host dependencies
# License: public domain / CC0-1.0
import os
import shutil
from conan.api.output import ConanOutput
from conans.errors import ConanException
from conans.util.files import rmdir, mkdir
@valgur
valgur / shared_deploy.py
Last active June 28, 2024 17:06
Conan deployer for shared host libraries
# License: public domain / CC0-1.0
import glob
import os
import shutil
from conan.api.output import ConanOutput
from conans.util.files import mkdir
# Conan automatically generated toolchain file
# DO NOT EDIT MANUALLY, it will be overwritten
# Avoid including toolchain file several times (bad if appending to variables like
# CMAKE_CXX_FLAGS. See https://github.com/android/ndk/issues/323
include_guard()
message(STATUS "Using Conan toolchain: ${CMAKE_CURRENT_LIST_FILE}")
@valgur
valgur / top_debian_cci.list
Last active April 7, 2024 12:19
Top-1000 most installed Debian dev packages not yet on ConanCenter.
libtirpc 99143 2603 86595 9914 31 (Josue Ortega)
libnsl 98878 2190 87659 8996 33 (Gnu Libc Maintainers)
libfl 14990 581 13622 776 11 (Manoj Srivastava)
libgraphite2 14706 1203 11795 1701 7 (Debian Libreoffice Maintainers)
libuv1 13361 1132 6626 5598 5 (Dominique Dumont)
libthai 11397 1024 8790 1579 4 (Theppitak Karoonboonyanan)
libp11-kit 9683 566 7933 1177 7 (Debian Gnutls Maintainers)
comerr 8674 1059 6980 630 5 (Theodore Y. Ts'o)
liblapack 8549 220 3163 194 4972 (Debian Science Team)
libcoarrays 8194 292 5629 592 1681 (Alastair Mckinstry)
@valgur
valgur / libpcap_build_full.log
Created April 5, 2024 14:11
conan create . --version 1.10.4 -pr cci-gcc -o '&:enable_dbus=True' -o '&:enable_libnl=True' -o '&:enable_libusb=True' -o '&:enable_rdma=True'
======== Exporting recipe to the cache ========
libpcap/1.10.4: Exporting package recipe: /home/martin/projects/conan-center-index/recipes/libpcap/all/conanfile.py
libpcap/1.10.4: exports: File 'conandata.yml' found. Exporting it...
libpcap/1.10.4: Copied 1 '.py' file: conanfile.py
libpcap/1.10.4: Copied 1 '.yml' file: conandata.yml
libpcap/1.10.4: Exported to cache folder: /home/martin/.conan2/p/libpc0a4ec7317b9ee/e
libpcap/1.10.4: Exported: libpcap/1.10.4#42a40b11ed2614a451e738a17997935a (2024-04-05 14:08:57 UTC)
======== Input profiles ========
@valgur
valgur / decode_proprietary_dicom_lzw.py
Last active February 24, 2024 20:33
Decode an LZW-compressed ViewStation DICOM image section
"""
The code below is part of pdfminer (http://pypi.python.org/pypi/pdfminer/)
Copyright (c) 2004-2010 Yusuke Shinyama <yusuke at cs dot nyu dot edu>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHET
diff --git a/config/config.h.in b/config/config.h.in
--- a/config/config.h.in (revision 31b4f606f38075727472f6946bd981bb6c6b8647)
+++ b/config/config.h.in (revision 9582f6d7676eaacd956c581b6e5b6f86863fc918)
@@ -15,12 +15,12 @@
/* Define if you have CAIRO library */
#undef CAIRO_DELEGATE
+/* Channel mask depth */
+#undef CHANNEL_MASK_DEPTH
+
# For debugging any ./configure linker errors
replace_in_file(self, os.path.join(self.source_folder, "configure"),
"ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'",
"ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS -Bd | tee -a link.log >&5'")
@valgur
valgur / fetch-libc-lib-files.py
Created October 8, 2023 16:43
Downloads and extracts all .deb files of libc6-dev and its dependencies for given Ubuntu release
import re
import subprocess
import sys
import tempfile
from pathlib import Path
import requests
def get_package_info(package_name, ubuntu_version, arch):