Skip to content

Instantly share code, notes, and snippets.

View thrix's full-sized avatar

Miroslav Vadkerti thrix

View GitHub Profile
@thrix
thrix / gist:e38a80a2f1c6321b2d6a68fb6cdb3a3e
Created March 27, 2024 13:05
Python debugging with GDB on Fedora
From https://github.com/teemtee/tmt/issues/2501
I can reproduce the issue with https://github.com/teemtee/tmt/issues/2501#issuecomment-1954532963 reproducer.
```
[root@e67b66cee0cb /]# dnf install -y python3-debug
[root@e67b66cee0cb /]# cd
[root@e67b66cee0cb ~]# curl -O https://raw.githubusercontent.com/python/cpython/3.12/Tools/gdb/libpython.py
[root@e67b66cee0cb ~]# export DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/
[root@e67b66cee0cb ~]# gdb -args python3-debug /usr/bin/tmt run prov -h beaker --image rhel-9999
@thrix
thrix / awk_netstat.sh
Created February 10, 2020 10:58 — forked from staaldraad/awk_netstat.sh
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
@thrix
thrix / koji-api
Created March 27, 2019 09:57 — forked from amitsaha/koji-api
Koji API
_listapi()
addExternalRPM(rpminfo, external_repo, strict=True)
description: Import an external RPM
This call is mainly for testing. Normal access will be through
a host call
addExternalRepoToTag(tag_info, repo_info, priority)
description: Add an external repo to a tag
addGroupMember(group, user, strict=True)
description: Add user to group
@thrix
thrix / axios-catch-error.js
Created March 4, 2019 06:47 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
axios.put(this.apiBaseEndpoint + '/' + id, input)
.then((response) => {
// Success
})
.catch((error) => {
// Error
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
// console.log(error.response.data);

Keybase proof

I hereby claim:

  • I am thrix on github.
  • I am thrix (https://keybase.io/thrix) on keybase.
  • I have a public key whose fingerprint is DB92 34C2 FC8E 410E 4EDC 23FA 0917 7EAC 32CC 29B0

To claim this, I am signing this object: