Skip to content

Instantly share code, notes, and snippets.

View anonymouse64's full-sized avatar
๐ŸŽ
Think Different

Ian Johnson anonymouse64

๐ŸŽ
Think Different
View GitHub Profile
@anonymouse64
anonymouse64 / example.go
Created July 16, 2020 18:42
go-check MockCommand mocking of a fully verifying argument script
func mockRealSystemdMountInBash(c *C, expArgs [][]string) *testutil.MockCmd {
stateCallFile := filepath.Join(c.MkDir(), "systemd-mount-state-call")
template := fmt.Sprintf(`
STATE_FILE=%s
if [ ! -f "$STATE_FILE" ]; then
CALL_NUM=0
else
CALL_NUM=$(cat "$STATE_FILE")
fi
config: {}
networks:
- config:
ipv4.address: auto
ipv6.address: auto
description: ""
name: lxdbr0
type: ""
storage_pools:
- config: {}
@anonymouse64
anonymouse64 / gnome-calculator-file-trace.json
Created November 28, 2019 04:45
JSON of all files accessed by gnome-calculator snap
This file has been truncated, but you can view the full file.
{
"ExecvePaths": {
"AllFiles": [
"/snap/gnome-calculator/current",
"/snap/gnome-calculator/x1",
"/snap/gnome-calculator/x1/data-dir",
"/snap/gnome-calculator/x1/data-dir/icons",
"/snap/gnome-calculator/x1/data-dir/icons/Adwaita",
"/snap/gnome-calculator/x1/data-dir/icons/Adwaita/16x16/devices",
"/snap/gnome-calculator/x1/data-dir/icons/Adwaita/16x16/emblems",
@anonymouse64
anonymouse64 / install.sh
Created November 25, 2019 18:13
Chromium snap install hook to create private, correct /etc/ld.so.cache
#!/bin/bash -ex
# make sure our fake ld.so.cache exists
if [ ! -f "$SNAP_DATA/etc/ld.so.cache" ]; then
echo "snap private ld.so.cache doesn't exist!"
exit 1
fi
# copying the conf dir from real /etc into $SNAP_DATA
mkdir -p "$SNAP_DATA/etc/ld.so.conf.d"
@anonymouse64
anonymouse64 / check-ld-cache-good.sh
Created November 25, 2019 18:12
Script to ensure ld.so.cache is usable and updated
#!/bin/sh -e
# save the original LD_LIBRARY_PATH, and unset it to check the cache
ORIGINAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
LD_LIBRARY_PATH=""
export LD_LIBRARY_PATH
# FINAL_BINARY should be set and exported to what the "real" final executable
# that's run is so we can check that
# an alternative would be to always run the "real" final executable immediately
1:d:chromium:5928:5434:13733
1:nod:chromium:2353:2227:4688
1:d:supertuxkart:3408:2107:20347
1:nod:supertuxkart:2641:1458:5876
1:d:mari0:2642:1842:4023
1:nod:mari0:2203:1527:1389
1:d:gnome-calculator:3504:2353:438
1:nod:gnome-calculator:3415:2326:173
1:d:test-snapd-glxgears:809:625:2374
1:nod:test-snapd-glxgears:805:588:854
/lib64/ld-linux-x86-64.so.2 (0x00007f4665c65000)
libasound.so.2 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f4658b54000)
libatk-1.0.so.0 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f465892e000)
libatk-bridge-2.0.so.0 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007f46586fd000)
libatspi.so.0 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007f4657d56000)
libavahi-client.so.3 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007f4654f33000)
libavahi-common.so.3 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007f4655144000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f464f9f5000)
libbsd.so.0 => /snap/chromium/x1/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f4651e7e000)
libcairo-gobject.so.2 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f4652def000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6c9c8ad000)
libasound.so.2 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f6c8f79c000)
libatk-1.0.so.0 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f6c8f576000)
libatk-bridge-2.0.so.0 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007f6c8f345000)
libatspi.so.0 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007f6c8e99e000)
libavahi-client.so.3 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007f6c8bb7b000)
libavahi-common.so.3 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007f6c8bd8c000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f6c8663d000)
libbsd.so.0 => /snap/chromium/x1/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f6c88ac6000)
libcairo-gobject.so.2 => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f6c89a37000)
linux-vdso.so.1 (0x00007ffcef942000)
libffmpeg.so => /snap/chromium/x1/usr/lib/chromium-browser/./libffmpeg.so (0x00007fb32958c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb329569000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb329548000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fb32953d000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fb329403000)
libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fb3293fe000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fb3293d3000)
libXcomposite.so.1 => /lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007fb3291d0000)
libXcursor.so.1 => /lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007fb3291c5000)
ld-linux.so.2 (ELF) => /lib/i386-linux-gnu/ld-linux.so.2
ld-linux.so.2 (ELF) => /lib/ld-linux.so.2
ld-linux-x86-64.so.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
libacl.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libacl.so.1
libanl.so.1 (libc6, OS ABI: Linux 3.2.0) => /lib/i386-linux-gnu/libanl.so.1
libanl.so.1 (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib/x86_64-linux-gnu/libanl.so.1
libapparmor.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libapparmor.so.1
libappindicator3.so.1 (libc6,x86-64) => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libappindicator3.so.1
libargon2.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libargon2.so.0
libasound.so.2 (libc6,x86-64) => /snap/chromium/x1/usr/lib/x86_64-linux-gnu/libasound.so.2