In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| # If Windows getch() available, use that. If not, use a | |
| # Unix version. | |
| try: | |
| import msvcrt | |
| getch = msvcrt.getch | |
| except: | |
| import sys, tty, termios | |
| def _unix_getch(): | |
| """Get a single character from stdin, Unix version""" |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>This is the title of the webpage!</title> | |
| </head> | |
| <body> | |
| <p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> | |
| </body> | |
| </html> |
Note: This is a bit of a scratch to see what's involved in getting the ping sensor to work as an I2C backpack.
I assume you already have Docker up and running on your Raspberry Pi 2. If not, see this article.
The next natural step is to install Docker Compose (formerly Fig), but there's no ARM support out of the box. This recipe will help you install Docker Compose on your Raspberry Pi 2!
The following six steps will do the trick:
| zfs list -H -o name -t snapshot | xargs -n1 zfs destroy |
Here is the proper installation guide. Do not look at any quick-start guides! All the other installation guides I found were lacking.
| #!/usr/bin/expect -f | |
| set prompt "#" | |
| set address [lindex $argv 0] | |
| spawn sudo bluetoothctl -a | |
| expect -re $prompt | |
| send "remove $address\r" | |
| sleep 1 | |
| expect -re $prompt |
If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
$ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature" (now available as $ git logs)$ git config --global alias.cis "commit -S" (optional if global signing is false)$ echo "Some content" >> example.txt$ git add example.txt$ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)