Go is a wonderful language, able to build complex applications with very minimal configuration information. For many apps, only import statements are required.
However, there are a couple of special import cases worth knowing about:
import . “github.com/user/repo”
From golang.org: “If a program imports a standard package using import . “path”, additional names defined in the imported package in future releases may conflict with other names defined in the program. We do not recommend the use of import . outside of tests, and using it may cause a program to fail to compile in future releases.”
import _ “github.com/user/repo”
From Andrew Gerrand (Google): “Prefixing an import
with an underscore causes the package to be imported for its
side-effects only. (that is, it’s init functions are executed and
global variables initialized)”
Raspberry Pi (and Cubieboard) SD disk images typically have two (or three) partitions: the first is Fat32 (50-100MB) and includes the boot files, while the second (>1GB) contains the main Linux image. With compression, the combined image can be reduced from several GB (of mostly empty space) to a couple hundred MB.
With a regular Linux desktop computer that has kpartx and mksquashfs installed, you can convert the second partition to SquashFS like this:
$ sudo kpartx -av image_you_want_to_convert.img
add map loop0p1 (252:5): 0 117187 linear /dev/loop0 1
add map loop0p2 (252:6): 0 3493888 linear /dev/loop0 118784
$ sudo mount /dev/mapper/loop0p2 /mnt
$ sudo mksquashfs /mnt converted_image.img -comp lzo -e lib/modules
$ sudo umount /mnt
$ sudo kpartx -d image_you_want_to_convert.img
You can save a lot of space by compressing dd image files.
These examples use gzip but many other compression apps will work just as well.
backup with dd and gzip
dd if=/dev/wd0a | gzip -9 > /mnt/backup.gz
restore backup
gunzip /mnt/backup.gz – | dd of=/dev/wd0a
Download SourceTree command line tools from:
https://downloads.sourcetreeapp.com/SourceTreeAppStoreCmdLineToolInstaller.pkg
To open repo in current folder:
stree .
https://help.github.com/articles/fork-a-repo
Configure remotes
To keep track of the original repo, you need to add another remote named upstream:
cd Spoon-Knife
git remote add upstream https://github.com/octocat/Spoon-Knife.git # Assigns the original repo to a remote called “upstream”
Pull in upstream changes
If the original repo you forked your project from gets updated, you can add those updates to your fork by running the following code:
git fetch upstream # Fetches any new changes from the original repo
git merge upstream/master # Merges any changes fetched into your working files
replace submodule repo
You should just be able to edit the .gitmodules file to update the URL and then run git submodule sync to reflect that change to the superproject and your working copy.
recursive submodule init and update
git submodule update –init –recursive
update only
git submodule update –recursive
recursive add submodule
git submodule add foo
git submodule update –init –recursive
MiniDLNA – Ports ssdp (1900/udp) and trivnet1 (8200/tcp) are proper of this service.
The other port (37167/udp) varies in every execution.
It seems this is filled with multiple (roughly) 1GB swap files, allocated as required.
Problem is they don’t go away (until reboot?).
One article suggested this:
sudo dynamic_pager -L 1073741824
Seemed to work: before running vm used 8GB, afterwards 4GB
Recent Comments