https://github.com/jas-/top-secret
This is a repo to test using symmetric encryption (as a profile alias command) to push/pull from various machines by creating compressed archive, encrypting, pushing to github or pulling from github, merging, decrypting & decompressing
https://github.com/jas-/top-secret
Last synced: about 2 months ago
JSON representation
This is a repo to test using symmetric encryption (as a profile alias command) to push/pull from various machines by creating compressed archive, encrypting, pushing to github or pulling from github, merging, decrypting & decompressing
- Host: GitHub
- URL: https://github.com/jas-/top-secret
- Owner: jas-
- Created: 2013-01-14T12:03:06.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-16T02:58:11.000Z (over 12 years ago)
- Last Synced: 2025-01-28T14:47:07.610Z (4 months ago)
- Language: Shell
- Size: 8.79 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Poor mans GitHub
I am poor, and well poor does what poor can.## Saving to your poor man private repository on GitHub
Here is a small bit to help you create a private repo. Open up your .bashrc or alias file of choice and add the following:
```sh
repo_save()
{
if [ -d "$1" ] ; then
cd $1;
tar --exclude=".git*" --exclude="*.tgz" -zcf $2.tgz $1 2&>/dev/null;
read -sp "Enter password: " pass;
gpg --yes --no-tty --batch --passphrase-fd 3 --symmetric -o $2.tgz.gpg $2.tgz 3<<<$pass;
git add $2.tgz.gpg README.md;
git commit -m "`date`";
git push;
rm $2.tgz 2&>/dev/null;
fi
}
alias repo-save=repo_save;
```Then whenever you wish to save to your (already configured repo using your already available public key), simply execute like so...
```sh
bash> repo-save /path/to/repo filename
```## Retoring from your poor man private repository on GitHub
Of course in order for you to keep multiple machines in sync you must pull and merge, decrypt & extract:
```sh
repo_restore()
{
git pull;
git merge master origin/master;
read -sp "Enter password: " pass;
gpg --yes --no-tty --batch --passphrase-fd 3 --decrypt -o $1.tgz $1.tgz.gpg 3<<<$pass;
tar zxf $1.tgz 2&>/dev/null;
rm $1.tgz 2&>/dev/null;
}
alias repo-restore=repo_restore;
```Now use like this...
```sh
bash> repo-restore filename
```