summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2023-03-10 00:25:45 -0500
committerMitsuo Tokumori <[email protected]>2023-03-10 00:25:45 -0500
commit214e1fcccdcb9baf3d0b79de8cba95fe3ca7fe07 (patch)
tree847311611c164b9bc080b03949064cc6c5f0954f
parenta3b47dc2df40e38e87dcdacf3509db1f9c470b8b (diff)
downloaddotfiles-214e1fcccdcb9baf3d0b79de8cba95fe3ca7fe07.tar.gz
dotfiles-214e1fcccdcb9baf3d0b79de8cba95fe3ca7fe07.tar.bz2
dotfiles-214e1fcccdcb9baf3d0b79de8cba95fe3ca7fe07.zip
Change default editor to nvim. Add mpv,ssh config
-rw-r--r--bash/bash_aliases13
-rw-r--r--git/config11
-rw-r--r--mpv/mpv.conf5
-rw-r--r--powershell/Microsoft.PowerShell_profile.ps14
-rw-r--r--ssh/Readme.txt8
-rw-r--r--ssh/config9
-rw-r--r--ssh/sshd_config117
7 files changed, 155 insertions, 12 deletions
diff --git a/bash/bash_aliases b/bash/bash_aliases
index e87e633..d75e54d 100644
--- a/bash/bash_aliases
+++ b/bash/bash_aliases
@@ -1,8 +1,16 @@
+# Bash aliases.
+#
+# Previously set environment variables work.
+# Aliases are recursive (I.e., an alias inside an alias works).
+
+
# Shortcuts
# ======================================================================
-alias aliases='vim ~/.bash_aliases && source ~/.bash_aliases'
+
+alias e="$EDITOR"
+alias aliases="$EDITOR ~/.bash_aliases && source ~/.bash_aliases"
alias evrc='vim ~/.vim/vimrc'
-alias ebrc='vim ~/.bashrc && source ~/.bashrc'
+alias ebrc="$EDITOR ~/.bashrc && source ~/.bashrc"
alias jupyter-lab='jupyter-lab . &> /dev/null &' # Redirect stdout and stderr
@@ -28,7 +36,6 @@ alias gitlogpretty='git log --all --graph --decorate --abbrev-commit'
# https://stackoverflow.com/a/15606995/7498073
alias gitshowtrackedfiles='git ls-tree -r master --name-only'
-
# Precautionary
alias rm='rm -I' # Promt before removing more than 3 files
alias mv='mv -i' # Promt before overwrite
diff --git a/git/config b/git/config
index e84323e..3cb1462 100644
--- a/git/config
+++ b/git/config
@@ -1,15 +1,8 @@
-# Set up with authentication with gh(1) (GitHub CLI)
-[credential "https://github.com"]
- helper =
- helper = !/usr/bin/gh auth git-credential
-[credential "https://gist.github.com"]
- helper =
- helper = !/usr/bin/gh auth git-credential
[user]
name = Mitsuo Tokumori
[diff]
# used with $ git difftool
- tool = vimdiff
+ tool = nvim -d
[merge]
- tool = vimdiff
+ tool = nvim -d
diff --git a/mpv/mpv.conf b/mpv/mpv.conf
new file mode 100644
index 0000000..23b612d
--- /dev/null
+++ b/mpv/mpv.conf
@@ -0,0 +1,5 @@
+# ~/.config/mpv/mpv.conf
+
+# Screenshots
+screenshot-template="%f-%P"
+screenshot-directory="~/media/Pictures/Screenshots/mpv"
diff --git a/powershell/Microsoft.PowerShell_profile.ps1 b/powershell/Microsoft.PowerShell_profile.ps1
index 866ed4c..fc55bac 100644
--- a/powershell/Microsoft.PowerShell_profile.ps1
+++ b/powershell/Microsoft.PowerShell_profile.ps1
@@ -1,5 +1,9 @@
# Access this file using $PROFILE
#
+# By default, powershell does not allow execution of non-signed scripts
+# > Get-ExecutionPolicy
+# > Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
+#
# Home directory:
# cmd.exe: %USERPROFILE%
# Powershell: $ENV:USERPROFILE
diff --git a/ssh/Readme.txt b/ssh/Readme.txt
new file mode 100644
index 0000000..c902d49
--- /dev/null
+++ b/ssh/Readme.txt
@@ -0,0 +1,8 @@
+important considerations for ssh:
+- Change port to other than default (specially if exposed)
+- Rate limit SSH traffic with a firewall (e.g., ufw)
+- Disable password authentication (use RSA)
+- Disable root login
+
+sshd_config goes to /etc/sshd_config in ArchLinux
+config goes to ~/.ssh/config
diff --git a/ssh/config b/ssh/config
new file mode 100644
index 0000000..7979b64
--- /dev/null
+++ b/ssh/config
@@ -0,0 +1,9 @@
+# global options
+#User admin
+
+# host-specific options
+Host example.com
+ Hostname 123.123.123.123
+ #Port 22
+ User pocoyo
+ #IdentityFile ~/path/to/key
diff --git a/ssh/sshd_config b/ssh/sshd_config
new file mode 100644
index 0000000..1e8358e
--- /dev/null
+++ b/ssh/sshd_config
@@ -0,0 +1,117 @@
+# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $
+
+# 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/bin
+
+# 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.
+
+Port 22 # set a custom port
+#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
+PermitRootLogin no
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#PubkeyAuthentication yes
+
+# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
+# but this is overridden so installations will only check .ssh/authorized_keys
+AuthorizedKeysFile .ssh/authorized_keys
+
+#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 no
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+KbdInteractiveAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# 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 without-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 no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+PrintMotd no # pam does that
+#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
+
+# override default of no subsystems
+Subsystem sftp /usr/lib/ssh/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# PermitTTY no
+# ForceCommand cvs server