Changed the worktree to one directory back (i.e. $HOME) and simplified the setup

This commit is contained in:
2023-06-13 15:53:57 -04:00
parent 0ee1e7666e
commit d19e60cfc3
140 changed files with 59 additions and 168 deletions

21
dotfiles/.editorconfig Normal file
View File

@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles # between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.bat]
end_of_line = crlf
[*.tsv]
indent_style = tab

21
dotfiles/LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Michael Campagnaro
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

32
dotfiles/README.md Normal file
View File

@@ -0,0 +1,32 @@
# dotfiles
Various dotfiles and misc configs. Some of it is customized around my system
setup (like aliases pointing to paths) but you should be able to easily remove
that stuff.
This unpacks files one directory back, which is assumed to be your home
directory. The gitignore ignores all files by default. If you want to add a new
file this you need to add the `-f` flag to the git add command. This setup was
inspired by Gary Bernhardt and https://gist.github.com/meleu/053275b6842646b95491bf1af4a6ca0e
## Installing
```bash
# Go to your home directory.
cd ~
# Clone the repo with the "--no-checkout" option (so we can checkout the files in our home directory)
git clone --no-checkout <repo_url>/dotfiles.git
# Go to the created directory and change the worktree to the home direcory.
cd dotfiles
git config core.worktree '../../'
# Checkout the files. This will overwrite existing dotfiles with the same name.
git reset --hard origin/master
```
If you want to install optional OS specific stuff, like various packages, run the `install` script in this folder.
OS specific configs are in their respective folders.

View File

@@ -0,0 +1,107 @@
@setlocal enableextensions enabledelayedexpansion
@echo off
rem Make sure we're running as admin. Got this garbage from https://stackoverflow.com/a/40388766
if not "%1"=="am_admin" (
powershell -Command "Start-Process -Verb RunAs -FilePath '%0' -ArgumentList 'am_admin'"
exit /b
)
rem USE AT OWN RISK AS IS WITHOUT WARRANTY OF ANY KIND !!!!!
rem NOTE: Defender may see this file as malware, so you will likely need to exclude this before things can be disabled.
rem
rem Modified version of
rem https://raw.githubusercontent.com/mattreecebentley/win10_disable_defender/main/win10_enable_defender.bat
rem https://gist.github.com/xezrunner/a7a42dbc1096a40b0c78f09488fe5a2b
reg query HKLM\SYSTEM\Setup /v DisabledDefenderServices | find "0x1"
if %errorlevel% == 0 goto already_patched
echo.
echo Please note that Defender can only be disabled in Win10 v2004 and upwards if Tamper Protection is disabled.
echo This setting can be found in Window settings (hint: search for 'tamper'). Please do this now and then,
pause
echo.
echo Disabling Windows Defender
rem from: https://pastebin.com/kYCVzZPz
rem Disable Tamper Protection First - on WIn10 vers which allow for this (not from 2004 onwards)
reg add "HKLM\Software\Microsoft\Windows Defender\Features" /v "TamperProtection" /t REG_DWORD /d "0" /f
rem To disable System Guard Runtime Monitor Broker
rem reg add "HKLM\System\CurrentControlSet\Services\SgrmBroker" /v "Start" /t REG_DWORD /d "4" /f
rem To disable Windows Defender Security Center include this
rem reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "4" /f
echo.
echo Disable Real-time protection
reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpEnablePus" /t REG_DWORD /d "0" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableBehaviorMonitoring" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableIOAVProtection" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableOnAccessProtection" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRoutinelyTakingAction" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SpynetReporting" /t REG_DWORD /d "0" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SubmitSamplesConsent" /t REG_DWORD /d "2" /f
echo.
echo Disable Logging
reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "0" /f
reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "0" /f
echo.
echo Disable WD Tasks
schtasks /Change /TN "Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh" /Disable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" /Disable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cleanup" /Disable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" /Disable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Verification" /Disable
echo.
echo Disable WD systray icon
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "SecurityHealth" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /f
echo.
echo Remove WD context menu
reg delete "HKCR\*\shellex\ContextMenuHandlers\EPP" /f
reg delete "HKCR\Directory\shellex\ContextMenuHandlers\EPP" /f
reg delete "HKCR\Drive\shellex\ContextMenuHandlers\EPP" /f
echo.
echo Disable WD services
reg add HKLM\SYSTEM\CurrentControlSet\Services\wscsvc /v "Start" /t REG_DWORD /d "4" /f
reg add "HKLM\System\CurrentControlSet\Services\WdBoot" /v "Start" /t REG_DWORD /d "4" /f
reg add "HKLM\System\CurrentControlSet\Services\wdFilter" /v "Start" /t REG_DWORD /d "4" /f
reg add "HKLM\System\CurrentControlSet\Services\WdNisDrv" /v "Start" /t REG_DWORD /d "4" /f
reg add "HKLM\System\CurrentControlSet\Services\WdNisSvc" /v "Start" /t REG_DWORD /d "4" /f
reg add "HKLM\System\CurrentControlSet\Services\WinDefend" /v "Start" /t REG_DWORD /d "4" /f
echo.
echo Disable Security system tray icon
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Systray" /v "HideSystray" /t REG_DWORD /d "1" /f
echo.
echo Finishing up...
reg add HKLM\SYSTEM\Setup /v DisabledDefenderServices /t REG_DWORD /d 1 /f
echo.
echo Windows Defender has (hopefully) been disabled.
echo You should still be able to scan files going forward. Also, the Antimalware Service Executable should immediately stop using CPU cycles.
echo Please restart your computer to see all changes.
goto eof
:already_patched
echo Defender has already been disabled by this script.
:eof
echo.
pause

View File

@@ -0,0 +1,108 @@
@setlocal enableextensions enabledelayedexpansion
@echo off
rem Make sure we're running as admin. Got this garbage from https://stackoverflow.com/a/40388766
if not "%1"=="am_admin" (
powershell -Command "Start-Process -Verb RunAs -FilePath '%0' -ArgumentList 'am_admin'"
exit /b
)
rem USE AT OWN RISK AS IS WITHOUT WARRANTY OF ANY KIND !!!!!
rem
rem Modified version of
rem https://raw.githubusercontent.com/mattreecebentley/win10_disable_defender/main/win10_enable_defender.bat
rem https://gist.github.com/xezrunner/a7a42dbc1096a40b0c78f09488fe5a2b
rem
rem Resources:
rem https://docs.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=win10-ps
rem https://docs.microsoft.com/en-us/windows/threat-protection/windows-defender-exploit-guard/customize-exploit-protection
rem https://github.com/AndyFul/ConfigureDefender
rem https://github.com/AndyFul/Hard_Configurator
echo.
echo Enabling Windows Defender
reg query HKLM\SYSTEM\Setup /v DisabledDefenderServices | find "0x0"
if %errorlevel% == 0 goto already_patched
reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /t REG_EXPAND_SZ /d "\"%windir%\system32\SecurityHealthSystray.exe\"" /f
echo.
echo Restore WD shell
reg add "HKLM\Software\Classes\*\shellex\ContextMenuHandlers\EPP" /ve /t REG_SZ /d "{09A47860-11B0-4DA5-AFA5-26D86198A780}" /f
reg add "HKLM\Software\Classes\Drive\shellex\ContextMenuHandlers\EPP" /ve /t REG_SZ /d "{09A47860-11B0-4DA5-AFA5-26D86198A780}" /f
reg add "HKLM\Software\Classes\Directory\shellex\ContextMenuHandlers\EPP" /ve /t REG_SZ /d "{09A47860-11B0-4DA5-AFA5-26D86198A780}" /f
echo.
echo Enable WD services
reg add "HKLM\System\CurrentControlSet\Services\BFE" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\MpsSvc" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\SgrmBroker" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\wscsvc" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\WdBoot" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\wdFilter" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\WdNisDrv" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\WdNisSvc" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\WinDefend" /v "Start" /t REG_DWORD /d "2" /f
echo.
echo 1 - Enable Logging
reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "1" /f
reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "1" /f
echo.
echo Enable WD Tasks
schtasks /Change /TN "Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh" /Enable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" /Enable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cleanup" /Enable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" /Enable
schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Verification" /Enable
echo.
echo Setting various preferences
rem CloudExtendedTimeout / 1 - 50 / block a suspicious file for up to 60 seconds (Default is 10)
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpBafsExtendedTimeout" /t REG_DWORD /d "0" /f
rem CloudBlockLevel / 0 - Default / 2 - High / 4 - High+ / 6 - Zero tolerance (block all unknown executables)
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpCloudBlockLevel" /t REG_DWORD /d "0" /f
rem 1 - Potentially Unwanted Application protection (PUP) is enabled, the applications with unwanted behavior will be blocked at download and install-time
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpEnablePus" /t REG_DWORD /d "1" /f
rem Block at First Sight / 0 - Enable / 1 - Disable
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "0" /f
rem Cloud-based Protection / 0 - Disable / 1 - Basic / 2 - Advanced
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SpynetReporting" /t REG_DWORD /d "1" /f
rem Send file samples when further analysis is required / 0 - Always prompt / 1 - Send safe samples automatically / 2 - Never send / 3 - Send all samples automatically
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SubmitSamplesConsent" /t REG_DWORD /d "0" /f
echo.
echo Attempting to enable Tamper Protection. If this fails then you need to do it manually.
reg add "HKLM\Software\Microsoft\Windows Defender\Features" /v "TamperProtection" /t REG_DWORD /d "1" /f
rem To prevent WD using too much CPU, add this file to the exclusion list:
rem C:\Program Files\Windows Defender\MsMpEng.exe
echo.
echo Attempting to exclude MsMpEng.exe to reduce CPU usage
reg add "HKLM\Software\Microsoft\Windows Defender\Exclusions\Paths" /v "C:\Program Files\Windows Defender\MsMpEng.exe" /t REG_DWORD /d "0" /f
echo.
echo Finishing up...
reg add HKLM\SYSTEM\Setup /v DisabledDefenderServices /t REG_DWORD /d 0 /f
echo Windows Defender has (hopefully) been enabled.
echo The Antimalware Service Executable should be active again.
echo Restart your computer to see all changes.
goto eof
:already_patched
echo Defender has already been enabled by this script.
:eof
echo.
pause

View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
error() {
printf "${BOLD}${RED}$1${NORMAL}\n"
}
abort() {
error "\nAborting...\n"
exit 1
}
set -e
bucket="$1"
path="$2"
output_file="$3"
if [[ $bucket == "" || $path == "" || $output_file == "" ]]; then
error "Usage: aws-list-deep-glacier-files <bucket-name> <path-in-bucket> <output-file>"
exit 1
fi
aws s3api list-objects-v2 --bucket $bucket --prefix $path --query "Contents[?StorageClass=='DEEP_ARCHIVE']" --output text | LC_ALL=C awk '{print substr($0, index($0, $2))}' | awk '{NF-=3};3' > "$output_file"

View File

@@ -0,0 +1,69 @@
#!/usr/bin/env bash
#
# Restores all files/folders inside a particular bucket path,
# e.g. aws-restore-deep-glacier-folder mcampagnaro-deep-glacier images restored_images
# will restore all files inside the images folder of the mcampagnaro-deep-glacier bucket, saving
# temp restoration data in the local "restored_images" directory.
#
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
error() {
printf "${BOLD}${RED}$1${NORMAL}\n"
}
abort() {
error "\nAborting...\n"
exit 1
}
set -e
bucket="$1"
path="$2"
temp_dir="$3"
number_of_objects_per_file=100
days_available=7
restore_tier="Bulk" # Can also be "Standard"
if [[ $bucket == "" || $path == "" || $temp_dir == "" ]]; then
error "Usage: aws-restore-deep-glacier-folder <bucket-name> <path-in-bucket> <local-temp-dir>"
exit 1
fi
printf "${BOLD}Restoring ${GREEN}$bucket:$path${NORMAL}${BOLD} with local temp folder ${GREEN}$temp_dir${NORMAL}\n"
mkdir -p "$temp_dir"
pushd "$temp_dir" &>/dev/null
aws s3api list-objects-v2 --bucket $bucket --prefix $path --query "Contents[?StorageClass=='DEEP_ARCHIVE']" --output text | LC_ALL=C awk '{print substr($0, index($0, $2))}' | awk '{NF-=3};3' > all_objects_list.txt
# Generate the main script that will kick off the restoration.
printf "while read x; do\n printf \"aws s3api restore-object --restore-request '{\\\\\"Days\\\\\":$days_available,\\\\\"GlacierJobParameters\\\\\":{\\\\\"Tier\\\\\":\\\\\"$restore_tier\\\\\"}}' --bucket $bucket --key \\\\\"\$x\\\\\"\\\\n\"\n aws s3api restore-object --restore-request \"{\\\\\"Days\\\\\":$days_available,\\\\\"GlacierJobParameters\\\\\":{\\\\\"Tier\\\\\":\\\\\"$restore_tier\\\\\"}}\" --bucket $bucket --key \"\$x\"\ndone < all_objects_list.txt\nprintf \"\\\\nDone! You can now delete this folder.\\\\n\"\n" > run.sh
chmod +x run.sh
printf "${BOLD}You can now run ${GREEN}$temp_dir/run.sh${NORMAL}${BOLD} to start the restoration process.\n"
popd &>/dev/null

