I had a hard time finding the information I needed to get Cockpit to work right behind an Apache reverse proxy setup. So, I decided to collect everything I found here for the future.
At first, I tried to setup cockpit under the /cockpit path but it kept failing. Apparently, that path is reserved by Cockpit, so I switched to using /ckpt/ instead.
/etc/cockpit/cockpit.conf
[WebService]
Origins = https://mydomain.com http://127.0.0.1:9090
ProtocolHeader = X-Forwarded-Proto
AllowUnencrypted = true
UrlRoot = /ckpt/
ProxyPreserveHost On
ProxyRequests Off
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
SSLProxyCheckPeerExpire Off
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /ckpt/(.*) ws://127.0.0.1:9090/ckpt/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /ckpt/(.*) http://127.0.0.1:9090/ckpt/$1 [P,L]
ProxyPass /ckpt/ http://127.0.0.1:9090/ckpt/
ProxyPassReverse /ckpt/ http://127.0.0.1:9090/ckpt/
I was looking for something like rsync
that I can use on Windows. I know that I could install many of the Linux utilities on Windows but I just wanted to see if there was something built-in. Well...robocopy
!
robocopy source_dir z:\backup\dest_dir /MIR
The /MIR
mirrors the entire directory tree. I'm tempted to say that I actually like it just as much as, or maybe more than, rsync
.
Supported escape sequences:
(Note that escapes are only recognized immediately after newline.)
+--+
| |
| | +--------------------------+
+--------------------------+ | | | |
| | | | | |
| | +-----+--+-----+ | |
| | | | | Remote Machine (C) |
| Local Machine (A) | | | | |
| | | | | |
| | | Jump Server | | |
| | | | | |
| | | (B) | | |
| | | | | |
| | | | | |
| | | | | |
| | | | +--------------------------+
+--------------------------+ | |
+-----+--+-----+
| |
| |
| |
+--+
Machine A can get to Machine B
Machine B can get to Machine C
Machine A CAN NOT get to Machine C directly.
Most people will use SSH to connect from Machine A to Machine B, then use SSH again to connect from Machine B to Machine C.
Add the following to SSH config
Host hostb
User myself
Hostname machineB
Host hostc
User myself
Hostname machineC
Port 22
ProxyCommand ssh -q -W %h:%p hostb
With this configuration, SSH can be used to connect directly from Machine A to Machine C. SSH will automatically direct the connection through Machine B.
I looked around for help on creating an options file for ctags
to work with Scala code. Keeping it here for easy access.
--langdef=scala
--langmap=scala:.scala
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\4/c,objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*case class[ \t]+([a-zA-Z0-9_]+)/\6/c,case classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*case object[ \t]+([a-zA-Z0-9_]+)/\4/c,case objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\4/t,traits/
--regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*(\[[a-z]*\])*|protected)[ \t]*)*def[ \t]+([a-zA-Z0-9_]+)/\4/m,methods/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*val[ \t]+([a-zA-Z0-9_]+)/\3/l,constants/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*var[ \t]+([a-zA-Z0-9_]+)/\3/l,variables/
--regex-scala=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/
Use the file by passing it to ctags
ctags --options=ctags_scala --exclude=target --exclude=java-ipv6-master --exclude=tests --exclude=testdata --exclude=Session.vim -R .
I don't remember where I found this but it's quite useful.
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags