Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pbhj
pbhj / amd-directx-shader-caching.md
Last active October 16, 2023 21:51
Investigation into shader cache files under the AMD directory in Windows 10

%localappdata%\Local\AMD\DxCache\ files

An investigation

This file is a stream-of-consciousness record [unfinished] of what I did when investigating the question of whether sharing the AMD caches of Windows 10 users, between said users, would produce a saving somehow. It struck me that the files might have been identical on different user accounts as my understanding was that shader cache files are dependent on a combination of the software being run and the GPU. In the case of Steam, shader cache files are downloaded and then compiled locally. It appears that compilation is on the CPU. Reports say that, on Steamdeck, Steam have chosen a unified shader cache folder across different users. On Windows 10, the DirectX cache files for my users amounted to ~5GB each, across 4 users that play a closely matched selection of games; so I wondered if I could save either the compilation time and/or the disk space for any of those files.

Methodology

@pbhj
pbhj / ls-with-LastModifiedDate.ps
Last active October 16, 2023 16:39
One-liner to list a directory in powershell with added attributes, like an `ls -al` piped to a text file
// https://stackoverflow.com/questions/13126175/get-full-path-of-the-files-in-powershell
// https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date
gci -Recurse | % { $dateTimeString = (Get-Date).ToString("yyyyMMdd-HHmmss"); $outputFileName = "AMD-listing-$dateTimeString.txt"; $_.FullName, $_.CreationTime, $_.LastWriteTime, $_.Attributes | Out-File $outputFileName -Append }
// semi-colon separated
gci -Recurse | % { $dateTimeString = (Get-Date).ToString("yyyyMMdd-HHmmss"); $outputFileName = "AMD-listing-$dateTimeString.txt"; "{0};{1};{2};{3}" -f $_.FullName, $_.CreationTime, $_.LastWriteTime, $_.Attributes | Out-File $outputFileName -Append }
Cyan T-bar crosshair
CSGO-psRwD-BpcHQ-7siqM-qr7x3-KPBYN
@pbhj
pbhj / bookmarked-page-archiver.sh
Created June 27, 2017 22:07
bookmarkive shell script
#!/bin/bash
# this is a heavily modified version of "http://www.gwern.net/Archiving URLs"
# it should take the last ~1.1 months worth of bookmarks and make a local archive,
# using wget, of the pages that were bookmarked (or whose bookmark was altered).
# break on errors, see "help set" for info
set -e
# # copy places.sqlite locally
# cp --force $(find ~/.mozilla/ -name "places.sqlite") ./
@pbhj
pbhj / start_pms
Created January 19, 2015 18:38
start_pms from plexmediaserver 0.9.11.7.803-87d0708 install
#!/bin/sh
#change these parameters in /etc/default/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
export PLEX_MEDIA_SERVER_TMPDIR=/tmp
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"
test -f /etc/default/plexmediaserver && . /etc/default/plexmediaserver
In ./convertpage.sh line 99:
if [ -d "$outdir" -a -d "$outdirmd" ]
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
In ./convertpage.sh line 99:
if [ -d "$outdir" && -d "$outdirmd" ]
^-- SC2107: Instead of [ a && b ], use [ a ] && [ b ].
For more information:
https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q...
https://www.shellcheck.net/wiki/SC2107 -- Instead of [ a && b ], use [ a ] ...
There's not much I can see changed from the Charter published Oct 2019 and this one published Feb 2020, broad changes:
-2.11 "violence is banned" has been removed; crikey!
+2.13 added follow good governance as adopted by IOC
+4.13 protection of personal data
+5.6 changes to FIDE flag/seal
c7.14 et sequens - "the Secretariat" is now "FIDE offices"
c8.2 "finalistic" changed to "theological"; weird?
c10.1 e) et sequens - "Audit Commission" becomes "Verification Commission"
-16.1 "j) the Secretariat" removed
@pbhj
pbhj / filter.sh
Created June 27, 2017 22:10
bookmarkive filter script
#!/bin/sh
# take input from stdin and sort, remove duplicates and filter
set -e
cat /dev/stdin | sort | uniq | \
# strip hash endings (will kill twitter)
sed -e "s/#.*//" | \
# remove session id strings
@pbhj
pbhj / digikam.compilation.bash
Created August 4, 2019 14:53
installing digikam 6.1.0 on Kubuntu 18.04.2 (Bionic)
wget http://www.mirrorservice.org/sites/download.kde.org/stable/digikam/6.2.0/digikam-6.2.0.tar.xz
tar xvf ./digikam-6.2.0.tar.xz
cd digikam-6.2.0
# following README.md
export VERBOSE=1
export QTDIR=/usr/lib/qt5
export PATH=$QTDIR/bin:$PATH
# packages for compile and deb management
# without ECM one gets error `Could not find a package configuration file provided by "ECM"`
sudo apt install devscripts checkinstall extra-cmake-modules
@pbhj
pbhj / .mozilla_firefox_$profile_userContent.css
Last active May 17, 2019 10:07
modify date format on stackoverflow and stackexchange sites using userContent.css for Firefox
/*
* Please share improvements here or on StackOverflow and add a link here.
* Please upvote https://meta.stackoverflow.com/questions/288674/custom-date-format/385090#385090 if you agree that
* users should have a choice of date format available.
*
* - see https://developer.mozilla.org/en-US/docs/Web/CSS/@document
* - https://www.regextester.com/ may be useful too, but careful of the double escaping!
* keywords: date format, date display, stackoverflow, stackexchange, css, script
*/