View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
error() {
printf "${BOLD}${RED}$1${NORMAL}\n"
}
set -e
repo_path="$1"
output_path="$2"
if [[ $repo_path == "" || $output_path == "" ]]; then
error "Missing args: <svn repo path> <output path>"
exit 1
fi
if [[ ! -d "$repo_path" ]]; then
error "Repo directory '$repo_path' doesn't exist."
exit 1
fi
output_path="$output_path/svn"
mkdir -p "$output_path"
now=$(echo $(date '+%Y-%m-%d-%H-%M-%S'))
backup_path="$output_path/${now}_jellypixel_repos.dump.gz"
printf "${BOLD}${YELLOW}Backing up '$repo_path' to '$backup_path'\n"
printf "Proceed? (1|y)\n> ${NORMAL}"
read -e proceed
if [[ ! ($proceed == "1" || $proceed == "y") ]]; then
exit 1
fi
svnadmin.exe dump "$repo_path" | gzip -9 > "$backup_path"

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
use_gpu=0
if [[ $# < 2 || $# > 3 ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <output name> <optional: use-gpu (1|0), defaults to $use_gpu> ${NORMAL}\n"
exit 1
fi
filename=$(basename -- "$1")
output_name="$2"
if [[ $# > 2 ]]; then
use_gpu=$3
fi
# Found the following to work best with vids containing text (e.g. programming vid): 25 for CPU encoding and 27 for GPU.
use_crf=21
if [[ $use_gpu -eq 1 ]]; then
use_crf=25
fi
compress-video-with-crf $use_crf "$filename" "$output_name" $use_gpu

View File

@@ -0,0 +1,91 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
use_gpu=0
if [[ "$#" < 3 || "$#" > 6 ]]; then
printf "${BOLD}${RED}Usage: $0 <crf value> <filename> <output name> <optional: use-gpu (1|0), defaults to $use_gpu> <optional: start time HH:MM:SS> <optional: end time HH:MM:SS>\n\nIf you want to encode a range of CRF values then use -1 as the crf value.${NORMAL}\n"
exit 1
fi
use_crf=$1
filename=$(basename -- "$2")
extension="${filename##*.}"
filename="${filename%.*}"
output_name="$3"
if [[ "$#" > 3 ]]; then
use_gpu=$4
if [[ "$#" > 4 ]]; then
start_time="$5"
if [[ "$#" > 5 ]]; then
end_time="$6"
fi
fi
fi
if [[ $use_gpu -ne 0 && $use_gpu -ne 1 ]]; then
printf "${BOLD}${RED}Invalid use_gpu value. Got $use_gpu, but expected either 0 or 1${NORMAL}\n"
exit 1
fi
function encode() {
crf=$1
output="${output_name}.$extension"
printf "\n${YELLOW}${BOLD}Encoding '$filename.$extension' | GPU: $use_gpu | CRF $crf | output: $output | start: $start_time | end: $end_time${NORMAL}\n"
timing_args=""
if [[ $start_time != "" ]]; then
timing_args+="-ss $start_time -to $end_time"
fi
if [[ $use_gpu -eq 1 ]]; then
# File will be slightly larger than CPU encoding, but it's much faster to transcode and doesn't max out the CPU cores.
# RTX 3080
ffmpeg -y -stats -loglevel level+error $timing_args -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr_hq -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output"
# GTX 1070
#ffmpeg -y -stats -loglevel level+error $timing_args -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr_hq -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output"
else
ffmpeg -y -stats -loglevel level+error $timing_args -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v high -level 3.0 -strict -2 "$output"
fi
printf "\n${GREEN}${BOLD}Finished encoding '$filename.$extension' (CRF $crf) | output name '$output'${NORMAL}\n\n"
}
if [[ $use_crf -ne -1 ]]; then
encode $use_crf
else
printf "\n${YELLOW}${BOLD}Encoding using a range of CRF values.${NORMAL}\n"
# Bigger crf values == bigger compression.
for crf in {25..28}
do
encode $crf
done
fi

View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# This is for reencoding an AVI video. I wasn't able to play the encoded videos
# on my phone when using libx264 and libx265 encoders, but mpeg4 works. Also
# I'm using the aac codec because some old avi's were using a codec that's not
# supported in the mp4 container.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $1 == "" || $2 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <bitrate, e.g. \"4000k\"> <optional output name>${NORMAL}\n"
exit 1
fi
filename=$(basename -- "$1")
extension="${filename##*.}"
filename="${filename%.*}"
bitrate="$2"
output_name="$3"
if [[ $output_name == "" ]]; then
output="${filename}_CONVERTED-${bitrate}.mp4"
else
output="${output_name}.mp4"
fi
printf "\n${YELLOW}${BOLD}Encoding '$filename.$extension' with target bitrate $bitrate | output: $output${NORMAL}\n"
ffmpeg -i "$filename.$extension" -c:a aac -c:v mpeg4 -b:v $bitrate "$output"
printf "\n${GREEN}${BOLD}Done encoding '$filename.$extension' to '$output'${NORMAL}\n\n"

View File

@@ -0,0 +1,64 @@
#!/usr/bin/env bash
# This is for reencoding an FLV video to mp4 using an mpeg4 encoder.
# Can optionally compress the video.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $1 == "" || $2 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <compress 1|0> <filename> <optional output name>${NORMAL}\n"
exit 1
fi
compress="$1"
filename=$(basename -- "$2")
extension="${filename##*.}"
filename="${filename%.*}"
output="$3"
if [[ $output == "" ]]; then
output="${filename}_CONVERTED"
fi
printf "\n${YELLOW}${BOLD}Encoding '$filename.$extension' | compress: $compress | output: $output.mp4${NORMAL}\n"
if [[ $compress -eq 1 ]]; then
temp_output="temp_$output.mp4"
else
temp_output="$output.mp4"
fi
# convert first.
# we convert then compress instead of compressing on first pass because this results in a slightly higher bitrate.
ffmpeg -y -stats -loglevel level+error -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i "$filename.$extension" -c:a aac -c:v h264_nvenc -b:v 5M "$temp_output"
if [[ $compress -eq 1 ]]; then
compress-video 1 "$temp_output" "$output"
rm "$temp_output"
else
printf "\n"
fi
printf "${GREEN}${BOLD}Done encoding '$filename.$extension' to '$output.mp4'${NORMAL}\n\n"

View File

@@ -0,0 +1,64 @@
#!/usr/bin/env bash
# This is for reencoding an mkv video to mp4 using an mpeg4 encoder.
# Can optionally compress the video.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $1 == "" || $2 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <compress 1|0> <filename> <optional output name>${NORMAL}\n"
exit 1
fi
compress="$1"
filename=$(basename -- "$2")
extension="${filename##*.}"
filename="${filename%.*}"
output="$3"
if [[ $output == "" ]]; then
output="${filename}_CONVERTED"
fi
printf "\n${YELLOW}${BOLD}Encoding '$filename.$extension' | compress: $compress | output: $output.mp4${NORMAL}\n"
if [[ $compress -eq 1 ]]; then
temp_output="temp_$output.mp4"
else
temp_output="$output.mp4"
fi
# convert first.
# we convert then compress instead of compressing on first pass because this results in a slightly higher bitrate.
ffmpeg -y -stats -loglevel level+error -i "$filename.$extension" -vcodec copy -acodec copy "$temp_output"
if [[ $compress -eq 1 ]]; then
compress-video 1 "$temp_output" "$output"
rm "$temp_output"
else
printf "\n"
fi
printf "${GREEN}${BOLD}Done encoding '$filename.$extension' to '$output.mp4'${NORMAL}\n\n"

View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
input="$1"
output_name="$2"
if [[ $input == "" || $output_name == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <input video> <wav output name>${NORMAL}\n"
exit 1
fi
if [[ ! -f "$input" ]]; then
printf "${RED}${BOLD}Error: failed to extract audio. Video file \"$input\" doesn't exist.\n${NORMAL}"
exit 1
fi
# Add extension if not provided.
output_basename=$(basename -- "$output_name")
output_extension="${output_basename##*.}"
if [[ $output_extension != "wav" ]]; then
output_name="${output_name}.wav"
fi
printf "\n${YELLOW}${BOLD}Extracting 16-bit WAV from $input | output: $output_name${NORMAL}\n"
ffmpeg -i "$input" -ar 16000 -ac 1 -c:a pcm_s16le "$output_name"
printf "${GREEN}${BOLD}Done extracting 16-bit WAV from $input | output: $output_name${NORMAL}\n"

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
transcode="$1"
filename=$(basename -- "$2")
format="$3"
bitrate="$4"
if [[ $1 == "" || $2 == "" || $3 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <transcode? 0|1 (needed when container doesn't contain format)> <filename> <format (mp3, m4a, aac, etc)> <optional: bitrate. Uses 64k when not specified, 0 = variable (e.g. 0, 64, 128, etc)>${NORMAL}\n"
exit 1
fi
extension="${filename##*.}"
filename="${filename%.*}"
output_name="$filename.$format"
if [[ $bitrate == "" ]]; then
bitrate="64"
fi
printf "\n${YELLOW}${BOLD}Extracting audio from $filename.$extension | bitrate: ${bitrate}k | output: $output_name${NORMAL}\n"
if [[ $transcode == "1" ]]; then
# Transcode audio
ffmpeg -i "$filename.$extension" -b:a ${bitrate}k -ac 2 -ar 44100 -map a "$output_name"
else
# Grab the audio stream from the video.
ffmpeg -i "$filename.$extension" -vn -acodec copy "$output_name"
fi
printf "\n${GREEN}${BOLD}Done extracting audio from $filename.$extension | output name '$output_name'${NORMAL}\n\n"

View File

@@ -0,0 +1,21 @@
@echo off
if exist %1\* (
echo directory
for /F "delims=" %%f in ('dir /b /s %1') do (
:: skip folders
if not exist "%%~f\" (
java -jar %DEV_TOOLS%\PortexAnalyzer.jar -p "%%~f_PortexAnalyzer_Report.png" -o "%%~f_PortexAnalyzer_Report.txt" "%%~f" | more
)
)
) else (
if exist "%~1_PortexAnalyzer_Report.txt" (
del "%~1_PortexAnalyzer_Report.txt"
)
if exist "%~1_PortexAnalyzer_Report.png" (
del "%~1_PortexAnalyzer_Report.png"
)
java -jar %DEV_TOOLS%\PortexAnalyzer.jar -p "%~1_PortexAnalyzer_Report.png" -o "%~1_PortexAnalyzer_Report.txt" "%~1" | more
start notepad "%~1_PortexAnalyzer_Report.txt"
start rundll32 "C:\Program Files (x86)\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %~1_PortexAnalyzer_Report.png
)

View File

@@ -0,0 +1,3 @@
@echo off
start %DEV_TOOLS%\ResourceHacker.exe "%~1"

View File

@@ -0,0 +1,12 @@
@echo off
cd %DEV_TOOLS%\SysinternalsSuite
if exist %1\* (
echo Run on a file
) else (
if exist "%~1_Report.txt" (
del "%~1_Report.txt"
)
sigcheck.exe /a "%~1" > "%~1_sigcheck_report.txt"
start notepad "%~1_sigcheck_report.txt"
)

View File

@@ -0,0 +1,3 @@
@echo off
start %DEV_TOOLS%\x64dbg\release\x32\x32dbg.exe "%~1"

View File

@@ -0,0 +1,3 @@
@echo off
start %DEV_TOOLS%\x64dbg\release\x64\x64dbg.exe "%~1"

View File

@@ -0,0 +1,13 @@
@echo off
:: arm directory args1
for /F "delims=" %%f in ('dir /b /s %1') do (
:: skip folders
if not exist "%%~f\" (
:: skip files without .disarmed extension
if ".disarmed" == "%%~xf" (
move "%%~f" "%%~dpnf"
echo "%%~f" renamed to "%%~dpnf"
)
)
)
@pause

View File

@@ -0,0 +1,13 @@
@echo off
:: disarm directory args1
for /F "delims=" %%f in ('dir /b /s %1') do (
:: skip folders
if not exist "%%~f\" (
:: skip .disarmed extension
if not ".disarmed" == "%%~xf" (
move "%%~f" "%%~f.disarmed"
echo "%%~f" renamed to "%%~f.disarmed"
)
)
)
@pause

View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# Use this to fix the audio of a video that has audio in only the left or right
# channel. This does not re-encode the video.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $1 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <optional output name>${NORMAL}\n"
exit 1
fi
filename=$(basename -- "$1")
extension="${filename##*.}"
filename="${filename%.*}"
output_name="$2"
if [[ $output_name == "" ]]; then
output="${filename}_repaired_audio.$extension"
else
output="${output_name}.$extension"
fi
printf "\n${YELLOW}${BOLD}Repairing audio in $filename.$extension | output: $output${NORMAL}\n"
ffmpeg -i "$filename.$extension" -c:v copy -ac 1 "$output"
printf "\n${GREEN}${BOLD}Done repairing audio in $filename.$extension | output: $output${NORMAL}\n\n"

41
dotfiles/bin/join-video Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
filename=$(basename -- "$1")
output_name="$2"
if [[ $filename == "" || $output_name == "" ]]; then
printf "${BOLD}${RED}Usage: create a text file that lists the input video paths on separate lines using the format: file '/path/to/video'. Then call:\n\n$0 <list name> <output name>${NORMAL}\n"
exit 1
fi
output="${output_name}.mp4"
printf "\n${YELLOW}${BOLD}Joining contents of '$filename'| output: $output${NORMAL}\n"
ffmpeg -f concat -safe 0 -i "$filename" -c copy "$output"
printf "\n${GREEN}${BOLD}Finished joining${NORMAL}\n\n"

View File

@@ -0,0 +1,70 @@
#!/usr/bin/env bash
# Use this to normalize the audio of a video using the average loudness, or RMS-based normalization.
# This does not re-encode the video.
#
# Inspired by https://superuser.com/a/323127 and https://superuser.com/a/1312885
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $1 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <optional output name>${NORMAL}\n"
exit 1
fi
filename=$(basename -- "$1")
extension="${filename##*.}"
filename="${filename%.*}"
output_name="$2"
if [[ $output_name == "" ]]; then
output="${filename}_normalized_audio.$extension"
else
output="${output_name}.$extension"
fi
printf "\n${YELLOW}${BOLD}Normalizing audio in $filename.$extension | output: $output${NORMAL}\n"
# This is done in two passes. The first pass will compute the mean loudness and
# the second pass will normalize the audio using the mean as the target.
# -vn, -sn, and -dn tells ffmpeg to ignore non-audio streams during the analysis. This speeds things up.
ffmpeg -i "$filename.$extension" -af "volumedetect" -vn -sn -dn -f null /dev/null
#ffmpeg -i "$filename.$extension" -c:v copy -ac 1 "$output"
printf "\n${GREEN}${BOLD}Done normalizing audio in $filename.$extension | output: $output${NORMAL}\n\n"
#---------------------------------------
# This seems better. 2 pass using loudnorm filter.
# 1st pass: ffmpeg -i "$filename.$extension" -pass 1 -filter:a loudnorm=print_format=json -vn -sn -dn -f null /dev/null
# 2nd pass: ffmpeg -i "$filename.$extension" -c:v copy -pass 2 -filter:a loudnorm=linear=true:measured_I=$input_i:measured_LRA=$input_lra:measured_tp=$input_tp:measured_thresh=$input_thresh "$output"
# TODO: extract the $input_i, input_lra, etc from the 1st pass output so that this can be automated.
# TODO: stackoverflow said if there are subtitles or multiple vid streams then add "-map 0" before the output name. Test this.
# TODO: disable the log file or just delete it after normalizing.

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $1 == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <optional output name>${NORMAL}\n"
exit 1
fi
filename=$(basename -- "$1")
extension="${filename##*.}"
filename="${filename%.*}"
output_name="$2"
if [[ $output_name == "" ]]; then
output="${filename}_no_audio.$extension"
else
output="${output_name}.$extension"
fi
printf "\n${YELLOW}${BOLD}Removing audio from '$filename.$extension' | output: '$output'${NORMAL}\n"
# -an removes the audio.
ffmpeg -i "$filename.$extension" -c:v copy -an "$output"
printf "\n${GREEN}${BOLD}Done removing audio from '$filename.$extension' | output: '$output'${NORMAL}\n\n"

View File

@@ -0,0 +1,73 @@
#!/usr/bin/env bash
#
# Loads an SVN snapshot into a new repository.
#
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
error() {
printf "${BOLD}${RED}$1${NORMAL}\n"
}
set -e
backup_path="$1"
repo_path="$2"
if [[ ($backup_path == "") || ($repo_path == "") ]]; then
error "Missing args: <backup file path> <svn repo path>"
exit 1
fi
if [[ ! -f "$backup_path" ]]; then
error "Backup file '$backup_path' doesn't exist.\n"
exit 1
fi
if [[ ! -d "$repo_path" ]]; then
error "SVN repo '$repo_path' doesn't exist.\n"
exit 1
fi
printf "${BOLD}${YELLOW}Loading backup '$backup_path' to '$repo_path'\n"
printf "The destination repo should be a new repo with no commits.\n"
printf "Proceed? (1|y)\n> ${NORMAL}"
read -e proceed
if [[ ! ($proceed == "1" || $proceed == "y") ]]; then
exit 1
fi
# Was having trouble getting this to work on svnadmin 1.14.1 on Windows:
# gunzip -c "$backup_path" | svnadmin load "$repo_path"
# It was very slow and the output would freeze.
# So now we unzip and then import.
source_dir=$(dirname "$backup_path")
dump_file="$source_dir/$RANDOM.dump"
printf "${BOLD}Unzipping to '$dump_file'\n"
gunzip -cf "$backup_path" >> "$dump_file"
printf "${BOLD}Loading into SVN repo\n"
svnadmin load -F "$dump_file" "$repo_path"
rm "$dump_file"

View File

@@ -0,0 +1,206 @@
#! /usr/bin/env racket
#lang racket
;Dorai Sitaram
;Oct 8, 1999
;last change 2016-12-28
;This script takes lines of Scheme or Lisp code from its
;stdin and produces an indented version thereof on its
;stdout.
(define *lisp-keywords* '())
(define (set-lisp-indent-number sym num-of-subforms-to-be-indented-wide)
(let* ((x (symbol->string sym))
(c (assf (lambda (a) (string-ci=? x a)) *lisp-keywords*)))
(unless c
(set! c (cons x (box 0)))
(set! *lisp-keywords* (cons c *lisp-keywords*)))
(set-box! (cdr c) num-of-subforms-to-be-indented-wide)))
(for-each (lambda (s) (set-lisp-indent-number s 0))
'(block
handler-bind
loop))
(for-each (lambda (s) (set-lisp-indent-number s 1))
'(case
defpackage dolist dotimes
ecase etypecase eval-when
flet
labels lambda let let* let-values
prog1
typecase
unless unwind-protect
when with-input-from-string with-open-file with-open-socket
with-open-stream with-output-to-string))
(for-each (lambda (s) (set-lisp-indent-number s 2))
'(defun destructuring-bind do do*
if
multiple-value-bind
with-slots))
(define (read-home-lispwords)
(let ((init-file (build-path (find-system-path 'home-dir) ".lispwords")))
(when (file-exists? init-file)
(call-with-input-file init-file
(lambda (i)
(let loop ()
(let ((w (read i)))
(unless (eof-object? w)
(let ((n (car w)))
(for-each (lambda (x) (set-lisp-indent-number x n))
(cdr w)))
(loop)))))))))
(define (past-next-token s i n)
(let loop ((i i) (escape? #f))
(if (>= i n) i
(let ((c (string-ref s i)))
(cond (escape? (loop (+ i 1) #f))
((char=? c #\\) (loop (+ i 1) #t))
((char=? c #\#)
(let ((j (+ i 1)))
(if (>= j n) i
(let ((c (string-ref s j)))
(cond ((char=? c #\\) (loop (+ j 1) #t))
(else i))))))
((memv c '(#\space #\tab #\( #\) #\[ #\] #\" #\' #\` #\, #\;))
i)
(else (loop (+ i 1) #f)))))))
(define (lisp-indent-number s)
(let ((c (assf (lambda (a) (string-ci=? s a)) *lisp-keywords*)))
(cond (c (unbox (cdr c)))
((and (>= (string-length s) 3)
(string-ci=? (substring s 0 3) "def")) 0)
(else -1))))
(define (literal-token? s)
(let ((x (let ((i (open-input-string s)))
(begin0 (read i) (close-input-port i)))))
(or (char? x) (number? x) (string? x))))
(define (calc-subindent s i n)
(let* ((j (past-next-token s i n))
(num-aligned-subforms 0)
(left-indent
(if (= j i) 1
(let ((w (substring s i j)))
(if (and (>= i 2)
(memv (string-ref s (- i 2)) '(#\' #\`)))
1
(let ((nas (lisp-indent-number w)))
(cond ((>= nas 0) (set! num-aligned-subforms nas)
2)
((literal-token? w) 1)
((= j n) 1)
(else (+ (- j i) 2)))))))))
(values left-indent num-aligned-subforms (- j 1))))
(define (num-leading-spaces s)
(let ((n (string-length s)))
(let loop ((i 0) (j 0))
(if (>= i n) 0
(case (string-ref s i)
((#\space) (loop (+ i 1) (+ j 1)))
((#\tab) (loop (+ i 1) (+ j 8)))
(else j))))))
(define (string-trim-blanks s)
(let ((n (string-length s)))
(let ((j (let loop ((j 0))
(if (or (>= j n)
(not (char-whitespace? (string-ref s j))))
j
(loop (+ j 1))))))
(if (>= j n) ""
(let ((k (let loop ((k (- n 1)))
(if (or (< k 0)
(not (char-whitespace? (string-ref s k))))
(+ k 1)
(loop (- k 1))))))
(substring s j k))))))
(define-struct lparen
(spaces-before num-aligned-subforms (num-finished-subforms #:auto))
#:mutable #:auto-value 0)
(define (indent-lines)
(let ((left-i 0) (paren-stack '()) (stringp #f))
(let line-loop ()
(let ((curr-line (read-line)))
(unless (eof-object? curr-line)
(let* ((leading-spaces (num-leading-spaces curr-line))
(curr-left-i
(cond (stringp leading-spaces)
((null? paren-stack)
(when (= left-i 0) (set! left-i leading-spaces))
left-i)
(else (let* ((lp (car paren-stack))
(nas (lparen-num-aligned-subforms lp))
(nfs (lparen-num-finished-subforms lp))
(extra-w 0))
(when (< nfs nas)
(set-lparen-num-finished-subforms! lp
(+ nfs 1))
(set! extra-w 2))
(+ (lparen-spaces-before lp) extra-w))))))
(set! curr-line (string-trim-blanks curr-line))
(do ((i 0 (+ i 1)))
((= i curr-left-i))
(write-char #\space))
(display curr-line) (newline)
;
(let ((n (string-length curr-line))
(escapep #f)
(inter-word-space-p #f))
(let loop ((i 0))
(unless (>= i n)
(let ((c (string-ref curr-line i)))
(cond (escapep (set! escapep #f) (loop (+ i 1)))
((char=? c #\\) (set! escapep #t) (loop (+ i 1)))
(stringp
(when (char=? c #\") (set! stringp #f))
(loop (+ i 1)))
((char=? c #\;) 'break-loop)
((char=? c #\") (set! stringp #t)
(loop (+ i 1)))
((memv c '(#\space #\tab))
(unless inter-word-space-p
(set! inter-word-space-p #t)
(cond ((and (pair? paren-stack)
(car paren-stack)) =>
(lambda (lp)
(let ((nfs (lparen-num-finished-subforms lp)))
(set-lparen-num-finished-subforms! lp (+ nfs 1)))))))
(loop (+ i 1)))
((memv c '(#\( #\[))
(set! inter-word-space-p #f)
(let-values (((left-indent
num-aligned-subforms
j)
(calc-subindent curr-line (+ i 1) n)))
(set! paren-stack
(cons (make-lparen (+ i curr-left-i left-indent)
num-aligned-subforms)
paren-stack))
(loop (+ j 1))))
((memv c '(#\) #\]))
(set! inter-word-space-p #f)
(cond (paren-stack
(set! paren-stack (cdr paren-stack)))
(else (set! left-i 0)))
(loop (+ i 1)))
(else (set! inter-word-space-p #f)
(loop (+ i 1)))))))))
(line-loop))))))
(read-home-lispwords)
(indent-lines)
;eof

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
source "$HOME/dotfiles/script_helpers/all.sh"
cwd=$PWD
source_path=""
dest_path=""
#echo "got $1 and $2 and $3"
if [[ $1 ]]; then
source_path=$1
else
printf "${BOLD}${YELLOW}Enter full path to source file/dir:\n${NORMAL}"
read -e source_path
fi
if [[ $2 ]]; then
dest_path=$2
else
printf "${BOLD}${YELLOW}Enter full path to symlink destination:\n${NORMAL}"
read -e dest_path
fi
if [[ $3 ]]; then expand_symlinks=$3; else expand_symlinks=0; fi
overwrite_existing=0
confirm_link=0
make_link "$source_path" "$dest_path" $expand_symlinks $overwrite_existing $confirm_link

View File

@@ -0,0 +1,54 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
error() {
printf "${BOLD}${RED}$1${NORMAL}"
}
abort() {
error "\nAborting...\n"
exit 1
}
set -e
cwd=$PWD
printf "${BOLD}Attempting to connect to device via adb...\nMake sure 'file transfer' mode is set on device. You may have to accept the connection and then re-run this script.\n${NORMAL}"
adb forward tcp:9222 localabstract:chrome_devtools_remote
src=_tabs.json
if wget -qO $src http://localhost:9222/json/list; then
ts=`date +"%Y-%m-%d_%H-%M-%S"`
dest="${cwd}/${ts}_android-chrome-tabs.md"
sed -n "/\"url\"/p" $src | sed -e "s/^[ \t]*.\{8\}//" -e "s/.\{2\}$//" > $dest
printf "${BOLD}Saved tabs to: ${YELLOW}$dest${NORMAL}\n"
else
error "Unable to download tabs from device!\n"
fi
rm $src

View File

@@ -0,0 +1,94 @@
#!/usr/bin/env bash
# The base model is pretty good overall. It has good punctuation inserting and catches most words.
# Tiny is fast and often has correct grammar, but it misses a lot of words, especially when the
# source isn't loud or is muffled.
#
# Small and medium models can do better word detection at times, but suffer from a lack of punctuation.
# Medium is particularly bad and often excludes periods and commas.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
# Will return a symlink path in its expanded form. If the path's root is the
# home directory symbol "~" then it'll be replaced by the full home path.
expand_path() {
local ret="$1"
IFS="/" read -ra parts <<< "$ret"
if [[ "${parts[0]}" == "~" ]]; then
ret="$HOME"
for ((i=1; i < ${#parts[@]}; i++))
do
ret="$ret/${parts[$i]}"
done
fi
ret=$(readlink -m "$ret")
echo $ret
}
input_wav="$1"
output_name_without_ext="$2"
model="$3"
threads=$4
# 4 seems to be the sweet spot for most models, except medium might be faster with 8.
default_thread_count=4
if [[ $input_wav == "" || $output_name_without_ext == "" || $model == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <input.wav> <output name without extension> <model name> <optional: thread count>${NORMAL}\n"
exit 1
fi
if [[ ! -f "$input_wav" ]]; then
printf "${RED}${BOLD}Input file \"$input_wav\" doesn't exist!\n${NORMAL}"
exit 1
fi
if [[ $threads == "" ]]; then
threads=$default_thread_count
fi
output_name="$output_name_without_ext.${model}"
# 1 core 31 threads has very fast pcm_to_mel conversion and then just one core doing most of the work. You get more accurate results this way.
# 2 core 16 is about half the time but it can have errors where the two pieces come together. This only gets more likely as the core count is increased.
# 8 threads, 4 cores is good too for tiny,small and 2 threads, 4 cores for medium.
threads=31 #keep a thread for me
cores=1
printf "\n${YELLOW}${BOLD}Transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name ${NORMAL}\n"
whisper_fullname="$(expand_path $(which whisper.exe))"
whisper_path="$(dirname $whisper_fullname)"
models_path="$whisper_path/models"
whisper.exe --processors ${cores} --threads ${threads} -m "$models_path/ggml-${model}.en.bin" -otxt -osrt -f "$input_wav" -of "$output_name" --print-colors --print-progress
error=$?
if [[ error -eq 0 ]]; then
printf "${GREEN}${BOLD}Done transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name${NORMAL}\n"
else
printf "${GREEN}${BOLD}Error while transcribing $input_wav | model: $model | cores: $cores | threads: $threads | output: $output_name${NORMAL}\n"
fi

View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
input_video="$1"
output_name_without_ext="$2"
shift 2
models=("$@")
if [[ $input_video == "" || $output_name_without_ext == "" || ${#models[@]} -eq 0 ]]; then
printf "${BOLD}${RED}Usage: $0 <input.mp4> <output name without extension> <list of model names to use>${NORMAL}\n"
exit 1
fi
model_csv=$(IFS=_ ; echo "${models[*]}")
wav_name="${output_name_without_ext}_${model_csv}_${RANDOM}"
# Add extension if not provided.
input_basename=$(basename -- "$wav_name")
input_extension="${input_basename##*.}"
if [[ input_extension != "wav" ]]; then
wav_name="${wav_name}.wav"
fi
extract-16bit-wav-from-video "$input_video" "$wav_name"
if [[ $? == 1 ]]; then exit 1; fi
for model in "$@"; do
# Tweak thread count based on model size.
thread_count=4
if [[ $model == "medium" ]]; then
thread_count=8
fi
transcribe-audio "$wav_name" "$output_name_without_ext" "${model}" $thread_count
if [[ $? == 1 ]]; then
printf "${RED}${BOLD}Saving the audio file \"$wav_name\" in case you want to reuse it for debugging.\n${NORMAL}"
exit 1
fi
done
rm "$wav_name"

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
transcribe-video "$1" "$2" "base"

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
transcribe-video "$1" "$2" "medium"

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
transcribe-video "$1" "$2" "small"

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
transcribe-video "$1" "$2" "tiny"

View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Reencodes the video with a more accurate length.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
filename=$(basename -- "$1")
output_name="$2"
start_time="$3"
end_time="$4"
if [[ $filename == "" || $output_name == "" || $start_time == "" || $end_time == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <output name> <start time HH:MM:SS> <end time HH:MM:SS>${NORMAL}\n"
exit 1
fi
extension="${filename##*.}"
filename="${filename%.*}"
output="${output_name}.$extension"
timing_args="-ss $start_time -to $end_time"
printf "\n${YELLOW}${BOLD}Trimming '$filename.$extension' | output: $output | start: $start_time | end: $end_time${NORMAL}\n"
ffmpeg -y -stats -loglevel level+error $timing_args -accurate_seek -i "$filename.$extension" -c:v libx264 -c:a copy "$output"
printf "\n${GREEN}${BOLD}Finished trimming${NORMAL}\n\n"

46
dotfiles/bin/trim-video Normal file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
filename=$(basename -- "$1")
output_name="$2"
start_time="$3"
end_time="$4"
if [[ $filename == "" || $output_name == "" || $start_time == "" || $end_time == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <output name> <start time HH:MM:SS> <end time HH:MM:SS>${NORMAL}\n"
exit 1
fi
extension="${filename##*.}"
filename="${filename%.*}"
output="${output_name}.$extension"
timing_args="-ss $start_time -to $end_time"
printf "\n${YELLOW}${BOLD}Trimming '$filename.$extension' | output: $output | start: $start_time | end: $end_time${NORMAL}\n"
ffmpeg -y -stats -loglevel level+error $timing_args -i "$filename.$extension" -c copy "$output"
printf "\n${GREEN}${BOLD}Finished trimming${NORMAL}\n\n"

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# If you're getting signature errors, check out https://www.msys2.org/news/#2020-06-29-new-packagers and/or other news posts.
source "$HOME/dotfiles/script_helpers/printing.sh"
source "$HOME/dotfiles/script_helpers/platform.sh"
set -e
if [[ -d "/c/msys64" ]]; then
shell_is_mingw is_mingw
if [[ $is_mingw -eq 1 ]]; then
printf "${BOLD}${YELLOW}Updating MinGW Shell${NORMAL}\n"
pacman -Syu
printf "${BOLD}${GREEN}Done!${NORMAL}\n"
printf "\n${BOLD}Re-run this in a new shell if the updater requires the shells to be closed.\n"
else
error "Re-run this in an MinGW shell.\n"
exit 1
fi
else
error "Unable to find C:\msys64 - make sure the shell is installed and then re-run this in a MinGW shell.\n"
exit 1
fi

View File

@@ -0,0 +1,71 @@
server_names = ["cloudflare", "cloudflare-ipv6"]
listen_addresses = ["127.0.0.1:53", "[::1]:53"]
max_clients = 250
ipv4_servers = true
ipv6_servers = true
disabled_server_names = []
dnscrypt_servers = true
doh_servers = true
require_dnssec = true
require_nolog = true
require_nofilter = true
daemonize = false
force_tcp = false
dnscrypt_ephemeral_keys = false
tls_disable_session_tickets = false
offline_mode = false
timeout = 5000
keepalive = 30
lb_estimator = false
netprobe_timeout = 60
netprobe_address = "9.9.9.9:53"
log_level = 0
use_syslog = false
cert_refresh_delay = 240
fallback_resolvers = ["9.9.9.9:53", "8.8.8.8:53"]
ignore_system_dns = true
log_files_max_size = 10
log_files_max_age = 7
log_files_max_backups = 1
block_ipv6 = false
block_unqualified = true
block_undelegated = true
reject_ttl = 600
cache = true
cache_size = 4096
cache_min_ttl = 2400
cache_max_ttl = 86400
cache_neg_min_ttl = 60
cache_neg_max_ttl = 600
[query_log]
format = "ltsv"
[nx_log]
format = "ltsv"
[blacklist]
[ip_blacklist]
[anonymized_dns]
skip_incompatible = false
[broken_implementations]
fragments_blocked = ["cisco", "cisco-ipv6", "cisco-familyshield", "cisco-familyshield-ipv6", "quad9-dnscrypt-ip4-filter-alt", "quad9-dnscrypt-ip4-filter-pri", "quad9-dnscrypt-ip4-nofilter-alt", "quad9-dnscrypt-ip4-nofilter-pri", "quad9-dnscrypt-ip6-filter-alt", "quad9-dnscrypt-ip6-filter-pri", "quad9-dnscrypt-ip6-nofilter-alt", "quad9-dnscrypt-ip6-nofilter-pri", "cleanbrowsing-adult", "cleanbrowsing-family-ipv6", "cleanbrowsing-family", "cleanbrowsing-security"]
[sources]
[sources.public-resolvers]
urls = ["https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/public-resolvers.md", "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md"]
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"
cache_file = "public-resolvers.md"
refresh_delay = 0
prefix = ""
[sources.relays]
urls = ["https://github.com/DNSCrypt/dnscrypt-resolvers/raw/master/v2/relays.md", "https://download.dnscrypt.info/resolvers-list/v2/relays.md"]
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"
cache_file = "relays.md"
refresh_delay = 72
prefix = ""

88
dotfiles/install Normal file
View File

@@ -0,0 +1,88 @@
#!/usr/bin/env bash
if [[ $(uname) == 'Darwin' ]]; then
if ! command -v brew &>/dev/null
then
# We need to update bash, so we'll start with setting up homebrew.
./macos/pre_install
exit
fi
fi
source "script_helpers/printing.sh"
source "script_helpers/core.sh"
source "script_helpers/platform.sh"
source "script_helpers/file_ops.sh"
dotfiles_dir=$PWD
os_is_windows is_windows
os_is_macos is_macos
os_is_linux is_linux
# Check for admin permissions when running on Windows.
if [[ $is_windows -eq 1 ]]; then
# `openfiles` is a command present on all supported Windows versions,
# requires admin privileges, and has no side effects.
openfiles &>/dev/null
admin_error=$?
if [[ ! $admin_error -eq 0 ]]; then
fatal "You need to run this in an admin shell!"
fi
fi
set -e
####################################################################################################
# Helpers
####################################################################################################
use_shell() {
shell=$1
if hash chsh >/dev/null 2>&1; then
printf "\n${BLUE}Changing the default shell to $shell${NORMAL}\n"
chsh -s $(which $shell)
else
error "\nUnable to change the shell because this system does not have chsh.\n"
fi
}
setup_zsh() {
printf "${MAGENTA}==> ${NORMAL}Setting up zsh...\n"
if [[ $is_linux -eq 1 ]]; then
sudo apt install zsh
fi
}
####################################################################################################
# Setup
####################################################################################################
pushd "$HOME" &>/dev/null
set +e
git_comp_filename=".git-completion.bash"
printf "${MAGENTA}==> ${NORMAL}Downloading Git completion list to ${YELLOW}$PWD/$git_comp_filename${NORMAL}\n"
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o $git_comp_filename
set -e
#########################
# Setup platform files
#########################
if [[ $is_macos -eq 1 ]]; then
printf "\n${BOLD}Setting up MacOS${NORMAL}\n\n"
$dotfiles_dir/macos/install
# might just switch back to bash since the zsh stuff is ancient.
setup_zsh
use_shell zsh
elif [[ $is_linux -eq 1 ]]; then
printf "\n${BOLD}Setting up Linux${NORMAL}\n\n"
$dotfiles_dir/linux/install
use_shell bash
fi
popd "$HOME" &>/dev/null
printf "${BOLD}${GREEN}Done!${NORMAL}\n"

View File

@@ -0,0 +1,51 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFzHEugBEADSlJzUYr/Joaczkj37J3UHL8ME1RNOThdNvLSZqT3LTV5Sw9aU
bXE38e1MZ1lnipAnKRnS+P4JZXGGi4MOrDTXbKji8FQDLgvgFlPtJ1jhNLWCBuAA
GAqXs9LVPFffX5m/mpAgBiBRE7a5h4/tJKjyFqF89JagRyGCw/GKMq2KnFKlUMne
neFWRGgJmDRNv6+dzBNnlkhcvm2WZc+0J3A61yYcnK6Wlgdw1/7SBlXEjBREiJWf
l68FcoYCPS04rwrOmUoaGhEQxkpVu+pw3WRTZXEepOQpwepVCD7UH2WdxM9hT8LW
lG/xM7eI0TySimGckAc4dVVt/X0W0ezS1fdUk1tyuDg9pIUFpyRg03W2S2SXU576
6qaAquPw6heKVgkhdW5HkuyLEZPd+ASiZZSUO92OqAoBbWsVIHBEtDtb/tYgNHS/
/9L5gTyjetjSrpn9ILXQw2olnRv4ScGtjlgA3wU407xy3t9EmDo+rGzpzHwT/GJO
BfuK5yUvYNLKnouV3dZ9GJiK5kHfgK0aT442Te/Ii63KbW+JntbQj5g0PGzJjeI0
ZNyWIlOeJjH3apP2Yx88IiDTVf4YOxZ+vAsBVbzy+fgW1dPgdURRZXRJ/wfTrQIG
gPqCMMkainQOm528YQHeRTyfvGUiHgzQOcHVSaQb4/lXl/bO6b7Q8HcM8wARAQAB
tClNaWNoYWVsIENhbXBhZ25hcm8gPGNhbXBvQHByb3Rvbm1haWwuY29tPokCOAQT
AQIAIgUCXMcS6AIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQ7ZypbFeB
pVRQgg/9Gycvtcuy+udGZ9rs6/bVg6a+tcOpfj/R+KofQt7q+AVd0heDLMW2wyNv
RoZjSP1c7KmYlQhT5neKFqeMw8xHKgU8VRvg7J5caUxTlpuOHraub4o5Q5x0AHWy
M5+QQT/9onkW0a3UDaDF7QF7eZ+8Q5q19eT+SBlNhk7v4xUC/5jdSHkL+Sg4dQeu
Vqw1n7Nr8d2ep0k97UrdvbUKchzmXyHz6Z9QCvE2YG+4rwnIHet6YplpfdagsG+r
i6+tKh+cEV+CY378dkcNrFh3jb8Yc59EZHzRwaBE0nczFR3mrOuZjqs3o0dEhazZ
EZjziO5FkJ4ZBaPJ87HvCaMfrmiDdOTu9dMNsauxiHbCf9Q1i8Q6xwO3gzDH8xtd
l/WAz5w6TlXNVXnLf9BdiwW70XoNUc95ekK9QZOn2WLPQEbVgYr2fRIgHM9ib9S1
yI2dV2RCp1I+hK3w69mBPCEVrZLuqH9XjpSmUfKMLGSAR6m99XdUSZM+oIkBudW5
NQAlOaqErGj4MpkuZgnyTTICttuoHH0Wqfo0qvxemGTUQmshpnASWgNINOGrY6Tc
edNNa5sqdqoSvgfWPh5CV4PMeZR6YL3iUu5B+K/aLApvu0iLMOSN1Q/Oygpte78w
p0Hs7TedtSojVPqyF3tpRldZM+WMLae1W5wSVbactgVuXH3ptnS5Ag0EXMcS6AEQ
AMKQQFLsL2COUKayGd5Sz5wMv/URp2quIDK15n0vXjIu2ZbS3rSlNmoqMIgARu95
kcivx/fh9RHZ2eyvRMzFN//xheKEQmBQ8FvzKA0zKUYvXpUm3P8/cRH4cvuWbOjq
clzKdIBEOudtzasiNqYXaEQN37MMfZC+L/B52sE9SUntV680FqAscLYETzpAO21B
zYpyaPMd0uo4HZS4CHvi2tTtDrLDr1IQCF0ZQ5Qn7zuQOsWDu4v/kue5NEFwwKqL
mt3udLjQxkaGzpxzE+KmSFKLMMamzFuabHCIENI2sLzr2XCpd9gLqGbE7YnkA6jW
UUkf7M0hwoBGDq1kXRUxZ6bu8m2nbn+ikslduSAI7dmGVt8nAs5ZKzZ1S9mzNb66
KWfXkJra9fa7wVuQbEC0pT426cxzgsdDu5Bri68a4FSx71gdd36w2cFAfezNMKfh
Zd3TdPAtQGXFEMQW9obhdiPj+FHdaVq2/l/Ujw3lJglOtHzuqtrkgBysstp91p8x
xxGCE0PDf6NlaevNIQ4KnOsP9vEP1orqLSg3qA5XZgNWUyJK2HIlNyv8fAV5rVze
DCD2Mz4qpTnw31j4AxNiRXdHpxC+EWm5iLtaHBlebcYONSegWomhlvFqLeuboHWZ
yFXS8+HcPvbrdq4g5ncRqg0chRw7cMw9HOxHxs1NBNd9ABEBAAGJAh8EGAECAAkF
AlzHEugCGwwACgkQ7ZypbFeBpVRmyw/9GIW9HAuRtz3cQzfyWw2l0YrOQ9ZuX9Wi
+QmBd+CQyTbiojGE3gam93MgOr8xH8IetdzRiobKtP3zMhMyg89cuY5u5TOQXIWf
kdga8ppeLBh2JTU3TsaGo2y2VcfOi94S6QYKXcR9UJFeu7ZIJL9RPLjN/MEFtzuo
r97bN58F8Zf6rmwhpuhU0RqjPAXV+RBsormeR+9476sOVfsXJYITlazLyt8BN7mx
o911ejsBPisLVxrpqWgGpCg1dEQY3dgwwjKDdZ5i6LBbWhceokseP1m8lkYAGIcb
WHPZBikgXeYe0ULS1HMO14KPGiZ6dwheBudL6/nrku494lARzHaXG3mlyVA+YNp8
Q9Aa3MPSvTgAaF+jYMm8pW8XqJOAnJIqrYZMwcXSTGtYjlO4I/Ab/6qaLLCm9gXm
CrT917/KYxQhOgP/aMTxLtjjjTfUbRkgCkVmwv/6o9bm9ksV0Q1GYs97A4+Ia3Lu
Ut/yCo0ziPAXAR6BbMoEvdOkL3sYgMeljPECOtyBkRGBUUlIo8MPOr/6krU8wDdS
w59GHlso+yaxInggAHVE/UVAqxGaQeK6RZEx0HAxksYh0ZQ6zHcrrzp5L4ImwXDN
kVjVPZAQ7XlkPr7qNL1kmDnJUun1IPuTsUD5qIQX+oQFaPX67SSj9KKrv51m92Vc
DcXEKMe5skM=
=mbOb
-----END PGP PUBLIC KEY BLOCK-----

2
dotfiles/linux/README.md Normal file
View File

@@ -0,0 +1,2 @@
You may need to run `dos2unix` on this repo because of Windows line endings. There's a script in
this directory's bin folder called `dos2unix-recursive` which you can use to do the conversion.

View File

@@ -0,0 +1,4 @@
# Shadow
shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;

View File

@@ -0,0 +1,10 @@
--recurse=yes
--exclude=.git
--exclude=vendor/*
--exclude=node_modules/*
--exclude=db/*
--exclude=log/*
--exclude=personal/*
--exclude=public/*
--exclude=resources/public/*
--exclude=target/*

View File

@@ -0,0 +1,136 @@
# Options for GnuPG
# Copyright 1998-2003, 2010 Free Software Foundation, Inc.
# Copyright 1998-2003, 2010 Werner Koch
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Unless you specify which option file to use (with the command line
# option "--options filename"), GnuPG uses the file ~/.gnupg/gpg.conf
# by default.
#
# An options file can contain any long options which are available in
# GnuPG. If the first non white space character of a line is a '#',
# this line is ignored. Empty lines are also ignored.
#
# See the gpg man page for a list of options.
# If you have more than 1 secret key in your keyring, you may want to
# uncomment the following option and set your preferred keyid.
#default-key 621CC013
# If you do not pass a recipient to gpg, it will ask for one. Using
# this option you can encrypt to a default key. Key validation will
# not be done in this case. The second form uses the default key as
# default recipient.
#default-recipient some-user-id
#default-recipient-self
# Group names may be defined like this:
# group mynames = paige 0x12345678 joe patti
#
# Any time "mynames" is a recipient (-r or --recipient), it will be
# expanded to the names "paige", "joe", and "patti", and the key ID
# "0x12345678". Note there is only one level of expansion - you
# cannot make an group that points to another group. Note also that
# if there are spaces in the recipient name, this will appear as two
# recipients. In these cases it is better to use the key ID.
#group mynames = paige 0x12345678 joe patti
# GnuPG can automatically locate and retrieve keys as needed using
# this option. This happens when encrypting to an email address (in
# the "user@@example.com" form) and there are no keys matching
# "user@example.com" in the local keyring. This option takes any
# number mechanisms which are tried in the given order. The default
# is "--auto-key-locate local" to search for keys only in the local
# key database. Uncomment the next line to locate a missing key using
# two DNS based mechanisms.
#auto-key-locate local,pka,dane
# Common options for keyserver functions:
# (Note that the --keyserver option has been moved to dirmngr.conf)
#
# include-disabled = when searching, include keys marked as "disabled"
# on the keyserver (not all keyservers support this).
#
# no-include-revoked = when searching, do not include keys marked as
# "revoked" on the keyserver.
#
# verbose = show more information as the keys are fetched.
# Can be used more than once to increase the amount
# of information shown.
#
# auto-key-retrieve = automatically fetch keys as needed from the keyserver
# when verifying signatures or when importing keys that
# have been revoked by a revocation key that is not
# present on the keyring.
#
# no-include-attributes = do not include attribute IDs (aka "photo IDs")
# when sending keys to the keyserver.
#keyserver-options auto-key-retrieve
# Uncomment this line to display photo user IDs in key listings and
# when a signature from a key with a photo is verified.
#show-photos
# Use this program to display photo user IDs
#
# %i is expanded to a temporary file that contains the photo.
# %I is the same as %i, but the file isn't deleted afterwards by GnuPG.
# %k is expanded to the key ID of the key.
# %K is expanded to the long OpenPGP key ID of the key.
# %t is expanded to the extension of the image (e.g. "jpg").
# %T is expanded to the MIME type of the image (e.g. "image/jpeg").
# %f is expanded to the fingerprint of the key.
# %% is %, of course.
#
# If %i or %I are not present, then the photo is supplied to the
# viewer on standard input. If your platform supports it, standard
# input is the best way to do this as it avoids the time and effort in
# generating and then cleaning up a secure temp file.
#
# The default program is "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin"
# On Mac OS X and Windows, the default is to use your regular JPEG image
# viewer.
#
# Some other viewers:
# photo-viewer "qiv %i"
# photo-viewer "ee %i"
# photo-viewer "display -title 'KeyID 0x%k'"
#
# This one saves a copy of the photo ID in your home directory:
# photo-viewer "cat > ~/photoid-for-key-%k.%t"
#
# Use your MIME handler to view photos:
# photo-viewer "metamail -q -d -b -c %T -s 'KeyID 0x%k' -f GnuPG"
# Because some mailers change lines starting with "From " to ">From "
# it is good to handle such lines in a special way when creating
# cleartext signatures; all other PGP versions do it this way too.
# To enable full OpenPGP compliance you may want to use this option.
#no-escape-from-lines
# Uncomment the following option to get rid of the copyright notice
#no-greeting

View File

@@ -0,0 +1,2 @@
[Command]
Logout=lxde-logout

View File

@@ -0,0 +1,163 @@
# lxpanel <profile> config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.
Global {
edge=bottom
allign=left
margin=0
widthtype=percent
width=100
height=26
transparent=0
tintcolor=#000000
alpha=0
setdocktype=1
setpartialstrut=1
usefontcolor=1
fontcolor=#ffffff
background=1
backgroundfile=/usr/share/lxpanel/images/background.png
}
Plugin {
type=space
Config {
Size=2
}
}
Plugin {
type=menu
Config {
image=/usr/share/lxde/images/lxde-icon.png
system {
}
separator {
}
item {
command=run
}
separator {
}
item {
image=gnome-logout
command=logout
}
}
}
Plugin {
type=launchbar
Config {
Button {
id=pcmanfm.desktop
}
}
}
Plugin {
type=space
Config {
Size=4
}
}
Plugin {
type=wincmd
Config {
Button1=iconify
Button2=shade
}
}
Plugin {
type=space
Config {
Size=10
}
}
Plugin {
type=launchbar
Config {
Button {
id=menu://applications/Internet/google-chrome.desktop
}
Button {
id=/usr/share/applications/terminator.desktop
}
Button {
id=/usr/share/applications/slack.desktop
}
Button {
id=/usr/share/applications/telegramdesktop.desktop
}
Button {
id=/usr/share/applications/spotify.desktop
}
Button {
id=/usr/share/applications/discord-canary.desktop
}
Button {
id=menu://applications/chrome-apps/chrome-hmjkmjkepdijhoojdojkdfohbdgmmhki-Default.desktop
}
Button {
id=/usr/share/applications/synergy.desktop
}
Button {
id=menu://applications/System/lxtask.desktop
}
}
}
Plugin {
type=space
Config {
Size=4
}
}
Plugin {
type=taskbar
expand=1
Config {
tooltips=1
IconsOnly=0
AcceptSkipPager=1
ShowIconified=1
ShowMapped=1
ShowAllDesks=0
UseMouseWheel=1
UseUrgencyHint=1
FlatButton=0
MaxTaskWidth=150
spacing=1
}
}
Plugin {
type=netstat
Config {
}
}
Plugin {
type=cpu
Config {
}
}
Plugin {
type=tray
Config {
}
}
Plugin {
type=dclock
Config {
ClockFmt=%R:%S
TooltipFmt=%A %x
BoldFont=0
IconOnly=0
CenterText=0
}
}
Plugin {
type=launchbar
Config {
Button {
id=lxde-screenlock.desktop
}
Button {
id=lxde-logout.desktop
}
}
}

View File

@@ -0,0 +1,4 @@
[special_cases]
synaptic=synaptic-pkexec
soffice.bin=libreoffice
x-terminal-emulator=lxterminal

View File

@@ -0,0 +1,4 @@
compton &
conky &
numlockx &
redshift &

View File

@@ -0,0 +1,756 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
<!-- always try to focus new windows when they appear. other rules do
apply -->
<followMouse>no</followMouse>
<!-- move focus to a window when you move the mouse into it -->
<focusLast>yes</focusLast>
<!-- focus the last used window when changing desktops, instead of the one
under the mouse pointer. when followMouse is enabled -->
<underMouse>no</underMouse>
<!-- move focus under the mouse, even when the mouse is not moving -->
<focusDelay>200</focusDelay>
<!-- when followMouse is enabled, the mouse must be inside the window for
this many milliseconds (1000 = 1 sec) before moving focus to it -->
<raiseOnFocus>no</raiseOnFocus>
<!-- when followMouse is enabled, and a window is given focus by moving the
mouse into it, also raise the window -->
</focus>
<placement>
<policy>Smart</policy>
<!-- 'Smart' or 'UnderMouse' -->
<center>yes</center>
<!-- whether to place windows in the center of the free area found or
the top left corner -->
<monitor>Any</monitor>
<!-- with Smart placement on a multi-monitor system, try to place new windows
on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
the active window is -->
</placement>
<theme>
<name>Onyx</name>
<titleLayout>NLIMC</titleLayout>
<!--
available characters are NDSLIMC, each can occur at most once.
N: window icon
L: window label (AKA title).
I: iconify
M: maximize
C: close
S: shade (roll up/down)
D: omnipresent (on all desktops).
-->
<keepBorder>yes</keepBorder>
<animateIconify>yes</animateIconify>
<font place="ActiveWindow">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="InactiveWindow">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="MenuHeader">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>normal</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="MenuItem">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>normal</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="OnScreenDisplay">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="ActiveOnScreenDisplay">
<name>Sans</name>
<size>8</size>
<weight/>
<slant/>
</font>
<font place="InactiveOnScreenDisplay">
<name>Sans</name>
<size>8</size>
<weight/>
<slant/>
</font>
</theme>
<desktops>
<!-- this stuff is only used at startup, pagers allow you to change them
during a session
these are default values to use when other ones are not already set
by other applications, or saved in your session
use obconf if you want to change these without having to log out
and back in -->
<number>2</number>
<firstdesk>1</firstdesk>
<names>
<!-- set names up here if you want to, like this:
<name>desktop 1</name>
<name>desktop 2</name>
-->
</names>
<popupTime>875</popupTime>
<!-- The number of milliseconds to show the popup for when switching
desktops. Set this to 0 to disable the popup. -->
</desktops>
<resize>
<drawContents>yes</drawContents>
<popupShow>Nonpixel</popupShow>
<!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
<popupPosition>Center</popupPosition>
<!-- 'Center', 'Top', or 'Fixed' -->
<popupFixedPosition>
<!-- these are used if popupPosition is set to 'Fixed' -->
<x>10</x>
<!-- positive number for distance from left edge, negative number for
distance from right edge, or 'Center' -->
<y>10</y>
<!-- positive number for distance from top edge, negative number for
distance from bottom edge, or 'Center' -->
</popupFixedPosition>
</resize>
<!-- You can reserve a portion of your screen where windows will not cover when
they are maximized, or when they are initially placed.
Many programs reserve space automatically, but you can use this in other
cases. -->
<margins>
<top>0</top>
<bottom>0</bottom>
<left>0</left>
<right>0</right>
</margins>
<dock>
<position>TopLeft</position>
<!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
<floatingX>0</floatingX>
<floatingY>0</floatingY>
<noStrut>no</noStrut>
<stacking>Above</stacking>
<!-- 'Above', 'Normal', or 'Below' -->
<direction>Vertical</direction>
<!-- 'Vertical' or 'Horizontal' -->
<autoHide>no</autoHide>
<hideDelay>300</hideDelay>
<!-- in milliseconds (1000 = 1 second) -->
<showDelay>300</showDelay>
<!-- in milliseconds (1000 = 1 second) -->
<moveButton>Middle</moveButton>
<!-- 'Left', 'Middle', 'Right' -->
</dock>
<keyboard>
<chainQuitKey>C-g</chainQuitKey>
<!-- Keybindings for desktop switching -->
<keybind key="C-A-Left">
<action name="DesktopLeft">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="C-A-Right">
<action name="DesktopRight">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="C-A-Up">
<action name="DesktopUp">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="C-A-Down">
<action name="DesktopDown">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Left">
<action name="SendToDesktopLeft">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Right">
<action name="SendToDesktopRight">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Up">
<action name="SendToDesktopUp">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="S-A-Down">
<action name="SendToDesktopDown">
<dialog>no</dialog>
<wrap>no</wrap>
</action>
</keybind>
<keybind key="W-F1">
<action name="Desktop">
<desktop>1</desktop>
</action>
</keybind>
<keybind key="W-F2">
<action name="Desktop">
<desktop>2</desktop>
</action>
</keybind>
<keybind key="W-F3">
<action name="Desktop">
<desktop>3</desktop>
</action>
</keybind>
<keybind key="W-F4">
<action name="Desktop">
<desktop>4</desktop>
</action>
</keybind>
<keybind key="W-d">
<action name="ToggleShowDesktop"/>
</keybind>
<keybind key="C-A-d">
<action name="ToggleShowDesktop"/>
</keybind>
<!-- Keybindings for windows -->
<keybind key="A-F4">
<action name="Close"/>
</keybind>
<keybind key="A-Escape">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</keybind>
<keybind key="A-space">
<action name="ShowMenu">
<menu>client-menu</menu>
</action>
</keybind>
<!-- Keybindings for window switching -->
<keybind key="A-Tab">
<action name="NextWindow"/>
</keybind>
<keybind key="A-S-Tab">
<action name="PreviousWindow"/>
</keybind>
<keybind key="C-A-Tab">
<action name="NextWindow">
<panels>yes</panels>
<desktop>yes</desktop>
</action>
</keybind>
<!-- Keybindings for running applications -->
<keybind key="W-e">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>PCManFM</name>
</startupnotify>
<command>pcmanfm</command>
</action>
</keybind>
<!--keybindings for LXPanel -->
<keybind key="W-r">
<action name="Execute">
<command>lxpanelctl run</command>
</action>
</keybind>
<keybind key="A-F2">
<action name="Execute">
<command>lxpanelctl run</command>
</action>
</keybind>
<keybind key="C-Escape">
<action name="Execute">
<command>lxpanelctl menu</command>
</action>
</keybind>
<keybind key="A-F1">
<action name="Execute">
<command>lxpanelctl menu</command>
</action>
</keybind>
<keybind key="A-F11">
<action name="ToggleFullscreen"/>
</keybind>
<!-- Launch Task Manager with Ctrl+Alt+Del -->
<keybind key="A-C-Delete">
<action name="Execute">
<command>lxtask</command>
</action>
</keybind>
<!-- Launch gnome-screenshot when PrintScreen is pressed -->
<keybind key="Print">
<action name="Execute">
<command>gnome-screenshot -i</command>
</action>
</keybind>
<!-- Launch LXRandR when Fn+Screen is pressed -->
<keybind key="XF86Display">
<action name="Execute">
<command>lxrandr</command>
</action>
</keybind>
</keyboard>
<mouse>
<dragThreshold>8</dragThreshold>
<!-- number of pixels the mouse must move before a drag begins -->
<doubleClickTime>200</doubleClickTime>
<!-- in milliseconds (1000 = 1 second) -->
<screenEdgeWarpTime>400</screenEdgeWarpTime>
<!-- Time before changing desktops when the pointer touches the edge of the
screen while moving a window, in milliseconds (1000 = 1 second).
Set this to 0 to disable warping -->
<context name="Frame">
<mousebind button="A-Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="A-Left" action="Click">
<action name="Unshade"/>
</mousebind>
<mousebind button="A-Left" action="Drag">
<action name="Move"/>
</mousebind>
<mousebind button="A-Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="A-Right" action="Drag">
<action name="Resize"/>
</mousebind>
<mousebind button="A-Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
<mousebind button="C-A-Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="C-A-Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
<mousebind button="A-S-Up" action="Click">
<action name="SendToDesktopPrevious"/>
</mousebind>
<mousebind button="A-S-Down" action="Click">
<action name="SendToDesktopNext"/>
</mousebind>
</context>
<context name="Titlebar">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Move"/>
</mousebind>
<mousebind button="Left" action="DoubleClick">
<action name="ToggleMaximizeFull"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="Up" action="Click">
<action name="Shade"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
<action name="Lower"/>
</mousebind>
<mousebind button="Down" action="Click">
<action name="Unshade"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu">
<menu>client-menu</menu>
</action>
</mousebind>
</context>
<context name="Top">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize">
<edge>top</edge>
</action>
</mousebind>
</context>
<context name="Left">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize">
<edge>left</edge>
</action>
</mousebind>
</context>
<context name="Right">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize">
<edge>right</edge>
</action>
</mousebind>
</context>
<context name="Bottom">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize">
<edge>bottom</edge>
</action>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu">
<menu>client-menu</menu>
</action>
</mousebind>
</context>
<context name="BLCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize"/>
</mousebind>
</context>
<context name="BRCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize"/>
</mousebind>
</context>
<context name="TLCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize"/>
</mousebind>
</context>
<context name="TRCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize"/>
</mousebind>
</context>
<context name="Client">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
</context>
<context name="Icon">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
<action name="ShowMenu">
<menu>client-menu</menu>
</action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu">
<menu>client-menu</menu>
</action>
</mousebind>
</context>
<context name="AllDesktops">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleOmnipresent"/>
</mousebind>
</context>
<context name="Shade">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleShade"/>
</mousebind>
</context>
<context name="Iconify">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="Iconify"/>
</mousebind>
</context>
<context name="Maximize">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleMaximizeFull"/>
</mousebind>
<mousebind button="Middle" action="Click">
<action name="ToggleMaximizeVert"/>
</mousebind>
<mousebind button="Right" action="Click">
<action name="ToggleMaximizeHorz"/>
</mousebind>
</context>
<context name="Close">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="Close"/>
</mousebind>
</context>
<context name="Desktop">
<mousebind button="Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
<mousebind button="C-A-Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="C-A-Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
</context>
<context name="Root">
<!-- Menus -->
<mousebind button="Middle" action="Press">
<action name="ShowMenu">
<menu>client-list-combined-menu</menu>
</action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="ShowMenu">
<menu>root-menu</menu>
</action>
</mousebind>
</context>
<context name="MoveResize">
<mousebind button="Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="DesktopPrevious"/>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="DesktopNext"/>
</mousebind>
</context>
</mouse>
<menu>
<!-- You can specify more than one menu file in here and they are all loaded,
just don't make menu ids clash or, well, it'll be kind of pointless -->
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<file>/usr/share/lxde/openbox/menu.xml</file>
<hideDelay>200</hideDelay>
<!-- if a press-release lasts longer than this setting (in milliseconds), the
menu is hidden again -->
<middle>no</middle>
<!-- center submenus vertically about the parent entry -->
<submenuShowDelay>100</submenuShowDelay>
<!-- this one is easy, time to delay before showing a submenu after hovering
over the parent entry -->
<applicationIcons>yes</applicationIcons>
<!-- controls if icons appear in the client-list-(combined-)menu -->
<manageDesktops>yes</manageDesktops>
<!-- show the manage desktops section in the client-list-(combined-)menu -->
</menu>
<applications>
<!--
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
<application name="first element of window's WM_CLASS property (see xprop)"
class="second element of window's WM_CLASS property (see xprop)"
role="the window's WM_WINDOW_ROLE property (see xprop)">
# the name or the class can be set, or both. this is used to match
# windows when they appear. role can optionally be set as well, to
# further restrict your matches.
# the name, class, and role use simple wildcard matching such as those
# used by a shell. you can use * to match any characters and ? to match
# any single character.
# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list
# each element can be left out or set to 'default' to specify to not
# change that attribute of the window
<decor>yes</decor>
# enable or disable window decorations
<shade>no</shade>
# make the window shaded when it appears, or not
<position>
# the position is only used if both an x and y coordinate are provided
# (and not set to 'default')
<x>center</x>
# a number like 50, or 'center' to center on screen. use a negative number
# to start from the right (or bottom for <y>), ie -50 is 50 pixels from the
# right edge (or bottom).
<y>200</y>
<monitor>1</monitor>
# specifies the monitor in a xinerama setup.
# 1 is the first head, or 'mouse' for wherever the mouse is
</position>
<focus>yes</focus>
# if the window should try be given focus when it appears. if this is set
# to yes it doesn't guarantee the window will be given focus. some
# restrictions may apply, but Openbox will try to
<desktop>1</desktop>
# 1 is the first desktop, 'all' for all desktops
<layer>normal</layer>
# 'above', 'normal', or 'below'
<iconic>no</iconic>
# make the window iconified when it appears, or not
<skip_pager>no</skip_pager>
# asks to not be shown in pagers
<skip_taskbar>no</skip_taskbar>
# asks to not be shown in taskbars. window cycling actions will also
# skip past such windows
<fullscreen>yes</fullscreen>
# make the window in fullscreen mode when it appears
<maximized>true</maximized>
# 'Horizontal', 'Vertical' or boolean (yes/no)
</application>
# end of the example
-->
</applications>
</openbox_config>

View File

@@ -0,0 +1,9 @@
<keybind key="W-x">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>oblogut</name>
</startupnotify>
<command>oblogout</command>
</action>
</keybind>

View File

@@ -0,0 +1,3 @@
# Compile in tmpfs
BUILDDIR=/tmp/makepkg
PKGDEST=~/.packages

View File

@@ -0,0 +1,630 @@
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
# values can be found in the PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, or use "pg_ctl reload". Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# "postgres -c log_connections=on". Some parameters can be changed at run time
# with the "SET" SQL command.
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days
#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
#data_directory = 'ConfigDir' # use data in another directory
# (change requires restart)
#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
# (change requires restart)
#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = '' # write an extra PID file
# (change requires restart)
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = '/run/postgresql' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
# - Security and Authentication -
#authentication_timeout = 1min # 1s-600s
#ssl = off # (change requires restart)
#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
# (change requires restart)
#ssl_prefer_server_ciphers = on # (change requires restart)
#ssl_ecdh_curve = 'prime256v1' # (change requires restart)
#ssl_cert_file = 'server.crt' # (change requires restart)
#ssl_key_file = 'server.key' # (change requires restart)
#ssl_ca_file = '' # (change requires restart)
#ssl_crl_file = '' # (change requires restart)
#password_encryption = on
#db_user_namespace = off
#row_security = on
# GSSAPI using Kerberos
#krb_server_keyfile = ''
#krb_caseins_users = off
# - TCP Keepalives -
# see "man 7 tcp" for details
#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------
# - Memory -
shared_buffers = 128MB # min 128kB
# (change requires restart)
#huge_pages = try # on, off, or try
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
# (change requires restart)
# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
# It is not advisable to set max_prepared_transactions nonzero unless you
# actively intend to use prepared transactions.
#work_mem = 4MB # min 64kB
#maintenance_work_mem = 64MB # min 1MB
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#max_stack_depth = 2MB # min 100kB
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# use none to disable dynamic shared memory
# - Disk -
#temp_file_limit = -1 # limits per-session temp file space
# in kB, or -1 for no limit
# - Kernel Resource Usage -
#max_files_per_process = 1000 # min 25
# (change requires restart)
#shared_preload_libraries = '' # (change requires restart)
# - Cost-Based Vacuum Delay -
#vacuum_cost_delay = 0 # 0-100 milliseconds
#vacuum_cost_page_hit = 1 # 0-10000 credits
#vacuum_cost_page_miss = 10 # 0-10000 credits
#vacuum_cost_page_dirty = 20 # 0-10000 credits
#vacuum_cost_limit = 200 # 1-10000 credits
# - Background Writer -
#bgwriter_delay = 200ms # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
# - Asynchronous Behavior -
#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
#max_worker_processes = 8
#------------------------------------------------------------------------------
# WRITE AHEAD LOG
#------------------------------------------------------------------------------
# - Settings -
#wal_level = minimal # minimal, archive, hot_standby, or logical
# (change requires restart)
#fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level;
# off, local, remote_write, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync (default on Linux)
# fsync
# fsync_writethrough
# open_sync
#full_page_writes = on # recover from partial page writes
#wal_compression = off # enable compression of full-page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
# - Checkpoints -
#checkpoint_timeout = 5min # range 30s-1h
#max_wal_size = 1GB
#min_wal_size = 80MB
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
#checkpoint_warning = 30s # 0 disables
# - Archiving -
#archive_mode = off # enables archiving; off, on, or always
# (change requires restart)
#archive_command = '' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables
#------------------------------------------------------------------------------
# REPLICATION
#------------------------------------------------------------------------------
# - Sending Server(s) -
# Set these on the master and on any standby that will send replication data.
#max_wal_senders = 0 # max number of walsender processes
# (change requires restart)
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s # in milliseconds; 0 disables
#max_replication_slots = 0 # max number of replication slots
# (change requires restart)
#track_commit_timestamp = off # collect timestamp of transaction commit
# (change requires restart)
# - Master Server -
# These settings are ignored on a standby server.
#synchronous_standby_names = '' # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); '*' = all
#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
# - Standby Servers -
# These settings are ignored on a master server.
#hot_standby = off # "on" allows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
# -1 allows indefinite delay
#max_standby_streaming_delay = 30s # max delay before canceling queries
# when reading streaming WAL;
# -1 allows indefinite delay
#wal_receiver_status_interval = 10s # send replies at least this often
# 0 disables
#hot_standby_feedback = off # send info from standby to prevent
# query conflicts
#wal_receiver_timeout = 60s # time that receiver waits for
# communication from master
# in milliseconds; 0 disables
#wal_retrieve_retry_interval = 5s # time to wait before retrying to
# retrieve WAL after a failed attempt
#------------------------------------------------------------------------------
# QUERY TUNING
#------------------------------------------------------------------------------
# - Planner Method Configuration -
#enable_bitmapscan = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_indexscan = on
#enable_indexonlyscan = on
#enable_material = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on
# - Planner Cost Constants -
#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
#effective_cache_size = 4GB
# - Genetic Query Optimizer -
#geqo = on
#geqo_threshold = 12
#geqo_effort = 5 # range 1-10
#geqo_pool_size = 0 # selects default based on effort
#geqo_generations = 0 # selects default based on effort
#geqo_selection_bias = 2.0 # range 1.5-2.0
#geqo_seed = 0.0 # range 0.0-1.0
# - Other Planner Options -
#default_statistics_target = 100 # range 1-10000
#constraint_exclusion = partition # on, off, or partition
#cursor_tuple_fraction = 0.1 # range 0.0-1.0
#from_collapse_limit = 8
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOIN clauses
#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------
# - Where to Log -
#log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
# This is used when logging to stderr:
#logging_collector = off # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)
# These are only used if logging_collector is on:
#log_directory = 'pg_log' # directory where log files are written,
# can be absolute or relative to PGDATA
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
# can include strftime() escapes
#log_file_mode = 0600 # creation mode for log files,
# begin with 0 to use octal notation
#log_truncate_on_rotation = off # If on, an existing log file with the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
#log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
#log_rotation_size = 10MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
# This is only relevant when logging to eventlog (win32):
#event_source = 'PostgreSQL'
# - When to Log -
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
#log_line_prefix = '' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = 'none' # none, ddl, mod, all
#log_replication_commands = off
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = 'Canada/Eastern'
# - Process Title -
#cluster_name = '' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
#------------------------------------------------------------------------------
# RUNTIME STATISTICS
#------------------------------------------------------------------------------
# - Query/Index Statistics Collector -
#track_activities = on
#track_counts = on
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
stats_temp_directory = '/run/postgresql'
# - Statistics Monitoring -
#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#log_statement_stats = off
#------------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------
#autovacuum = on # Enable autovacuum subprocess? 'on'
# requires track_counts to also be on.
#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 50 # min number of row updates before
# vacuum
#autovacuum_analyze_threshold = 50 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
# before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------
# - Statement Behavior -
#search_path = '"$user", public' # schema names
#default_tablespace = '' # a tablespace name, '' uses the default
#temp_tablespaces = '' # a list of tablespace names, '' uses
# only default tablespace
#check_function_bodies = on
#default_transaction_isolation = 'read committed'
#default_transaction_read_only = off
#default_transaction_deferrable = off
#session_replication_role = 'origin'
#statement_timeout = 0 # in milliseconds, 0 is disabled
#lock_timeout = 0 # in milliseconds, 0 is disabled
#vacuum_freeze_min_age = 50000000
#vacuum_freeze_table_age = 150000000
#vacuum_multixact_freeze_min_age = 5000000
#vacuum_multixact_freeze_table_age = 150000000
#bytea_output = 'hex' # hex, escape
#xmlbinary = 'base64'
#xmloption = 'content'
#gin_fuzzy_search_limit = 0
#gin_pending_list_limit = 4MB
# - Locale and Formatting -
datestyle = 'iso, dmy'
#intervalstyle = 'postgres'
timezone = 'Canada/Eastern'
#timezone_abbreviations = 'Default' # Select the set of available time zone
# abbreviations. Currently, there are
# Default
# Australia (historical usage)
# India
# You can create your own file in
# share/timezonesets/.
#extra_float_digits = 0 # min -15, max 3
#client_encoding = sql_ascii # actually, defaults to database
# encoding
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'en_CA.UTF-8' # locale for system error message
# strings
lc_monetary = 'en_CA.UTF-8' # locale for monetary formatting
lc_numeric = 'en_CA.UTF-8' # locale for number formatting
lc_time = 'en_CA.UTF-8' # locale for time formatting
# default configuration for text search
default_text_search_config = 'pg_catalog.english'
# - Other Defaults -
#dynamic_library_path = '$libdir'
#local_preload_libraries = ''
#session_preload_libraries = ''
#------------------------------------------------------------------------------
# LOCK MANAGEMENT
#------------------------------------------------------------------------------
#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
# (change requires restart)
# Note: Each lock table slot uses ~270 bytes of shared memory, and there are
# max_locks_per_transaction * (max_connections + max_prepared_transactions)
# lock table slots.
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
#------------------------------------------------------------------------------
# VERSION/PLATFORM COMPATIBILITY
#------------------------------------------------------------------------------
# - Previous PostgreSQL Versions -
#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#default_with_oids = off
#escape_string_warning = on
#lo_compat_privileges = off
#operator_precedence_warning = off
#quote_all_identifiers = off
#sql_inheritance = on
#standard_conforming_strings = on
#synchronize_seqscans = on
# - Other Platforms and Clients -
#transform_null_equals = off
#------------------------------------------------------------------------------
# ERROR HANDLING
#------------------------------------------------------------------------------
#exit_on_error = off # terminate session on any error?
#restart_after_crash = on # reinitialize after backend crash?
#------------------------------------------------------------------------------
# CONFIG FILE INCLUDES
#------------------------------------------------------------------------------
# These options allow settings to be loaded from files other than the
# default postgresql.conf.
#include_dir = 'conf.d' # include files ending in '.conf' from
# directory 'conf.d'
#include_if_exists = 'exists.conf' # include file only if it exists
#include = 'special.conf' # include file
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
# Add settings for extensions here

View File

@@ -0,0 +1,56 @@
#
# $XDG_HOME_CONFIG/psd/psd.conf
#
# For documentation, refer to the psd man page or the wiki page
# https://wiki.archlinux.org/index.php/Profile-sync-daemon
## NOTE the following:
## To protect data from corruption, in the event that you do make an edit while
## psd is active, any changes made will be applied the next time you start psd.
# Uncomment and set to "yes" to use overlayfs instead of a full copy to reduce
# the memory costs and to improve sync/unsync operations. Note that your kernel
# MUST have this module available in order to use this mode
#
USE_OVERLAYFS="yes"
# List browsers separated by spaces to include in the sync. Useful if you do not
# wish to have all possible browser profiles sync'ed which is the default if
# this variable is left commented.
#
# Possible values:
# chromium
# chromium-dev
# conkeror.mozdev.org
# epiphany
# firefox
# firefox-trunk
# google-chrome
# google-chrome-beta
# google-chrome-unstable
# heftig-aurora
# icecat
# inox
# luakit
# midori
# opera
# opera-beta
# opera-developer
# opera-legacy
# otter-browser
# qupzilla
# palemoon
# rekonq
# seamonkey
# vivaldi
# vivaldi-snapshot
#
#BROWSERS=""
# Uncomment and set to "no" to completely disable the crash recovery feature.
#
# The default is to create crash recovery backups if the system is ungracefully
# powered-down due to a kernel panic, hitting the reset switch, battery going
# dead, etc. Some users keep very diligent backups and don't care to have this
# feature enabled.
#USE_BACKUPS="yes"

View File

@@ -0,0 +1,44 @@
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500
; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature
transition=1
; Set the screen brightness. Default is 1.0
;brightness=0.9
; It is also possible to use different settings for day and night since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel individually)
gamma=0.8
;gamma=0.8:0.7:0.8
; Set the location-provider: 'geoclue', 'gnome-clock', 'manual'
; type 'redshift -l list' to see possible values
; The location provider settings are in a different section.
location-provider=manual
; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values
; 'randr' is the preferred method, 'vidmode' is an older API
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr
; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings
; e.g. 'redshift -l manual:help'
[manual]
lat=43.42
lon=-79.24
; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings
; ex: 'redshift -m randr:help'
[randr]
screen=0

View File

@@ -0,0 +1,265 @@
[global_config]
enabled_plugins = LaunchpadCodeURLHandler, SearchGoogle, APTURLHandler, LaunchpadBugURLHandler
inactive_color_offset = 0.79
suppress_multiple_term_dialog = True
title_hide_sizetext = True
window_state = maximise
[keybindings]
close_term = <Primary>w
insert_number = None
new_tab = <Primary>t
paste = <Primary>v
rotate_cw = <Primary><Shift>r
split_horiz = <Primary><Shift>d
split_vert = <Primary>d
switch_to_tab_1 = <Super>1
switch_to_tab_10 = <Super>0
switch_to_tab_2 = <Super>2
switch_to_tab_3 = <Super>3
switch_to_tab_4 = <Super>4
switch_to_tab_5 = <Super>5
switch_to_tab_6 = <Super>6
switch_to_tab_7 = <Super>7
switch_to_tab_8 = <Super>8
switch_to_tab_9 = <Super>9
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
[[[window0]]]
parent = ""
type = Window
[[Dive]]
[[[child0]]]
fullscreen = False
last_active_window = True
maximised = True
order = 0
parent = ""
position = 0:0
size = 1920, 1031
title = /bin/zsh
type = Window
[[[child1]]]
active_page = 0
labels = None, None
last_active_term = d64ba4f9-edb7-4ced-942e-49a69033480f, 4f4cffb2-74fa-4d07-a7b4-c5f30ece39b2
order = 0
parent = child0
type = Notebook
[[[child2]]]
order = 0
parent = child1
position = 958
ratio = 0.49921875
type = HPaned
[[[child3]]]
order = 0
parent = child2
position = 502
ratio = 0.5
type = VPaned
[[[child6]]]
order = 1
parent = child2
position = 502
ratio = 0.5
type = VPaned
[[[child7]]]
order = 0
parent = child6
position = 251
ratio = 0.500996015936
type = VPaned
[[[terminal10]]]
command = lein repl; zsh
directory = /home/michael/.work-files/dive-networks/dive-web-app/
order = 1
parent = child6
profile = default
type = Terminal
uuid = a51152d4-6cb9-4d72-97fc-39bdf1376818
[[[terminal11]]]
command = ""
directory = /home/michael/.work-files/dive-networks/dive-web-app/
order = 1
parent = child1
profile = default
type = Terminal
uuid = 4f4cffb2-74fa-4d07-a7b4-c5f30ece39b2
[[[terminal4]]]
command = ""
directory = /home/michael/.work-files/dive-networks/dive-web-app/
order = 0
parent = child3
profile = default
type = Terminal
uuid = d64ba4f9-edb7-4ced-942e-49a69033480f
[[[terminal5]]]
command = tail -f figwheel_server.log; zsh
directory = /home/michael/.work-files/dive-networks/dive-web-app/
order = 1
parent = child3
profile = default
type = Terminal
uuid = 41f364c3-36b4-4af5-b999-2b2141b85319
[[[terminal8]]]
command = htop; zsh
directory = /home/michael/.work-files/dive-networks/dive-web-app/
order = 0
parent = child7
profile = default
type = Terminal
uuid = 5e14119d-8778-4226-a424-b9c5eca80292
[[[terminal9]]]
command = lein dev-css; zsh
directory = /home/michael/.work-files/dive-networks/dive-web-app/
order = 1
parent = child7
profile = default
type = Terminal
uuid = 8eec6a48-cbfb-449c-b49e-704da6e5996d
[[nightdive]]
[[[child0]]]
fullscreen = False
last_active_window = True
maximised = True
order = 0
parent = ""
position = 0:0
size = 1920, 1032
title = /bin/zsh
type = Window
[[[child1]]]
active_page = 1
labels = None, None
last_active_term = d64ba4f9-edb7-4ced-942e-49a69033480f, 4f4cffb2-74fa-4d07-a7b4-c5f30ece39b2
order = 0
parent = child0
type = Notebook
[[[child12]]]
order = 1
parent = child6
position = 534
ratio = 0.508079847909
type = HPaned
[[[child2]]]
order = 0
parent = child1
position = 867
ratio = 0.451822916667
type = HPaned
[[[child3]]]
order = 0
parent = child2
position = 502
ratio = 0.499502982107
type = VPaned
[[[child6]]]
order = 1
parent = child2
position = 502
ratio = 0.499502982107
type = VPaned
[[[child7]]]
order = 0
parent = child6
position = 250
ratio = 0.499003984064
type = VPaned
[[[child9]]]
order = 1
parent = child7
position = 534
ratio = 0.508079847909
type = HPaned
[[[terminal10]]]
order = 0
parent = child9
profile = default
type = Terminal
uuid = 8eec6a48-cbfb-449c-b49e-704da6e5996d
[[[terminal11]]]
order = 1
parent = child9
profile = default
type = Terminal
uuid = 4d558fe8-344a-47dd-8ccf-c17d1d796de4
[[[terminal13]]]
order = 0
parent = child12
profile = default
type = Terminal
uuid = a51152d4-6cb9-4d72-97fc-39bdf1376818
[[[terminal14]]]
order = 1
parent = child12
profile = default
type = Terminal
uuid = c1af7bb4-a6b9-4839-bf52-ed97a91a91c5
[[[terminal15]]]
directory = /home/michael/
order = 1
parent = child1
profile = default
type = Terminal
uuid = 4f4cffb2-74fa-4d07-a7b4-c5f30ece39b2
[[[terminal4]]]
order = 0
parent = child3
profile = default
type = Terminal
uuid = d64ba4f9-edb7-4ced-942e-49a69033480f
[[[terminal5]]]
order = 1
parent = child3
profile = default
type = Terminal
uuid = 41f364c3-36b4-4af5-b999-2b2141b85319
[[[terminal8]]]
order = 0
parent = child7
profile = default
type = Terminal
uuid = 5e14119d-8778-4226-a424-b9c5eca80292
[plugins]
[[GrepEditor]]
command = vim +{line} {filepath}
groups = file line
match = ([^ \t\n\r\f\v:]+?):([0-9]+)
[profiles]
[[default]]
background_color = "#060505"
background_darkness = 0.81
background_image = None
copy_on_selection = True
cursor_color = "#bbbbbb"
font = Consolas 10
foreground_color = "#d1c6ca"
palette = "#0a1b26:#bb0000:#7c00ff:#bbbb00:#00ff08:#00cdd7:#10bba2:#c8cac8:#545c7a:#ff5555:#ceef00:#ffe5f5:#5555ff:#ff6ddd:#2eb0ff:#f7fbff"
scrollback_lines = 20000
use_system_font = False
[[iterm-mike]]
background_color = "#484848"
background_darkness = 0.81
background_image = None
copy_on_selection = True
cursor_color = "#bbbbbb"
cursor_shape = underline
font = Consolas 10
foreground_color = "#d1c6ca"
palette = "#141414:#bb0000:#7c00ff:#bbbb00:#00ff08:#00cdd7:#10bba2:#cacaca:#555555:#ff5555:#ceef00:#ffe5f5:#5555ff:#ff6ddd:#2eb0ff:#f7fbff"
scrollback_lines = 20000
use_system_font = False
[[original]]
background_darkness = 0.81
background_image = None
background_type = transparent
copy_on_selection = True
cursor_color = "#cdcfbd"
cursor_shape = underline
font = DejaVu Sans Mono 12
palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
scrollback_lines = 20000
use_system_font = False

View File

@@ -0,0 +1,55 @@
import gtk
import urllib
import terminatorlib.plugin as plugin
import re
# Written by John Cooper http://choffee.co.uk
# Copyright 2010 John Cooper
# See copyright file that comes with this file for full licence
# Modified by cgw 2011/11/06
# AVAILABLE must contain a list of all the classes that you want exposed
AVAILABLE = ['SearchGoogle']
_spaces = re.compile(" +")
# TODO: move some of the constants into a config object
class SearchGoogle(plugin.Plugin):
capabilities = ['terminal_menu']
def do_search(self, searchMenu):
"""Launch Google search for string"""
if not self.searchstring:
return
base_uri = "http://www.google.com/search?q=%s"
uri = base_uri % urllib.quote(self.searchstring.encode("utf-8"))
gtk.show_uri(None, uri, gtk.gdk.CURRENT_TIME)
def callback(self, menuitems, menu, terminal):
"""Add our menu item to the menu"""
self.terminal = terminal
item = gtk.ImageMenuItem(gtk.STOCK_FIND)
item.connect('activate', self.do_search)
if terminal.vte.get_has_selection():
clip = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
self.searchstring = clip.wait_for_text().strip()
self.searchstring = self.searchstring.replace("\n", " ")
self.searchstring = self.searchstring.replace("\t", " ")
self.searchstring = _spaces.sub(" ", self.searchstring)
else:
self.searchstring = None
if self.searchstring:
if len(self.searchstring) > 40:
displaystring = self.searchstring[:37] + "..."
else:
displaystring = self.searchstring
item.set_label("Search Google for \"%s\"" % displaystring)
item.set_sensitive(True)
else:
item.set_label("Search Google")
item.set_sensitive(False)
# Avoid turning any underscores in selection into menu accelerators
item.set_use_underline(False)
menuitems.append(item)

View File

@@ -0,0 +1,4 @@
clear lock
clear control
add control = Caps_Lock Control_L Control_R
keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol

View File

@@ -0,0 +1,71 @@
# Arch Linux
* `config/` -> map contents to `~/.config`.
* `home/` -> map contents to `~/`.
# Setup
* Full disk encryption with Veracrypt
* Store /tmp in RAM
* Move browser cache directories to /tmp as a means of reducing file writes on SSD
* Fix fonts by placing the following XML into `/etc/fonts/conf.avail/29-prettify.conf`
and then symlinking: `ln -s /etc/fonts/conf.avail/29-prettify.conf /etc/fonts/conf.d/29-prettify.conf`
```
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>rgb</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" >
<const>hintslight</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
</fontconfig>
```
## Map caps to left-ctrl
* Most promising method
* Install `xorg-xmodmap`
* Map `linux/home/Xmodmap` to ~/
* The above taken from https://wiki.archlinux.org/index.php/xmodmap
* Second method: map caps key to left-ctrl (see https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes for details)
* edit `/etc/udev/hwdb.d/10-my-modifiers.hwdb`
* add:
```
evdev:atkbd:dmi:* # built-in keyboard: match all AT keyboards for now
KEYBOARD_KEY_3a=leftctrl # bind capslock to leftctrl
```
* run `udevadm hwdb --update` then reboot
## Install clipboard getter
* `pi xsel`
* Now we can grab clipboard content in vim using `:read !xsel --clipboard --output`

View File

@@ -0,0 +1,5 @@
To install these services first link them to `/etc/systemd/system/`
Next, run `systemctl enable <script-name>.serivoce`
And then finally you can force start with `systemctl start <script-name>.service`

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Remaps the keyboard using xmodmap
[Service]
ExecStart=/home/michael/bin/remap-keyboard.sh
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
find . -type f -print0 | xargs -0 dos2unix -f *.txt *.vim

View File

@@ -0,0 +1,5 @@
#!/bin/bash
xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
xrandr --addmode Virtual1 "1920x1080_60.00"
xrandr --output Virtual1 --mode "1920x1080_60.00"

View File

@@ -0,0 +1,2 @@
#!/bin/sh
xmodmap $HOME/.Xmodmap

View File

@@ -0,0 +1,107 @@
# enable pbcopy and pbpaste
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
set-option -g default-command "reattach-to-user-namespace -l zsh"
# enable pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# disable mouse
setw -g mode-mouse off
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# increase repeat time for repeatable commands
set -g repeat-time 1000
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
###########################
# Key Bindings
###########################
# tmux prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# paste
unbind C-p
bind C-p paste-buffer
# window splitting
unbind %
bind \ split-window -h
unbind '"'
bind - split-window -v
bind C-x kill-window
# resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# create 25% lower split
unbind t
bind t split-window -p 25
# quickly switch panes
unbind ^J
bind ^J select-pane -t :.+
# force reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
setw -g monitor-activity on
set -g visual-activity on
###########################
# Status Bar / Colors
###########################
# enable UTF-8 support in status bar
set -g status-utf8 on
# set refresh interval
set -g status-interval 30
# center the status bar
set -g status-justify left
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# color status bar
set -g status-bg colour235
set -g status-fg white
# show session, window, pane in status bar
set -g status-left-length 40
set -g status-left '#[fg=green]#S#[fg=blue] #I:#P#[default]'
# show hostname, date, and time in status bar
set-option -g status-right '#[fg=green]#H#[default] %m/%d/%y %I:%M'
# highlight current window
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-bg green
# set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg black
set -g pane-active-border-fg green
set -g pane-active-border-bg black

View File

@@ -0,0 +1 @@
export PATH=$HOME/dotfiles/linux/bin:$PATH

30
dotfiles/linux/install Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
source "$HOME/dotfiles/script_helpers/printing.sh"
source "$HOME/dotfiles/script_helpers/core.sh"
source "$HOME/dotfiles/script_helpers/platform.sh"
source "$HOME/dotfiles/script_helpers/file_ops.sh"
#-----------------------------------
# Apt packages
#-----------------------------------
printf "\n${BOLD}Installing apt packages...${NORMAL}\n\n"
apt_packages=(
'tree'
'powershell'
)
sudo apt update
for package in "${apt_packages[@]}"
do
printf "${BOLD}$package${NORMAL}\n"
eval "sudo apt install $package"
printf "\n"
done
printf "\n${BOLD}Finished setting up Linux${NORMAL}\n"

12
dotfiles/macos/README.md Normal file
View File

@@ -0,0 +1,12 @@
# OSX
## Keyboard Remapping
* Remap caps lock to ctrl
* After running the install script, open the Karabiner-Elements app, then go to preferences->Simple
modifications and add a new item that maps `caps_lock` to `left_control`.
* Remap caps lock to esc on tap and ctrl on hold
* After running the install script, follow this guide starting at step 2: https://web.archive.org/web/20200513031048/https://medium.com/@pechyonkin/how-to-map-capslock-to-control-and-escape-on-mac-60523a64022b
* Note: I had some issues with vim sometimes losing the caps lock remap. I just went with the
simple caps->ctrl remap.

View File

@@ -0,0 +1,344 @@
<?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>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.10407876223325729</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.10408065468072891</real>
<key>Red Component</key>
<real>0.10407713800668716</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.10676553100347519</real>
<key>Red Component</key>
<real>0.789775550365448</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.9352957010269165</real>
<key>Red Component</key>
<real>0.83906084299087524</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.96814447641372681</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.92026478052139282</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.44485551118850708</real>
<key>Red Component</key>
<real>0.40937519073486328</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.89426738023757935</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.53544759750366211</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.7495771050453186</real>
<key>Red Component</key>
<real>0.20721414685249329</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.98730450868606567</real>
<key>Red Component</key>
<real>0.97398549318313599</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.21488180756568909</real>
<key>Red Component</key>
<real>0.56881195306777954</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.76959484815597534</real>
<key>Red Component</key>
<real>0.78058648109436035</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0081257615238428116</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.97683507204055786</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.87376910448074341</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.83389490842819214</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.69668179750442505</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.77173703908920288</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.83248633146286011</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.83249682188034058</real>
<key>Red Component</key>
<real>0.83247733116149902</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.4078223705291748</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.40782788395881653</real>
<key>Red Component</key>
<real>0.40781760215759277</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.40569943189620972</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.43035173416137695</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Background Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.136199951171875</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.097943589091300964</real>
<key>Red Component</key>
<real>0.10479909926652908</real>
</dict>
<key>Badge Color</key>
<dict>
<key>Alpha Component</key>
<real>0.5</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.1491314172744751</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Bold Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.93512088060379028</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.99773818254470825</real>
<key>Red Component</key>
<real>0.98610657453536987</real>
</dict>
<key>Cursor Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.60885298252105713</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.6551513671875</real>
<key>Red Component</key>
<real>0.14859268069267273</real>
</dict>
<key>Cursor Guide Color</key>
<dict>
<key>Alpha Component</key>
<real>0.25</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.9268307089805603</real>
<key>Red Component</key>
<real>0.70213186740875244</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.952484130859375</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.952484130859375</real>
<key>Red Component</key>
<real>0.952484130859375</real>
</dict>
<key>Foreground Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.83101433515548706</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.81825464963912964</real>
<key>Red Component</key>
<real>0.85447877645492554</real>
</dict>
<key>Link Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.73423302173614502</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.35916060209274292</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Selected Text Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.919910728931427</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.23837590217590332</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.19493961334228516</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.17409473657608032</real>
<key>Red Component</key>
<real>0.32851743698120117</real>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,32 @@
{
"title": "Change caps_lock to Esc and Control",
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "escape"
}
]
}
]
}
]
}

View File

@@ -0,0 +1,2 @@
export CMAKE_CXX_COMPILER=/Library/Developer/CommandLineTools/usr/bin/c++
export CMAKE_C_COMPILER=/Library/Developer/CommandLineTools/usr/bin/cc

78
dotfiles/macos/install Normal file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env bash
set -e
source "$HOME/dotfiles/script_helpers/printing.sh"
source "$HOME/dotfiles/script_helpers/core.sh"
source "$HOME/dotfiles/script_helpers/platform.sh"
source "$HOME/dotfiles/script_helpers/file_ops.sh"
printf "\n${BOLD}Installing key remap config...${NORMAL}\n"
key_dest=$HOME/.config/karabiner/assets/complex_modifications/
mkdir -p $key_dest
make_link $HOME/dotfiles/osx/capslock-to-ctrl-for-karabiner.json ${key_dest}/custom-capslock.json
#-----------------------------------
# Homebrew packages
#-----------------------------------
printf "\n${BOLD}Installing Homebrew packages...${NORMAL}\n\n"
brew_packages=(
'openssl'
'wget'
'git'
'rlwrap'
'cmake'
'vim'
'sdl'
'tree'
'rmtrash'
)
brew_cask_packages=(
'rectangle'
'karabiner-elements'
)
for package in "${brew_packages[@]}"
do
printf "${BOLD}$package${NORMAL}\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${MAGENTA}==> ${NORMAL}${YELLOW}Already installed!${NORMAL}\n\n"
else
eval "brew install $package"
printf "\n"
fi
done
for package in "${brew_cask_packages[@]}"
do
printf "${BOLD}cask/$package${NORMAL}\n\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${MAGENTA}==> ${NORMAL}${YELLOW}Already installed!${NORMAL}\n\n"
else
eval "brew cask install $package"
printf "\n"
fi
done
# We have issues downloading Rust on 10.11 with the patched Homebrew checkout
# so we'll install it using their script.
bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)"
# For Vim search
cargo install ripgrep
# The homebrew core ctags package is very old.
brew install --HEAD universal-ctags/universal-ctags/universal-ctags
printf "\n${YELLOW}If you haven't already installed the Xcode dev tools then do so now by installing Xcode from the App Store:${NORMAL}\n"
printf "When that finishes open a terminal and run the following:\n"
printf " 1. ${YELLOW}sudo xcode-select --install${NORMAL}\n"
printf " 2. ${YELLOW}sudo xcodebuild -license${NORMAL}\n"
printf " 3. ${YELLOW}sudo xcode-select -s /Applications/Xcode.app/Contents/Developer${NORMAL}\n"
printf "\n${BOLD}Finished setting up OS X${NORMAL}\n"

View File

@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# This is meant to be called from the main dotfiles install script.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
set -e
printf "Installing Homebrew...\n"
# OSX 10.11 and earlier will issue certificate errors when Homebrew attempts to download packages
# with curl. Detect if we're running on 10.11 or earlier and if so use a fork that passes the
# --insecure option to curl.
kernel_major="$(uname -r | sed 's/\..*//')"
case $kernel_major in
15 | 14 | 13) download_patched_homebrew=1 ;;
*) download_patched_homebrew=0 ;;
esac
if [[ $download_patched_homebrew -eq 1 ]]; then
printf "${BOLD}Current MacOS kernel ${NORMAL}${YELLOW}$(uname -r)${NORMAL}${BOLD} requires a patched version of Homebrew...${NORMAL}\n"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/sir-pinecone/brew/master/install.sh)"
else
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
brew tap homebrew/core
printf "\nInstalling bash...\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${YELLOW}Already installed!${NORMAL}\n"
else
eval "brew install bash"
printf "\n${YELLOW}Finished installing updated version of bash.\nYou must now enable it. Run:${NORMAL}\n"
printf " ${BOLD}sudo vim /etc/shells${NORMAL}\n"
printf "${YELLOW}And add ${NORMAL}${BOLD}/usr/local/bin/bash${NORMAL}${YELLOW} to the end of the list. After that close your terminal and re-run the dotfiles install script.${NORMAL}\n"
fi

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
source_helpers="$HOME/dotfiles/script_helpers"
source "$source_helpers/printing.sh"
source "$source_helpers/core.sh"
source "$source_helpers/platform.sh"
source "$source_helpers/file_ops.sh"

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#---------------------------------------------------------------------------------------------------
# API
#---------------------------------------------------------------------------------------------------
get_clang_bin_path() {
declare -n _path=$1
_path="C:\Program Files\LLVM\bin"
if [[ ! -d $_path ]]; then
error "Was unable to find LLVM at "$_path".\n"
exit 1
fi
# Fix up the path
_path="/${_path/:/}" # Remove ':'.
_path="${_path//\\//}" # Remove Windows slashes.
_path="${_path// /\\ }" # Add a backslash before spaces.
# Assuming X64.
printf "${BOLD}${YELLOW}[Clang X64]${NORMAL}\n"
}

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Requires the printing.sh helper to be sourced.
#---------------------------------------------------------------------------------------------------
# API
#---------------------------------------------------------------------------------------------------
abort() {
error "\nAborting...\n"
exit 1
}
# Use this by setting a trap in your script, like so:
# `trap at_exit EXIT`
at_exit() {
ret=$?
if [[ $ret -gt 0 ]]; then
error "The script failed with error $ret.\n"
fi
exit "$ret"
}

View File

@@ -0,0 +1,407 @@
#!/usr/bin/env bash
# Requires the printing.sh helper to be sourced.
# Requires the platform.sh helper to be sourced.
#---------------------------------------------------------------------------------------------------
# API
#---------------------------------------------------------------------------------------------------
strip_trailing_slashes() {
local ret="$1"
shopt -s extglob
ret=$(echo "${ret%%+(/)}")
echo $ret
}
# Will return a symlink path in its expanded form. If the path's root is the
# home directory symbol "~" then it'll be replaced by the full home path.
expand_path() {
local ret="$1"
IFS="/" read -ra parts <<< "$ret"
if [[ "${parts[0]}" == "~" ]]; then
ret="$HOME"
for ((i=1; i < ${#parts[@]}; i++))
do
ret="$ret/${parts[$i]}"
done
fi
ret=$(readlink -m "$ret")
echo $ret
}
# Returned value does not have a trailing '\'.
unix_to_windows_path() {
local ret="$1"
if [[ $(is_windows_path "$ret") -eq 0 ]]; then
if [[ $(is_absolute_unix_path "$ret") -eq 1 ]]; then
ret="${ret/\//}"
# Fix the drive name, e.g. c\foo becomes c:\foo
ret=$(sed 's,\([a-zA-Z]*\),\1:,' <<< "$ret")
fi
ret="${ret////\\}" # Replace Unix slashes.
ret="${ret//\\\(/\(}" # Remove backslash before (.
ret="${ret//\\\)/\)}" # Remove backslash before ).
fi
ret=$(strip_trailing_slashes "$ret")
echo $ret
}
# Returned value does not have a trailing '/'.
# Expects the provided path to be an absolute path (i.e. has been passed through expand_path).
absolute_windows_to_unix_path() {
local ret="$1"
ret="/${ret/:/}" # Remove drive ':'.
ret="${ret//\\//}" # Replace Windows slashes.
ret="${ret// /\\ }" # Add a backslash before spaces.
ret="${ret//\(/\\(}" # Add a backslash before (.
ret="${ret//\)/\\)}" # Add a backslash before ).
ret="${ret/\/\//\/}" # If the passed in path was a unix path then we'll have two leading '/'; strip if it exists.
ret=$(strip_trailing_slashes "$ret")
echo "$ret"
}
# Returns a Unix path without escaped spaces, e.g. "/x/some folder" instead of "/x/some\ folder"
# Will work with a relative or absolute path. The returned path will be expanded.
windows_to_unix_path_unescaped_and_expanded() {
local expanded=$(expand_path "$1")
local ret=$(absolute_windows_to_unix_path "$expanded")
ret="${ret/\\ / }" # Remove '\' that appears before spaces.
echo "$ret"
}
# Returns a Unix path with spaces escaped with a '\'.
escape_unix_path() {
local ret="$1"
ret="${ret/ /\\ }"
echo "$ret"
}
# Returns a Windows path with backslashes escaped so that you can print the path and see the slashes.
escape_backslashes() {
local ret="$1"
ret="${ret/\\/\\\\}"
echo "$ret"
}
# Returns the last part of a path without leading or trailing slashes.
strip_path() {
local result=$(basename "$1")
echo "$result"
}
# Returns a path without the last part. Does not end in a slash.
strip_filename() {
local result=$(dirname "$1")
echo "$result"
}
is_absolute_unix_path() {
if [[ $1 =~ ^/ ]]; then echo 1; else echo 0; fi
}
# Check if the first part of a path is a symlink.
is_first_dir_a_sym_link() {
local path="$1"
IFS="/" parts=( ${path//\/" "} )
local first_dir="${parts[0]}" # will be empty string if path started with slash.
if [[ $first_dir == "" || $first_dir == "." || ! -L $first_dir ]]; then
echo 0
else
echo 1
fi
}
# Check if any part of the path is a symlink. Stops at the first symlink that is found.
is_any_part_of_path_a_symlink() {
local path="$1"
if [[ $(is_absolute_unix_path "$path") -eq 1 ]]; then
echo 0
return
fi
IFS="/" parts=( ${path//\/" "} )
if [[ ${parts[0]} == "" ]]; then
echo 0
return
fi
local at=0
local len=${#parts[@]}
if [[ ${parts[0]} == "." ]]; then
if [[ $len -gt 1 ]]; then
at=1 # Skip the period.
else
echo 0
return
fi
fi
local test_path="${parts[$at]}"
if [[ -L "$test_path" ]]; then
echo 1
return
fi
((at=at+1))
until [ $at -eq $len ]
do
local part=${parts[$at]}
test_path="$test_path/$part"
if [[ -L $test_path ]]; then
echo 1
return
fi
((at=at+1))
done
echo 0
}
# Check if the first part of a path is a dotfile.
is_dotfile() {
if [[ $1 =~ ^\.{1} ]]; then echo 1; else echo 0; fi
}
# We're treating symlinks as Unix paths. This may give us trouble but we'll
# deal with it later should an edge case come up.
is_windows_path() {
if [[ $(is_any_part_of_path_a_symlink "$1") -eq 0 && $1 =~ \\+ ]]; then echo 1; else echo 0; fi
}
is_unix_path() {
echo $(! is_windows_path "$1")
}
path_has_a_space() {
local regexp="[[:blank:]]+"
if [[ $1 =~ $regexp ]]; then echo 1; else echo 0; fi
}
expand_unix_path_if_not_symlink_or_absolute() {
local path="$1"
if [[ $(is_absolute_unix_path "$path") -eq 0 && $(is_any_part_of_path_a_symlink "$path") -eq 0 ]]; then
path=$(expand_path "$path")
fi
echo $path
}
# Moves a single file. Optionally provide a new file name as a third param.
move_file() {
local src="$1"
local src_expanded=$(expand_path "$src")
local dest="$2"
local dest_expanded=$(windows_to_unix_path_unescaped_and_expanded "$dest")
local dest_filename="$3"
if [[ $dest_filename == "" ]]; then
dest_filename=$(strip_path "$src")
fi
if [[ -e "$src_expanded" ]]; then
mkdir -p "$dest_expanded"
local move_dest="$dest_expanded/$dest_filename"
mv "$src_expanded" "$move_dest"
printf "${BOLD}${GREEN}==> ${NORMAL}${BOLD}move: ${YELLOW}'$src'${NORMAL}${BOLD} to\n ${YELLOW}'$move_dest'${NORMAL}\n" 2>/dev/null
else
printf "${BOLD}${RED}==> move: ${YELLOW}'$src' ${RED}doesn't exists${NORMAL}\n"
return
fi
}
# Copies a single file. Optionally provide a new file name as a third param.
# If you want to copy all files with a specific extension then use copy_dir_files.
copy_file() {
local src="$1"
local src_expanded=$(expand_path "$src")
local dest="$2"
local dest_expanded=$(windows_to_unix_path_unescaped_and_expanded "$dest")
local dest_filename="$3"
if [[ $dest_filename == "" ]]; then
dest_filename=$(strip_path "$src_expanded")
fi
if [[ -e "$src_expanded" ]]; then
mkdir -p "$dest_expanded"
local copy_dest="$dest_expanded/$dest_filename"
cp "$src_expanded" "$copy_dest"
printf "${BOLD}${GREEN}==> ${NORMAL}${BOLD}copy: ${YELLOW}'$src'${NORMAL}${BOLD} to\n ${YELLOW}'$copy_dest'${NORMAL}\n" 2>/dev/null
else
printf "${BOLD}${RED}==> copy: ${YELLOW}'$src' ${RED}doesn't exists${NORMAL}\n"
return
fi
}
# Copies a directory. You can restrict which files are copied by passing a wildcard as a third param, e.g. "*.cs"
copy_dir() {
local src="$1"
local src_expanded=$(expand_path "$src")
local dest="$2"
local dest_expanded=$(windows_to_unix_path_unescaped_and_expanded "$dest")
local opt_name_filter="$3"
if [[ -d $src_expanded ]]; then
if [[ $opt_name_filter != "" ]]; then
# Copy all files in source dir with given name filter.
src_dir_name=$(strip_path "$src_expanded")
copy_dest="$dest_expanded/$src_dir_name"
mkdir -p "$copy_dest"
find "$src_expanded" -maxdepth 1 -type f -iname "$opt_name_filter" -print0 |
while IFS= read -r -d '' line; do
dest_filename=$(strip_path "$line")
cp "$line" "$copy_dest"
printf "${BOLD}${GREEN}==> ${NORMAL}${BOLD}copy: ${YELLOW}'$line'${NORMAL}${BOLD} to\n ${YELLOW}'$copy_dest/$dest_filename'${NORMAL}\n" 2>/dev/null
done
else
mkdir -p "$dest_expanded"
# Have to eval in order to retain the backslash.
cmd="cp -r $src_expanded \"$dest_expanded\""
eval $cmd
printf "${BOLD}${GREEN}==> ${NORMAL}${BOLD}copy: ${YELLOW}'$src'${NORMAL}${BOLD} to\n ${YELLOW}'$dest_expanded'${NORMAL}\n" 2>/dev/null
fi
else
printf "${BOLD}${RED}==> copy: ${YELLOW}'$src' ${RED}doesn't exists${NORMAL}\n"
return
fi
}
# Only works with Unix paths.
make_link() {
local src=$1
local dest=$2
local debug=0
os_is_windows is_windows
os_is_unix is_unix
if [[ $is_windows -eq 1 ]]; then
if [[ $(is_windows_path "$src") -eq 1 ]]; then
local escaped_path=$(escape_backslashes "$src")
error "Expected a Unix source path, but got '$escaped_path instead.\n"
return
fi
if [[ $(is_windows_path "$dest") -eq 1 ]]; then
local escaped_path=$(escape_backslashes "$dest")
error "Expected a Unix dest path, but got '$escaped_path' instead.\n"
return
fi
fi
local expand_source_symlink=$3
local overwrite_existing=$4
local require_confirmation=$5
if [[ $overwrite_existing -ne 1 || $overwrite_existing -ne 0 ]]; then
overwrite_existing=$MC_OVERWRITE_EXISTING_SYMLINK
fi
if [[ $debug -eq 1 ]]; then
echo source path: $src
echo dest path: $dest
echo abs unix source: $(is_absolute_unix_path "$src")
echo abs unix dest: $(is_absolute_unix_path "$dest")
echo "overwrite existing? $overwrite_existing"
echo "require_confirmation? $require_confirmation"
echo "expand source symlink? $expand_source_symlink"
fi
local final_src=$src
local final_dest=$dest
if [[ $is_windows -eq 1 ]]; then
if [[ $expand_source_symlink -eq 1 ]]; then
final_src=$(expand_path "$final_src")
else
final_src=$(expand_unix_path_if_not_symlink_or_absolute "$final_src")
# Having issues with mingw symlinking a path in the cwd to a dest that's not in the cwd.
# We prepend the cwd when it's not an absolute path in order to work around the issue.
if [[ $(is_absolute_unix_path "$final_dest") -ne 1 && $(is_dotfile "$final_dest") -ne 1 ]]; then
if [[ $(is_absolute_unix_path "$final_src") -eq 0 ]]; then
final_src="$PWD/$final_src"
fi
fi
fi
final_dest=$(expand_unix_path_if_not_symlink_or_absolute "$final_dest")
fi
local source_has_space=$(path_has_a_space "$final_src")
local dest_has_space=$(path_has_a_space "$final_dest")
if [[ $debug -eq 1 ]]; then
echo "final source: $final_src"
echo "final dest: $final_dest"
echo source has space: $source_has_space
echo dest has space: $dest_has_space
fi
# Verify that the source path exists.
! test -e "$final_src" && printf "${BOLD}${RED}==> symlink: ${YELLOW}'$src' ${RED}doesn't exists${NORMAL}\n" && return
# Verify that the dest path doesn't already exist unless we're overwriting.
if [[ -e "$final_dest" ]]; then
if [[ $overwrite_existing -eq 1 ]]; then
echo "DELETING FINAL DEST: $final_dest | orig: $dest ||| final src: $final_src"
rm "$final_dest"
else
printf "==> symlink: ${BOLD}${YELLOW}'$dest'${NORMAL} already linked to ${BOLD}${YELLOW}'$src'${NORMAL}\n"
return
fi
fi
local cmd_source_path=""
local cmd_dest_path=""
local link_cmd=""
if [[ $is_windows -eq 1 ]]; then
cmd_source_path=$(unix_to_windows_path "$final_src")
cmd_dest_path=$(unix_to_windows_path "$final_dest")
if [[ $source_has_space -eq 1 ]]; then cmd_source_path="\"$cmd_source_path\""; fi
if [[ $dest_has_space -eq 1 ]]; then cmd_dest_path="\"$cmd_dest_path\""; fi
link_cmd="cmd //c 'mklink $cmd_dest_path $cmd_source_path'"
else
if [[ $source_has_space -eq 1 ]]; then cmd_source_path="\"$cmd_source_path\""; fi
if [[ $dest_has_space -eq 1 ]]; then cmd_dest_path="\"$cmd_dest_path\""; fi
link_cmd="ln -sf $cmd_source_path $cmd_dest_path"
fi
if [[ $require_confirmation -eq 1 ]]; then
echo "${BOLD}${BLUE}Will attempt to link ${YELLOW}'$src'${BLUE} to ${YELLOW}'$dest'${BLUE}"
printf "${BOLD}Enter 1 to proceed\n${YELLOW}> ${NORMAL}"
read confirm
if [[ $confirm != 1 ]]; then abort; fi
fi
if [[ $debug -eq 1 ]]; then
echo Final cmd source: $cmd_source_path
echo Final cmd dest: $cmd_dest_path
echo Link cmd:: $link_cmd
fi
printf "${BOLD}${GREEN}==> ${NORMAL}${BOLD}symlink: ${YELLOW}'$src'${NORMAL}${BOLD} to ${YELLOW}'$dest'${NORMAL}\n" 2>/dev/null
eval $link_cmd 1>/dev/null
}
create_dir() {
local path=$(strip_trailing_slashes "$1")
if [ ! -d $path ]; then
mkdir $path
fi
printf "${BOLD}${GREEN}==> ${NORMAL}${BOLD}mkdir: ${NORMAL}${BOLD}${YELLOW}'$path'${NORMAL}\n"
}

View File

@@ -0,0 +1,101 @@
#!/usr/bin/env bash
#---------------------------------------------------------------------------------------------------
# API
#---------------------------------------------------------------------------------------------------
# If you're using msys/mingw shell for compiling then it's possible for its gcc
# link.exe to take precedence over the VC link.exe simply due to the path
# order. We get around this by prefixing all VC tools with the active VC arch
# bin path.
#
# This will only work if the shell ran vcvarsall.bat.
get_msvc_bin_path() {
declare -n _path=$1
declare -n _x64_toolset=$2
_path=""
_x64_toolset=0
##########################################
# Visual Studio 2022
##########################################
if [[ $VisualStudioVersion == "17.0" ]]; then
_path="$VCToolsInstallDir"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
printf "${BOLD}${YELLOW}[VS2022 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/Hostx64/x64"
elif [[ $VSCMD_ARG_HOST_ARCH == "x86" ]]; then
printf "${BOLD}${YELLOW}[VS2022 X86]${NORMAL}\n"
_path+="bin/Hostx86/x86"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
##########################################
# Visual Studio 2019
##########################################
elif [[ $VisualStudioVersion == "16.0" ]]; then
_path="$VCToolsInstallDir"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
printf "${BOLD}${YELLOW}[VS2019 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/Hostx64/x64"
elif [[ $VSCMD_ARG_HOST_ARCH == "x86" ]]; then
printf "${BOLD}${YELLOW}[VS2019 X86]${NORMAL}\n"
_path+="bin/Hostx86/x86"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
##########################################
# Visual Studio 2017
##########################################
elif [[ $VisualStudioVersion == "15.0" ]]; then
_path="$VCToolsInstallDir"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
printf "${BOLD}${YELLOW}[VS2017 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/Hostx64/x64"
elif [[ $VSCMD_ARG_HOST_ARCH == "x86" ]]; then
printf "${BOLD}${YELLOW}[VS2017 X86]${NORMAL}\n"
_path+="bin/Hostx86/x86"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
##########################################
# Visual Studio 2015
##########################################
elif [[ $VisualStudioVersion == "14.0" ]]; then
_path="$VCINSTALLDIR"
if [[ $(env | grep "LIB=" | grep "x64") != "" ]]; then
printf "${BOLD}${YELLOW}[VS2015 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/amd64"
elif [[ $(env | grep "LIB=" | grep "x86") != "" ]]; then
printf "${BOLD}${YELLOW}[VS2015 X86]${NORMAL}\n"
_path+="bin/"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
else
error "Either you don't have Visual Studio installed or it's not supported by this script.\nFound version '$VisualStudioVersion'\n"
exit 1
fi
# Fix up the path
_path="/${_path/:/}" # Remove ':'.
_path="${_path//\\//}" # Remove Windows slashes.
_path="${_path// /\\ }" # Add a backslash before spaces.
}

View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
uname_s="$(uname -s)"
case "${uname_s}" in
Linux*) platform="LINUX" platform_os="LINUX";;
Darwin*) platform="MACOS" platform_os="MACOS";;
CYGWIN*) platform="CYGWIN" platform_os="WINDOWS";;
MINGW*) platform="MINGW" platform_os="WINDOWS";;
MSYS*) platform="MINGW" platform_os="WINDOWS";;
*) platform="UNKNOWN:${uname_s} platform_os="UNKNOWN_OS""
esac
#---------------------------------------------------------------------------------------------------
# API
#---------------------------------------------------------------------------------------------------
os_is() {
declare -n _os_is=$1
if [[ $platform_os == $2 ]]; then _os_is=1; else _os_is=0; fi
}
shell_is() {
declare -n _shell_is=$1
if [[ $platform == $2 ]]; then _shell_is=1; else _shell_is=0; fi
}
shell_is_mingw() { declare -n _shell_ret=$1; shell_is _shell_ret "MINGW"; }
shell_is_cygwin() { declare -n _shell_ret=$1; shell_is _shell_ret "CYGWIN"; }
os_is_windows() { declare -n _os_ret=$1; os_is _os_ret "WINDOWS"; }
os_is_linux() { declare -n _os_ret=$1; os_is _os_ret "LINUX"; }
os_is_macos() { declare -n _os_ret=$1; os_is _os_ret "MACOS"; }
os_is_unix() {
declare -n _os_ret=$1;
if [[ $platform_os == "LINUX" || $platform_os == "MACOS" ]]; then
_os_ret=1
else
_os_ret=0
fi
}

View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
DIM="\e[2m"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
warn() {
printf "${BOLD}${YELLOW}$1${NORMAL}"
}
error() {
printf "${RED}$1${NORMAL}"
}
fatal() {
printf "${RED}$1${NORMAL}\n"
exit 1
}
log() {
msg="$1"
value="$2"
printf "@log ${BOLD}${YELLOW}$msg${GREEN}$value${NORMAL}\n"
}

10
dotfiles/ssh.md Normal file
View File

@@ -0,0 +1,10 @@
# Creating an elliptic curve keypair (ed25519)
* Create: `ssh-keygen -a 100 -t ed25519 -f ~/.ssh/filename`
* Schema check:
* `ssh-keygen -lf ~/.ssh/filename`
* `ssh-keygen -lf ~/.ssh/filename.pub`
# Linux
You might need to run `ssh-add ~/.ssh/id_rsa` after setting up your key.

View File

@@ -0,0 +1,67 @@
////////////////////////////////////////////////////////////////////////////
// ADOBE SYSTEMS INCORPORATED
// Copyright 2008-2017 Adobe Systems Incorporated
// All Rights Reserved
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
// terms of the Adobe license agreement accompanying it. If you have received this file from a
// source other than Adobe, then your use, modification, or distribution of it requires the prior
// written permission of Adobe.
/////////////////////////////////////////////////////////////////////////////
// Works around the lack of a permanently enabled "Show Items from Subfolders" option (aka flat view).
// The default behaviour is to turn off the option when changing folders. This extension enables the
// flat view when the app starts and then keeps it enabled when changing folders. You can disable this
// behaviour by disabling the "Always Show Items from Subfolders" option.
function AlwaysFlatViewSetting() {
this.requiredContext = "\tAdobe Bridge must be running.\n";
this.menuID = "alwaysFlatViewSetting";
}
AlwaysFlatViewSetting.prototype.run = function() {
if (!this.canRun()) return false;
var toggleFlatView = function(enable) {
var task = 'MenuElement.find("FlatView").checked = ' + (enable ? 'true' : 'false');
app.scheduleTask(task, 0, false);
}
var label = "Always Show Items from Subfolders";
var menuItem = new MenuElement( "command", label, "after FlatView");
menuItem.canBeChecked = true;
menuItem.checked = true;
menuItem.onSelect = function() {
menuItem.checked = !menuItem.checked;
toggleFlatView(menuItem.checked);
}
// Triggered when changing folders or selecting some menu option.
onSelectItem = function(event) {
if (event.object instanceof Document && event.type == "selectionsChanged") {
if (menuItem.checked) {
toggleFlatView(true);
}
return {handled:false}; // continue handling all other event handlers
}
}
app.eventHandlers.push({handler: onSelectItem});
return true;
}
AlwaysFlatViewSetting.prototype.canRun = function() {
if (BridgeTalk.appName == "bridge") {
if (MenuElement.find(this.menuID)) {
return false; // Item already exists.
}
return true;
}
$.writeln("ERROR:: Cannot run AlwaysFlatViewSetting");
$.writeln(this.requiredContext);
return false;
}
if (typeof(AlwaysFlatViewSetting_unitTest ) == "undefined") {
new AlwaysFlatViewSetting().run();
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
"NoNewAppAlert"=dword:00000001

View File

@@ -0,0 +1,2 @@
reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d 1 /f
reg add "HKLM\System\CurrentControlSet\Services\WerSvc" /v "Start" /t REG_DWORD /d 4 /f

View File

@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
"DisableWpbtExecution"=dword:00000001

View File

@@ -0,0 +1,2 @@
export CMAKE_CXX_COMPILER=/Library/Developer/CommandLineTools/usr/bin/c++
export CMAKE_C_COMPILER=/Library/Developer/CommandLineTools/usr/bin/cc

View File

@@ -0,0 +1,40 @@
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open]
"MuiVerb"="@photoviewer.dll,-3043"
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
00,31,00,00,00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget]
"Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\
25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,00,68,00,6f,\
00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,50,00,68,00,\
6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,65,00,77,00,\
5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,00,20,00,25,\
00,31,00,00,00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget]
"Clsid"="{60fd46de-f830-4894-a628-6fa81bc0190d}"

182
dotfiles/windows/readme.md Normal file
View File

@@ -0,0 +1,182 @@
# Windows Setup
* Make a system restore point after a fresh install.
* Disable Windows Platform Binary Table
* This is a system Windows made for hardware vendors to inject firmware to the OS drive, running it at boot time.
It's a huge security hole! Vendors can do things like download software, auto update the mobo firmware, etc.
In 2023, Gigabyte was caught using this to download exe's from their server over an http connection! (keep in mind
that they're corporate systems have been hacked multiple times in the last year). Anyway, this feature is fucking
dumb and you can be sure that all mobo vendors are using this stupid shit. I don't blame them though since Microsoft
built this for them. There's no way to stop this from happening other than to disable the platform entirely.
* Run `disable-windows-platform-binary-table.reg` and reboot.
* Change PC name and reboot
* Open settings -> System -> About -> Rename this PC
* Disable the annoying Windows alert sound that plays when doing things like using a terminal, hitting tab to autocomplete and it has no match.
* Open C:/windows/media
* Find `Windows Background.wav`
* Right-click -> Properties -> Security -> Advanced -> Change Owner from `TrustedInstaller` to your user account -> Apply
* Back in the previous Security tab, click Edit to change permisisons -> add your user account and grant all permissions
* Now you can delete the file or rename it.
* Disable `Enhance Pointer Precision`:
* Mouse Properties -> Pointer Options -> Motion section
* Laptop: change touchpad sensitivity to medium or high in order to prevent mouse movement when palm touches the pad while typing.
* If using a Lenovo then disable touchpad lock in the Lenovo Vantage app.
* Map caps key to left-ctrl
* If the keyboard supports remapping at the hardware level (e.g. like the Keychron keyboards) then map it there and this should cover all
use cases, including Steam Link which for some reason does not respect the various remapping setups (except for PowerTools - see below).
* For software based remapping, there are two options:
* Use SharpKeys for a simple config change in Windows. You don't have to run any software at startup to get the remapping. The downside is that
this doesn't work over Steam Link.
* Use Bill Microsoft's [PowerTools](https://github.com/microsoft/PowerToys/releases/). Install it and then go to the key remapper tool in the settings.
This works over Steam Link but it requires you to run the program to get the remapping. If you go down this path then be sure to go through the settings
and disable the various tools that you don't want.
* Download [O&O ShutUp10](https://www.oo-software.com/en/shutup10) and disable things.
* Download [InControl](https://www.grc.com/incontrol.htm) to stop Microsoft from pushing Windows 11.
* Disable Corana: group policy -> Administrative Templates -> Search -> disable the "Allow Cortana ..." settings.
* Install Open-Shell to restore the start menu to the sensible Windows 7 style.
* Pin "This PC" to taskbar
* In Win 10 start menu, search for "This PC", right click top result and pin to taskbar
* Configure Explorer's options
* Open file explorer, click on File menu then options or "Change folder and search options"
* General tab
* `Open File Explorer to: This PC`
* Uncheck `Show recently used files in Quick access`
* Uncheck `Show frequently used folder in Quick access`
* View tab
* Check `Show hidden files, folders, or drives`,
* Uncheck `Hide extensions for known file types`
* Disable reopening apps on startup
* Windows settings -> Account -> Sign in options -> Privacy section: turn off `Use my sign-in info to automatically finish setting up device`
* Disable window suggestion when snapping a window
* Windows settings -> System -> Multitasking -> uncheck "When I snap a window, show what I can snap next to it"
* Desktop: turn off hibernation
* Open admin cmd prompt: `powercfg.exe /hibernate off`
* Disable power throttling:
* winkey+r -> `gpedit.msc`.
* Computer Configuration > Administrative Templates > System > Power Management > Power Throttling Settings
* Double-click the `Turn off Power Throttling` policy.
* Select Enabled.
* Disable reserved network bandwidth
* winkey+r -> `gpedit.msc`.
* Computer Configuration > Administrative Templates > Network > QoS Packet Scheduler > Limit reservable bandwidth
* Enable it and set the % to 0.
* Enable ultimate power plan (alternatively make a new plan and set the min/max processor speed to 100%)
* Open cmd as admin, run `powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61`
* Can now select the ultimate power plan in power options.
* Create a power plan for software benchmarking
* This will disable turbo boost and general lock the frequency to base-ish clock. This can help
keep CPU temps stable (hot temps affect clock) and it avoids variable clock changes.
* AFAIK this only works for Intel CPUs; not sure how to do the same thing on AMD.
* In the power plan set the processor min/max speed to 99%.
* Disable UAC screen dimming
* Open User Account Control settings
* Drag the slider down to the notch that doesn't dim the screen.
* Disable remote assistance
* Disable Windows error reporting dialog so that when stuff crashes you can get to a debugger faster.
* Open an admin cmd prompt and run the file `disable-windows-error-reporting-dialog.bat` from this directory.
* Disable the WinSAT task which is used to figure out your Windows performance score. It eats up
processor time and is generally useless.
* Open task scheduler.
* **note** If you see an error about a selected task {0} no longer existing then you'll need
to repair the task scheduler. See
https://www.thewindowsclub.com/the-selected-task-0-no-longer-exists-error-in-task-scheduler
* Go to `Local\Microsoft\Windows\Maintenance` and disable the WinSAT task.
* Disable the Windows Customer Experience Improvement program via group policy
https://web.archive.org/web/20200131202352/https://www.ghacks.net/2016/10/26/turn-off-the-windows-customer-experience-program/
* Increase TDR setting for GPU Driver
* TDR determines the length of time that a GPU can hang on a computation until the OS restarts
the driver. By default this is set to a few seconds so you can experience app crashes when
using GPU intensive software, like 3D modeling or texturing. To increase the duration, follow
this guide: https://web.archive.org/web/20191107173337/https://docs.substance3d.com/spdoc/gpu-drivers-crash-with-long-computations-128745489.html
* **Optional:** disable Windows Defender real-time protection:
* This can speed up compilation times since Defender will scan every file written to disk. I was
able to shave off ~2-5 seconds in a particular project.
* If you'd rather keep real-time protection active then you can add specific files or
folders to the Defender exclusion list in the Windows Security settings, however I did
some testing and didn't see any speedup when excluding a project folder.
* Go into the Windows security settings and disable `Tamper Protection`.
* winkey+r -> `gpedit.msc`.
* Can now disable either with a policy or some custom batch files.
* Policy:
* Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus -> Real-time Protection
* Double-click the `Turn off real-time protection` policy.
* Select Enabled (you may have to restart PC).
* If you want to re-enable then change the policy to `Not configured` and re-enable tamper protection.
* Batch files: in `dotfiles/bin` run `antimalware-service-disable.bat` then restart. Reenable it with `antimalware-service-enable.bat`
* Enable/disable various Window features:
* Go to Add/Remove Programs -> Turn Windows features on or off
* Disable:
* Windows hypervisor platform (can break Virtualbox)
* Internet Explorer 11
* Legacy Components - DirectPlay
* Media Features - Windows Media Player
* Microsoft Print to PDF
* Microsoft XPS Document Writer (and any other XPS components)
* Print and Document Services - Internet Printing Client & Windows Fax and Scan
* Windows PowerShell 2.0 (current version is 5+ as of 2021-03-05)
* Work folders client
* Restore classic Windows Photo Viewer app (the default Win10 photos app is fucking awful):
* Run photo_viewer.reg from this folder.
* You'll need to change the default app for the various image extensions. Don't change gif types
though because photo viewer doesn't support animations.
* Now run disable-are-you-sure-you-want-to-open-with-the-default-program-dialog.reg to stop it
from occasionally asking if you still want to use photo viewer.
* Add custom hosts file
* Run notepad as administrator
* Open C:/Windows/System32/Drivers/etc/hosts
* Add contents of the hosts file from this directory
* Restart PC
* Note: Windows Defender is going to alert you about the change. Tell it to ignore. Also, POS Windows will periodically reset this file to the default state so you'll want to check it every so often.
* Install the Windows SDK https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
* Will install to c:\Program Files (x86)\Windows Kits\10
* Setup a symbol server:
* Right-click My Computer -> Properties -> Advanced Tab -> Environment Variables
* Add a new System Variable called `_NT_SYMBOL_PATH`
* Set the value to `SRV*c:\symbols*http://msdl.microsoft.com/download/symbols`, replacing the
first path to where you want the symbols to live.
* Configure crash dump storage location for projects via the registry.
* Disable various web trackers using browserleaks.com as a guide.
* e.g. disable WebGL, canvas fingerprinting, geolocation, font fingerprint, etc.
* Turn off various startup processes
* ctrl+shift+esc -> startup
* Disable unneeded services
* Do a pass over all Windows setting screens for anything obvious that wasn't covered here.
* Open the Windows settings Apps & features and remove bloatware that isn't visible in the
control panel add/remove list, e.g. OneDrive