- Compile the program in gcc with debug symbols enabled (
-g
) - Do NOT strip the binary
- To generate assembly code using gcc use the -S option:
gcc -S hello.c
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 socket | |
import struct | |
import select | |
import sys | |
packet_id = 0 | |
SERVERDATA_AUTH = 3 | |
SERVERDATA_AUTH_RESPONSE = 2 |
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/env python3 | |
import os | |
import sys | |
import json | |
import base64 | |
import tempfile | |
from subprocess import check_output, DEVNULL, run | |
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/env python3 | |
import os | |
import json | |
from subprocess import check_output, CalledProcessError | |
from configparser import ConfigParser | |
def kubectl(command, context=None, output=True): | |
context = f'--context={context}' if context else '' |
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
#!/bin/sh | |
#=================================================================================== | |
# | |
# FILE: dump.sh | |
# USAGE: dump.sh [-i interface] [tcpdump-parameters] | |
# DESCRIPTION: tcpdump on any interface and add the prefix [Interace:xy] in front of the dump data. | |
# OPTIONS: same as tcpdump | |
# REQUIREMENTS: tcpdump, sed, ifconfig, kill, awk, grep, posix regex matching | |
# BUGS: --- | |
# FIXED: - In 1.0 The parameter -w would not work without -i parameter as multiple tcpdumps are started. |
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
# create service-principal | |
az ad sp create-for-rbac --query "{ client_id: appId, client_secret: password, tenant_id: tenant }" | |
cat >~/.azure/credentials <<EOF | |
# az ad sp create-for-rbac --query "{ client_id: appId, client_secret: password, tenant_id: tenant }" | |
[default] | |
# subscription | |
subscription_id= |
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
# ruamel.yaml adds !!omap when using ordered dicts | |
# and there is no switch to avoid such behaviour | |
# Here is a workarond to put all keys in specific order | |
# and instead of following constuctions: | |
# list: | |
# - !!omap | |
# - [key1, value1] | |
# - [key2, value2] | |
# create this one: | |
# list: |
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
# https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ |
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
#!/bin/bash | |
set -x | |
set -e | |
if [[ $(id -u) != 0 ]]; then | |
sudo $(realpath $0) $@ | |
exit | |
fi |
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
#!/bin/sh | |
# usage: tailnew < /var/log/messages | |
awk 'BEGIN{getline l<"/tmp/tailnew"}(NR>l){print;l=NR}END{print l>"/tmp/tailnew"}' |
NewerOlder