Setting up portforwarding

Purpose

Windows

To enable port forwarding in the Windows Firewall, create a new inbound rule, select "Port" as the rule type, specify the protocol (TCP or UDP), the local port, and then allow the connection.

Here's a step-by-step instruction:

  1. Open Windows Firewall with Advanced Security: Search for "Windows Firewall with Advanced Security" in the Windows search bar and open it. Alternatively, go to Control Panel > System and Security > Windows Firewall > Advanced settings.
  2. Create a New Inbound Rule: Click on "Inbound Rules" in the left pane. Click "New Rule" on the right-hand side under Actions.
  3. Select Rule Type: In the New Inbound Rule Wizard, select "Port" and click "Next".
  4. Specify Protocol and Port: Choose the protocol (TCP or UDP). Enter the specific local port number you want to forward in the "Specific local ports" field.
  5. Choose Action: Select "Allow the connection" and click "Next".
  6. Define Rule Scope: Choose the network types (Domain, Private, Public) where this rule should apply.
  7. Name the Rule: Give the rule a descriptive name and click "Finish".

macOS

To set up firewall port forwarding on macOS, you'll need to configure your router to forward traffic to your Mac's IP address and then ensure your macOS firewall allows incoming connections for the specific application using that port.

Here's a step-by-step instruction:

  1. Router Configuration (Port Forwarding): Access your router's settings: Open a web browser and navigate to your router's IP address (usually found on a sticker on the router itself). Locate port forwarding settings: The exact location varies depending on your router's manufacturer and model, but look for options like "Port Forwarding," "NAT," or "Virtual Servers". Add a new port forwarding rule: Public Port: Enter the port number you want to forward (e.g., 80 for web, 22 for SSH). Private Port: This should usually be the same as the public port. IP Address: Enter the static or reserved IP address of your Mac on the network. Protocol: Choose TCP or UDP, depending on the application's requirements. Save the settings: Apply the changes to your router's configuration.
  2. macOS Firewall Configuration: Open System Settings: Go to System Settings > Security & Privacy > Firewall. Enable Firewall: Ensure the Firewall is turned on. Firewall Options: Click "Firewall Options...". Uncheck "Block all incoming connections": This is crucial to allow incoming traffic to your Mac. Add the application: Click the "+" button to add an application. Browse to the application that will be using the forwarded port and add it. Allow incoming connections: Ensure the application is set to "Allow incoming connections". Click OK: Save the changes.
  3. (Optional) Check your Mac's IP address: Open System Settings: Go to System Settings > Network. Select your network: Choose the network you are connected to. Click Details: Click on the network you are connected to and then click "Details". Find the IP address: Under "TCP/IP", you will see your Mac's IP address.

(END)

Configure .gitignore

# use glob syntax
syntax: glob

# specific files
tempfile

# back up files
.DS_Store
._*
*~
.nfs.*
#*#
*.bak
*.old

# logs
derby.log
#derby db
lift_example

# eclipse conf file
#.settings
#.classpath
#.project
.manager

# building
target
build
null
tmp*
temp*
dist
test-output

# Java
*.class

# other scm
.svn
.CVS
.hg*


# use regexp syntax
syntax: regexp
#^\.pc/

Installing more recent Git in Ubuntu 12 than its repositories standardly offer

sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

Alternatively install the other Git-related packages:

sudo apt-get install git-daemon-run git-daemon-sysvinit git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki

help.autoCorrect

There is an auto-correction feature in Git which can be turned on by:

git config --global help.autoCorrect 15

See a terminal session recording: https://showterm.io/189e7798324029948ac3c

I think this is a potentially dangerous feature to use (at least for production purposes) with limited benefit. I decided to not use it. In fact, it's better to set git config --global help.autocorrect 0 to indicate this configuration preference explicitly.

.git/config

Example .git/config file that sets multiple remote repositories. Note the instances of XXX do not ALWAYS represent the same string that need to be replaced by your real-world information.

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[remote "origin"]
        url = https://XXX@github.com/XXX/XXX.git
        pushurl = https://XXX@github.com/XXX/XXX.git
        pushurl = git@gitlab.com-XXX:XXX/XXX.git
        pushurl = git@bitbucket.org-XXX:XXX/XXX.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[remote "bitbucket"]
        url = git@bitbucket.org-XXX:XXX/XXX.git
        fetch = +refs/heads/*:refs/remotes/bitbucket/*
[remote "gitlab"]
        url = git@gitlab.com-XXX:XXX/XXX.git
        fetch = +refs/heads/*:refs/remotes/gitlab/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[user]
    name = XXX XXX
    email = XXX@XXX.com

# END

blog comments powered by Disqus