Skip to content

Instantly share code, notes, and snippets.

View christian-korneck's full-sized avatar
💭
I may be slow to respond.

Christian Korneck christian-korneck

💭
I may be slow to respond.
View GitHub Profile
@christian-korneck
christian-korneck / Dockerfile
Created January 9, 2021 12:03
build/install archlinux AUR package in a container
FROM archlinux
RUN pacman -Sy --noconfirm git go base-devel docker
# makepkg needs to run under an unprived user and sudo out
RUN useradd -m -G wheel -s /bin/sh worker
RUN echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/tempbuild
USER worker
RUN cd $HOME && git clone https://aur.archlinux.org/docker-pushrm.git
RUN cd $HOME/docker-pushrm && makepkg -si --noconfirm
USER root
RUN rm /etc/sudoers.d/tempbuild
@christian-korneck
christian-korneck / README.md
Last active February 3, 2021 12:23
meetup notes

commands from my meetup session Jan 2021

uptime #load avg
dmesg -T | tail #kernel msgs
vmstat -Sm 1 #mem in MB
vmstat -Sm 1 -d 1 #disk in MB
mpstat -P ALL 1 #cpus
pidstat -t 1 #procs with threads
iostat -xy 1 #disk queue length, etc
@christian-korneck
christian-korneck / gist:e9fb8cbe0796db6653223bb060cb55d1
Created February 16, 2021 19:19
openssh private key to rsa private key
```
pushd $HOME/.ssh
cp -p id_rsa id_rsa.pem
ssh-keygen -p -N "" -m pem -f id_rsa.pem #replaces file
popd
```
@christian-korneck
christian-korneck / gist:aa632ad1c9880c402be496c640cd1562
Created February 18, 2021 10:33
golang - dummy heap allocation to prevent GC below target
```
// Create a large heap allocation of 10 GiB
// to prevent garbage collection gets
// triggered before the amount of heap
// allocation is reached
ballast := make([]byte, 10<<30)
```
```
sleep() {
if [[ $@ == "infinity" ]]; then
while true
do
/bin/sleep 1
done
else
/bin/sleep "$@"
fi
@christian-korneck
christian-korneck / note.md
Last active March 17, 2021 10:35
darwin sudo auth with fingerprint scanner
```
package_repository_manager.clear_caches()
```
<?xml version="1.0" encoding="utf-8"?>
<ADLMCUSTOMENV VERSION="1.0.0.0">
<PLATFORM OS="Windows">
<KEY ID="ADLM_COMMON_BIN_LOCATION">
<!--Path to the AdLM shared executables-->
<STRING><path to maya netinstall>\adlm\R14\Program Files\Common Files\Autodesk Shared\Adlm\R14</STRING>
</KEY>
<KEY ID="ADLM_COMMON_LIB_LOCATION">
<!--Path to the AdLM shared libraries-->
<STRING><path to maya netinstall>\adlm\R14\Program Files\Common Files\Autodesk Shared\Adlm\R14</STRING>
@christian-korneck
christian-korneck / qemu.md
Created May 14, 2021 12:38
qemu macOS big sur - hv_error - killed: 9 - codesigning - hypervisor entitlements
  • e.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.hypervisor</key>
    <true/>
</dict>
@christian-korneck
christian-korneck / motd
Created May 16, 2021 22:15
/etc/motd Macintosh (1984)
┌───┬──┐ , _ _
│ ╷╭╯╷ │ /| | | | | |
│ └╮ │ |___| _ | | | | __
│ ╰─┼╯ │ | |\ |/ |/ |/ / \_
└───┴──┘ | |/ |__/ |__/ |__/ \__/