This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# | |
# Script to patch PLT hooks so that they return 0 instead of looking up the library function | |
# Assumptions: | |
# - Caller expects return value in `rax` | |
# - Callee has no other side effects | |
# | |
# This changes the file in-place, no other runtime work is needed | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
for pkg in $(dnf repoquery -f '/lib/modules/**/*.ko.xz' 2>/dev/null | sort -u); do | |
echo "Package: $pkg" | |
dnf repoquery --list $pkg 2>/dev/null\ | |
| grep '.ko.xz$'\ | |
| cut -d/ -f5-\ | |
| xargs -n1 printf ' - %s\n' | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compare_dictionaries(a, b): | |
def mapper(item): | |
if isinstance(item, list): | |
return frozenset(map(mapper, item)) | |
if isinstance(item, dict): | |
return frozenset({mapper(k): mapper(v) for k, v in item.items()}.items()) | |
return item | |
return mapper(a) == mapper(b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0') | |
ns = {'pom': 'http://maven.apache.org/POM/4.0.0'} | |
root = ET.fromstring(open('pom.xml').read()) | |
def text(elem): | |
return next(elem.itertext()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"node": "rabbit@a29cd7b1cd71", | |
"payload": { | |
"reply_to": { | |
"routing_key": "301efcc7-008f-3df4-b814-2b01741265d6", | |
"exchange": "reply.celery.pidbox" | |
}, | |
"ticket": "0a5d46b3-9d5a-408f-8057-508035af5bd3", | |
"destination": null, | |
"method": "hello", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from json import loads, dumps | |
from sys import argv | |
from base64 import b64decode | |
with open(argv[1], 'r') as f: | |
for line in f.readlines(): | |
if line.strip(): | |
data = loads(line) | |
decoded = b64decode(data['payload']) | |
data['payload'] = loads(decoded) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ticket": "0a5d46b3-9d5a-408f-8057-508035af5bd3", | |
"destination": null, | |
"reply_to": { | |
"routing_key": "301efcc7-008f-3df4-b814-2b01741265d6", | |
"exchange": "reply.celery.pidbox" | |
}, | |
"method": "hello", | |
"arguments": { | |
"revoked": {}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
Dim = 4 | |
for i in range(Dim): | |
for j in range(Dim): | |
p = 'm->data[{0} + ({1} * {2})] = '.format(i, j, Dim) | |
for k in range(Dim): | |
numlpad = 23 if k > 0 else 0 | |
p += (numlpad * ' ') + 'a->data[{0} + ({2} * {3})] * b->data[{2} + ({1} * {3})] + \n'.format(i, j, k, Dim) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ readelf -h nvidia-installer | |
ELF Header: | |
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 | |
Class: ELF64 | |
Data: 2's complement, little endian | |
Version: 1 (current) | |
OS/ABI: UNIX - System V | |
ABI Version: 0 | |
Type: EXEC (Executable file) | |
Machine: Advanced Micro Devices X86-64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Target directory: NVIDIA-Linux-x86_64-355.11 | |
-rw-r--r-- buildmeister/gopher 6041 2015-08-27 01:06 ./nvidia-application-profiles-355.11-key-documentation | |
-rw-r--r-- buildmeister/gopher 72949 2012-12-13 00:04 ./gl.h | |
-rw-r--r-- buildmeister/gopher 8432 2015-08-27 02:16 ./nvidia-installer.1.gz | |
-rwxr-xr-x buildmeister/gopher 34280 2015-08-27 01:06 ./nvidia-persistenced | |
-rwxr-xr-x buildmeister/gopher 51168 2015-08-27 02:33 ./libGLESv1_CM.so.355.11 | |
-rw-r--r-- buildmeister/gopher 18264 2015-08-27 02:16 ./nvidia-smi.1.gz | |
-rw-r--r-- buildmeister/gopher 2058 2015-08-27 01:06 ./nvidia-persistenced.1.gz | |
-rwxr-xr-x buildmeister/gopher 14548520 2015-08-27 01:17 ./libcuda.so.355.11 | |
-rwxr-xr-x buildmeister/gopher 11799176 2015-08-27 01:05 ./libglx.so.355.11 |
NewerOlder