Skip to content

Instantly share code, notes, and snippets.

View janvrany's full-sized avatar

Jan Vraný janvrany

View GitHub Profile
@janvrany
janvrany / systemd_service_hardening.md
Created September 23, 2022 20:59 — forked from ageis/systemd_service_hardening.md
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@janvrany
janvrany / build-image-for-3rd-vm-hackathon.sh
Last active November 22, 2021 11:34
Script to build Pharo image for hacking session at 3rd Smalltalk VM hackathon - https://www.fast.org.ar/events/vm-hackaton
#!/bin/bash
#
# This (bash) script builds a Pharo image from hacking session at
# 2rd International Smalltalk VM Hackathon [1].
#
# Usage:
#
# bash build-image-for-3rd-vm-hackathon.sh <DIRECTORY>
#
# where <DIRECTORY> is path _non-existent_ directory. The script will
@janvrany
janvrany / build_cross_gcc
Last active December 12, 2020 12:42 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@janvrany
janvrany / riscv-linux-config.txt
Created January 11, 2019 12:03
Linux 2.40 kernel config for HiFive Unleashed
CONFIG_SMP=y
# CONFIG_COMPACTION is not set
CONFIG_HZ_100=y
CONFIG_CROSS_COMPILE="riscv64-unknown-linux-gnu-"
CONFIG_DEFAULT_HOSTNAME="ucbvax"
CONFIG_SYSVIPC=y
# CONFIG_CROSS_MEMORY_ATTACH is not set
CONFIG_CGROUPS=y
CONFIG_CGROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
@janvrany
janvrany / gist:3e89b30ebc3cd479de7288108332ad6b
Created August 30, 2016 07:40
Dump of LLVM's in-memory generated ELF (`eu-readelf -w /tmp/m.o`)
jv@sao:~/Projects/gdb/sources1/gdb$ eu-readelf -w /tmp/m.o
DWARF section [ 5] '.debug_str' at offset 0x230:
Offset String
[ 0] "DragonFly/C1"
[ d] "C1CompilerJavaTests.java"
[ 26] "/home/jv/Private/Projects/SmalltalkX/sources/jv1_x64_lin/build/jv/dragonfly/c1/tests/java/src/jv/dragonfly/c1/tests"
eu-readelf: cannot get .debug_loc content: no error
DWARF section [ 7] '.debug_abbrev' at offset 0x2ca: