From 821b8168fad2748eec84a0f83fc908bde81719d7 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Fri, 30 Aug 2024 16:53:03 +0200 Subject: [PATCH] chore: Add Rocm related workaround and decrypt_folder function --- .zshrc | 4 ++ bin/actions/secrets.sh | 35 +++++++----- config/config.yaml | 11 ++++ config/ssh/sshd_config | 122 +++++++++++++++++++++++++++++++++++++++++ vscode/argv.json | 2 +- vscode/extensions.json | 2 +- vscode/settings.json | 12 ++++ 7 files changed, 172 insertions(+), 16 deletions(-) create mode 100644 config/ssh/sshd_config diff --git a/.zshrc b/.zshrc index b3f6f72..cf796d1 100755 --- a/.zshrc +++ b/.zshrc @@ -103,6 +103,10 @@ export PYENV_ROOT="$HOME/.pyenv" [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" +# Rocm related workaround +export HSA_OVERRIDE_GFX_VERSION=11.0.0 + + ##################### # End of the line...# ##################### diff --git a/bin/actions/secrets.sh b/bin/actions/secrets.sh index 5e56a28..9db202d 100755 --- a/bin/actions/secrets.sh +++ b/bin/actions/secrets.sh @@ -80,20 +80,27 @@ encrypt_folder() { done } +# Recursively decrypt all .gpg files under the folder specified, recursively call this function for sub folders! +# Keep the original file name minus the .gpg extension +decrypt_folder() { + for file in $1/*; do + # Skip if current file is a .gpg file + if [[ $file == *.gpg ]]; then + filename=$(basename $file .gpg) + printfe "%s\n" "cyan" "Decrypting $file..." + gpg --quiet --batch --yes --decrypt --passphrase="$password" --output $1/$filename $file + fi -# Do the same for files under $HOME/dotfiles/secrets/ (These can be any file type, not just .conf so keep the extension) -if [[ "$2" == "decrypt" ]]; then - printfe "%s\n" "cyan" "Decrypting secrets..." - echo -en '\r' - - for file in $HOME/dotfiles/secrets/*.gpg; do - filename=$(basename $file .gpg) - - gpg --quiet --batch --yes --decrypt --passphrase="$password" --output $HOME/dotfiles/secrets/$filename $file + # If file is actually a folder, call this function recursively + if [[ -d $file ]]; then + printfe "%s\n" "cyan" "Decrypting folder $file..." + decrypt_folder $file + fi done -elif [[ "$2" == "encrypt" ]]; then - printfe "%s\n" "cyan" "Encrypting secrets..." - echo -en '\r' +} - encrypt_folder $HOME/dotfiles/secrets -fi +if [[ "$2" == "decrypt" ]]; then + decrypt_folder ~/dotfiles/secrets +elif [[ "$2" == "encrypt" ]]; then + encrypt_folder ~/dotfiles/secrets +fi \ No newline at end of file diff --git a/config/config.yaml b/config/config.yaml index 0998fb1..2986d3a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -111,6 +111,11 @@ config: url: git@github.com:vleeuwenmenno/songguru-bot.git branch: develop target: ~/Projects/Private/songguru-bot + + ssdc_app_v2: + url: git@github.com:vleeuwenmenno/ssdc_app_v2.git + branch: master + target: ~/Projects/Private/ssdc_app_v2 # Packages to install @@ -176,8 +181,14 @@ config: - libfreetype-dev - mold - cargo + - clang + - libgtk-3-dev + - gcc-mingw-w64 + - btop + - htop - libgbm-dev - libclang-dev + - libsecret-1-dev - libpipewire-0.3-dev - libpam0g-dev - openssh-server diff --git a/config/ssh/sshd_config b/config/ssh/sshd_config new file mode 100644 index 0000000..5fd1531 --- /dev/null +++ b/config/ssh/sshd_config @@ -0,0 +1,122 @@ + +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +Include /etc/ssh/sshd_config.d/*.conf + +Port 400 +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey /etc/ssh/ssh_host_rsa_key +#HostKey /etc/ssh/ssh_host_ecdsa_key +#HostKey /etc/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +PubkeyAuthentication yes + +# Expect .ssh/authorized_keys2 to be disregarded by default in future. +#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 + +#AuthorizedPrincipalsFile none + +#AuthorizedKeysCommand none +#AuthorizedKeysCommandUser nobody + +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +PasswordAuthentication yes +PermitEmptyPasswords no + +# Change to yes to enable challenge-response passwords (beware issues with +# some PAM modules and threads) +KbdInteractiveAuthentication no + +# Kerberos options +#KerberosAuthentication no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes +#KerberosGetAFSToken no + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes +#GSSAPIStrictAcceptorCheck yes +#GSSAPIKeyExchange no + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the KbdInteractiveAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via KbdInteractiveAuthentication may bypass +# the setting of "PermitRootLogin prohibit-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and KbdInteractiveAuthentication to 'no'. +UsePAM yes + +AllowAgentForwarding yes +AllowTcpForwarding yes +#GatewayPorts no +X11Forwarding yes +#X11DisplayOffset 10 +#X11UseLocalhost yes +#PermitTTY yes +PrintMotd no +#PrintLastLog yes +#TCPKeepAlive yes +#PermitUserEnvironment no +#Compression delayed +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# Allow client to pass locale environment variables +AcceptEnv LANG LC_* + +# override default of no subsystems +Subsystem sftp /usr/lib/openssh/sftp-server + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# X11Forwarding no +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server diff --git a/vscode/argv.json b/vscode/argv.json index 1013ec4..eea6f2d 100644 --- a/vscode/argv.json +++ b/vscode/argv.json @@ -1,3 +1,3 @@ { - "enable-crash-reporter": true, + "enable-crash-reporter": false, } diff --git a/vscode/extensions.json b/vscode/extensions.json index 24df1f9..02f5732 100644 --- a/vscode/extensions.json +++ b/vscode/extensions.json @@ -1 +1 @@ -["aaron-bond.better-comments","bmewburn.vscode-intelephense-client","christian-kohler.path-intellisense","davidanson.vscode-markdownlint","esbenp.prettier-vscode","foxundermoon.shell-format","github.copilot","github.copilot-chat","github.vscode-pull-request-github","mguellsegarra.highlight-on-copy","ms-azuretools.vscode-docker","ms-vscode-remote.remote-containers","ms-vscode-remote.remote-ssh","ms-vscode-remote.remote-ssh-edit","ms-vscode.makefile-tools","ms-vscode.remote-explorer","ms-vsliveshare.vsliveshare","nicolasvuillamy.vscode-groovy-lint","usernamehw.errorlens","vincaslt.highlight-matching-tag","vscode-icons-team.vscode-icons","warpnet.salt-lint","xdebug.php-debug","xdebug.php-pack","yinfei.luahelper","zobo.php-intellisense"] +["aaron-bond.better-comments","alexisvt.flutter-snippets","bmewburn.vscode-intelephense-client","christian-kohler.path-intellisense","dart-code.dart-code","dart-code.flutter","davidanson.vscode-markdownlint","esbenp.prettier-vscode","foxundermoon.shell-format","github.copilot","github.copilot-chat","github.vscode-pull-request-github","mguellsegarra.highlight-on-copy","ms-azuretools.vscode-docker","ms-vscode-remote.remote-containers","ms-vscode-remote.remote-ssh","ms-vscode-remote.remote-ssh-edit","ms-vscode.makefile-tools","ms-vscode.remote-explorer","ms-vsliveshare.vsliveshare","nicolasvuillamy.vscode-groovy-lint","usernamehw.errorlens","vincaslt.highlight-matching-tag","vscode-icons-team.vscode-icons","warpnet.salt-lint","xdebug.php-debug","xdebug.php-pack","yinfei.luahelper","zobo.php-intellisense"] diff --git a/vscode/settings.json b/vscode/settings.json index dcddea0..27d9e8a 100755 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -18,4 +18,16 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "git.openRepositoryInParentFolders": "always", + "makefile.configureOnOpen": false, + "[dart]": { + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.rulers": [ + 140 + ], + "editor.selectionHighlight": false, + "editor.suggestSelection": "first", + "editor.tabCompletion": "onlySnippets", + "editor.wordBasedSuggestions": "off" + }, } \ No newline at end of file