In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
Rename a git tag old to new:
git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags
The colon in the push command removes the tag from the remote repository. If you don't do this, git will create the old tag on your machine when you pull.
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: jupyterhub | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start jupyterhub | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
#/usr/bin/bash | |
# strings to look for in our file | |
# Note: you could just parse the whole file. But if you put in a bad password your IP | |
# could end up on the bad guy list | |
declare -a badstrings=("Failed password for invalid user" | |
"input_userauth_request: invalid user" | |
"pam_unix(sshd:auth): check pass; user unknown" | |
"input_userauth_request: invalid user" | |
"does not map back to the address" | |
"pam_unix(sshd:auth): authentication failure" |
Suppose you want the default branch name created by git init
(or tools that shell out to it, like cargo new
) to be something other than master
. In this example, I'll call it develop
.
Add the following to your .gitconfig
:
[init]
templateDir = ~/.config/git/template/
import sys | |
import struct | |
import binascii | |
from collections import Counter | |
def u16(b): | |
return struct.unpack('<H', b)[0] | |
def p16(x): | |
return struct.pack('<H', x) | |
def p32(x): |
Screen { | |
overflow: auto; | |
} | |
#calculator { | |
layout: table; | |
table-size: 4; | |
table-gutter: 1 2; | |
table-columns: 1fr; | |
table-rows: 2fr 1fr 1fr 1fr 1fr 1fr; |