Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kwk's full-sized avatar

Konrad Kleine kwk

View GitHub Profile
@kwk
kwk / Makefile
Last active March 17, 2024 22:54
Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8
.PHONY: using-gcc using-gcc-static using-clang
using-gcc:
g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc
using-gcc-static:
g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static
@kwk
kwk / README.md
Created February 16, 2024 18:16
Testing with tmt without a copr build first

How to run test

I want to run the following very simple test on Fedora's testing farm. Is this possible and if so how?

summary: Very basic tests
discover:
    how: shell
    tests:
 - name: test hello world
@kwk
kwk / CMakeLists.txt
Last active February 14, 2024 08:53
Fix for "undefined reference to dlopen" in CMake projects
project(testlink)
add_executable(testlink main.cpp)
target_link_libraries(testlink)
@kwk
kwk / README.md
Last active December 11, 2023 15:29
Make llvm-snapshot-builder obsolete

The llvm-snapshot-builder is overly complex to maintain in the RPM build process. Here's a script and its output that could be included with %include version.spec.inc in the main llvm.spec file.

The output could look like this:

[INFO] Get the source tarball
[INFO] Source tarball already exists: llvm-project.tar.xz
[INFO] Grab git revision from tarball
[INFO] Extract the llvm/CMakeLists.txt file from the source tarball
[INFO] Parse llvm/CMakeLists.txt for the LLVM version
@kwk
kwk / test.log
Created December 4, 2023 12:11
test.log
Change Dir: '/home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build'
Run Build Command(s): /usr/bin/ninja-build -v -j 64 check-all
[0/10] cd /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/builtins-bins && /usr/bin/cmake --build .
ninja: no work to do.
[1/10] cd /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/builtins-bins && /usr/bin/cmake -E echo_append
[3/10] cd /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes && /usr/bin/cmake -E make_directory /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/CMakeFiles && /usr/bin/cmake -E touch /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/CMakeFiles/builtins-complete && /usr/bin/cmake -E touch /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/builtins-stamps/builtins-done
[3/10] cd /
@kwk
kwk / __init__.py
Last active December 1, 2023 15:04
OMP GDB Problem
# /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/runtimes-bins/openmp/libompd/test/../gdb-plugin/python-module/ompd/__init__.py
import sys
import os.path
import traceback
if __name__ == "__main__":
try:
sys.path.append(os.path.dirname(__file__))
import ompd
@kwk
kwk / README.md
Last active November 29, 2023 16:17
Automate getting Kerberos tickets with kinit using secret-tool

README

I often have to get multiple Kerberos tickets and I do this with kinit kkleine@REDHAT.COM for example. Then I have to enter my password. This is annoying. The script kinit-wrapper helps me use the secret-tool to store passwords in the default keyring on the first run and later pull them out of the keyring.

First run

Here's an example of a first run:

$ kinit-wrapper 
@kwk
kwk / README.md
Created October 1, 2014 13:52
Forgot to sign-off commits?

No problem,

run

git filter-branch --msg-filter "cat - && echo && echo 'Signed-off-by: Your Name <Your.Name@example.com>'" HEAD~2..HEAD

To sign-off the last two commits.

Then force to push them to the remote repo with the -f option:

@kwk
kwk / AMI_1st_try
Created September 5, 2011 08:13
AMI and Queue status with realtime Queues. Hi. I have an asterisk with realtime queues. When I fire an AMI "queuestatus" event for say queue 1650, the AMI returns no info for the queue. When I do "queue show 1650" on the CLI and fire the same AMI event fr
action: queuestatus
queues: 1650
Response: Success
Message: Queue status will follow
Event: QueueStatusComplete
@kwk
kwk / create_arrays_heap.ll
Last active September 1, 2023 09:47
Is create_arrays_heap function ever used?
; ModuleID = '<stdin>'
source_filename = "<stdin>"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @create_arrays_heap(double %beta, ptr nocapture readonly %A, ptr nocapture %B) local_unnamed_addr #0 {
entry:
%beta.s2a = alloca double, align 8
%malloccall = tail call ptr @malloc(i64 2162688)
%malloccall1 = tail call ptr @malloc(i64 432537600000)