.github
workflows deploy.yaml
content
notes 2022-08-13-algae-spotted-on-river-sava.md 2023-05-01-cachebusting-in-hugo.md 2023-05-05-run-9front-in-qemu.md 2023-05-06-git-push-multiple-origins.md 2023-05-07-mount-plan9-over-network.md 2023-05-08-write-iso-usb.md 2023-05-09-catv-weechat-config.md 2023-05-10-plan9-screenshot.md 2023-05-11-fix-plan9-bootloader.md 2023-05-12-install-plan9port-linux.md 2023-05-13-download-youtube-videos.md 2023-05-14-convert-mkv.md 2023-05-15-preview-troff-man-pages.md 2023-05-16-mass-set-permission.md 2023-05-22-non-blocking-shell-exec-csharp.md 2023-05-23-extend-lua-with-custom-c.md 2023-05-23-parse-rss-with-lua.md 2023-05-24-fresh-9front-desktop.md 2023-05-25-dcss-new-player-guide.md 2023-05-25-show-xterm-colors.md 2023-05-25-tmux-sane-defaults.md 2023-05-27-cronjobs-github-with-actions.md 2023-05-27-dcss-on-4k-displays.md 2023-05-27-drawing-pixels-in-plan9.md 2023-05-28-easy-time-took-in-bash.md 2023-05-29-grep-to-less-maintain-colors.md 2023-05-31-extending-dte-editor.md 2023-06-01-ewd-manuscripts-ebook.md 2023-06-04-bulk-make-thumbnails.md 2023-06-21-presentations-with-markdown.md 2023-06-24-making-cgit-look-nicer.md 2023-06-25-alacritty-open-links-with-modifier.md 2023-06-25-development-environments-with-nix.md 2023-06-29-10gui-10-finger-multitouch-user-interface.md 2023-06-29-60s-ibm-computers-commercial.md 2023-07-10-fix-screen-tearing-on-debian-12-xorg-and-i3.md 2023-07-10-online-radio-streaming-with-mpv-from-terminal.md 2023-07-14-set-color-temperature-of-displays-on-i3.md 2023-08-01-make-b-w-svg-charts-with-matplotlib.md 2023-09-18-aws-eb-pyyaml-fix.md 2023-09-25-compile-drawterm-on-fedora-38.md 2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md 2023-11-05-add-lazy-loading-to-jekyll-posts.md 2023-11-07-personal-sane-vim-defaults.md 2024-02-15-extract-lines-from-file.md 2024-02-21-dcss-online-rc-defaults.md 2024-02-23-uninstall-ollama-from-a-linux-box.md 2024-06-17-calling-assembly-functions-from-c.md 2024-06-17-sending-signals-to-c-programs.md 2024-06-19-embedding-resources-into-binary-with-c.md 2024-06-22-write-and-read-structs-to-files-in-c.md 2024-09-19-use-option-key-as-meta-macos-alactritty.md 2025-02-26-male-and-female-body-proportion-reference-images.md 2025-03-17-vim-ale-linters.md 2025-04-11-lua-performance-in-different-environments.md 2025-06-30-xfce-alt-to-win.md 2025-07-19-minimal-desktop-with-cwm-and-conky.md
pages bookmarks.md curriculum-vitae.md projects.fossil.md.part projects.github.md.part projects.md
posts 2011-01-13-most-likely-to-succeed-in-year-of-2011.md 2012-03-09-led-technology-not-so-eco.md 2013-10-24-wireless-sensor-networks.md 2015-11-10-software-development-pitfalls.md 2017-03-07-golang-profiling-simplified.md 2017-04-17-what-i-ve-learned-developing-ad-server.md 2017-04-21-profiling-python-web-applications-with-visual-tools.md 2017-08-11-simple-iot-application.md 2018-01-16-using-digitalocean-spaces-object-storage-with-fuse.md 2019-01-03-encoding-binary-data-into-dna-sequence.md 2019-10-14-simplifying-and-reducing-clutter.md 2019-10-19-using-sentiment-analysis-for-clickbait-detection.md 2020-03-22-simple-sse-based-pubsub-server.md 2020-03-27-create-placeholder-images-with-sharp.md 2020-03-29-the-strange-case-of-elasticsearch-allocation-failure.md 2020-03-30-my-love-and-hate-relationship-with-nodejs.md 2020-05-05-remote-work.md 2020-08-15-systemd-disable-wake-onmouse.md 2020-09-06-esp-and-micropython.md 2020-09-08-bind-warning-on-login.md 2020-09-09-digitalocean-sync.md 2021-01-24-replacing-dropbox-with-s3.md 2021-01-25-goaccess.md 2021-06-26-simple-world-clock.md 2021-07-30-from-internet-consumer-to-full-hominum-again.md 2021-08-01-linux-cheatsheet.md 2021-12-03-debian-based-riced-up-distribution-for-developers.md 2021-12-25-running-golang-application-as-pid1.md 2021-12-30-wap-mobile-web-before-the-web.md 2022-06-30-trying-out-helix-editor.md 2022-07-05-what-would-dna-sound-if-synthesized.md 2022-10-06-state-of-web-technologies-in-year-2022.md 2022-10-16-that-sound-that-machine-makes-when-struggling.md 2023-01-26-trying-to-build-a-new-kind-of-terminal-emulator.md 2023-05-16-rekindling-my-love-for-programming.md 2023-05-23-i-was-wrong-about-git-workflows.md 2023-05-31-re-inventing-task-runner-that-i-actually-used-daily.md 2023-07-01-bringing-all-of-my-projects-together-under-one-umbrella.md 2023-07-08-who-knows-what-the-world-will-look-like-tomorrow.md 2023-11-05-elitist-attitudes-are-sapping-the-fun-from-programming.md 2024-02-11-k-mer.md 2024-02-28-converting-valgrind-callgrinds-to-svg-format.md 2024-03-10-the-abysmal-state-of-linux-in-the-year-2024.md 2024-03-10-using-custom-software-with-github-actions-to-deploy-a-site.md 2024-03-14-configuration-and-plugin-hell-and-why-i-dont-use-vim-and-tmux-anymore.md 2025-04-08-embedding-game-assets-within-your-binary.md 2026-01-09-vim.md 2026-01-14-change-default-applications-on-linux.md 2026-01-15-using-address-sanitizer-with-clang.md
.gitkeep
static
assets
general animation.gif first.gif github.svg mitja-felicijan-hairytales.pdf trigraphs.gif
notes 10gui-10-finger-multitouch-user-interface.jpg 10gui-10-finger-multitouch-user-interface.mp4 60s-ibm-computers-commercial.jpg 60s-ibm-computers-commercial.mp4 9front-desktop.png asm64-handout.pdf cwm.png dcss-quickstart.pdf dcss.jpg dcss_manual.pdf embedding-assets.png embedding-binary-data.tar.xz embedding-window.png female-body-proportions.jpg grep-less.png male-body-proportions.jpg plan9-pixels.png plot.svg ps1-prompt.png trigraphs.gif xterm-palette.png
posts
algae-sava dji-algae-0.jpg dji-algae-1.jpg dji-algae-2.jpg dji-algae-3.jpg dji-algae-4.jpg dji-algae-5.jpg
cv avatar.gif
dfd-rice desktop.png install-00.png install-01.png install-02.png install-03.png install-04.png install-05.png installation.svg layout.png layout.svg script.png
dna-sequence benchmarks.csv chart-size.py chart-size.svg chart-speed.py chart-speed.svg dna-basics.jpg quote.png sample-binary-file.png sample.png
dna-synthesized
bison in.txt out.mp3 spectogram.png
elektron IMG_0619.jpg IMG_0620.jpg IMG_0622.jpg elektron.mp4 midi-studio.jpg
mouse in.txt out.mp3 spectogram.png
quote in.txt out.mp3 spectogram.png
taurus in.txt out.mp3 spectogram.png
symphony-no6-1st-movement.mp3 symphony-no6-1st-movement.png
do-fuse copy-benchmarks.tsv fuse-droplets.png fuse-spaces.png sqlite-benchmarks.tsv
dropbox-sync dropbox-spaces.png
esp8366-micropython boards.jpg
ewd ewd-manuscripts.epub ewd-manuscripts.mobi
go-profiling golang-profiling-cpu.pdf golang-profiling-mem.pdf
goaccess goaccess-dash-html.png goaccess-dash-term.png
godot-dynamic-tile-loading
example1 index.apple-touch-icon.png index.audio.worklet.js index.html index.icon.png index.js index.pck index.png index.wasm
2d-player-movement.webm cellular-automata.png village-creator.png
helix-editor editor.png
iot-application iot-app-output.png iot-rest-example.png iot-sqlite-db.png kcachegrind.png profiling-viewer.png simple-iot-application-overview.svg simple-iot-application.zip snakeviz.png
microsoundtrack cow.m4v
pid1 boxes.mp4 qemu.log unikernels.png unikernels.svg unikernels.webp
profile-bind-error error.jpg
python-profiling kcachegrind.png profiling-viewer.png snakeviz.png
sentiment-analysis
.ipynb_checkpoints TF Test-checkpoint.ipynb sentiment-analysis-checkpoint.ipynb
guardian-sa-title-desc-relationship.png sentiment-analysis.ipynb
simple-pubsub-server caniuse.png chrome-debugging.png clients.m4v pubsub-overview.png sse-pubsub-server.zip
state-of-web 2008-vs-2020.png compiling-vs-transpiling.png
valgrind-callgrind-svg kcachegrind.png out.c.svg out.zig.svg
vim-gdb demo.mp4
wap emulator.mp4 phones.gif
world-clock enclosure.stl hardware.jpg world-clock.jpg
yapyap hello.png pid1.jpg
zed zed-1.png zed-2.png
mitjafelicijan.pgp.pub.txt
projects ClassicEnhanced-v1.0.0.tar.gz ClassicEnhanced-v1.0.1.tar.gz TurtleTweaks-v0.1.tar.gz TurtleTweaks-v0.2.tar.gz TurtleTweaks-v0.3.tar.gz TurtleTweaks-v0.4.tar.gz TurtleTweaks-v0.5.1.tar.gz TurtleTweaks-v0.5.tar.gz TurtleTweaks-v0.6.tar.gz TurtleTweaks-v0.7.tar.gz abtts-v0.1.tar.gz abtts-v0.2.tar.gz abtts-v0.3.tar.gz blpconvert-v1.0.tar.gz clutch-v1.0.tar.gz jbmafp-v0.1.tar.gz jbmafp-v0.2.tar.gz jbmafp-v0.3.tar.gz lazycommit-v1.0.tar.gz makext-v1.0.tar.gz mprogress-v1.0.tar.gz newsbarge-v0.1.tar.gz oberon-v1.0.tar.gz p9tree-v1.0.tar.gz pats-v1.0.tar.gz pats.fossil rssperado-v1.0.tar.gz sm-v1.0.tar.gz sparklines-v1.0.tar.gz ttdaw-v0.1.tar.gz xmagnify-v1.0.tar.gz xmagnify.fossil
thumbnails glitch.png projects.xcf qwe-editor.png toy-debugger.png
.gitkeep
templates
includes .gitkeep
.gitkeep 404.html base.html bookmarks.html feed.xml index.html note.html page-no-title.html page.html post.html robots.txt sitemap.xml
tools fossil-projects.sh github-projects.py
.gitattributes .gitignore CNAME Makefile README.md config.yaml makext.mk shell.nix
content/posts/2020-09-09-digitalocean-sync.md raw
  1---
  2title: Using Digitalocean Spaces to sync between computers
  3url: digitalocean-spaces-to-sync-between-computers.html
  4date: 2020-09-09T12:00:00+02:00
  5type: post
  6draft: false
  7---
  8
  9I've been using [Dropbox](https://www.dropbox.com/) for probably **10+ years**
 10now and I-ve became so used to it that it runs in the background that I don't
 11even imagine a world without it. But it's not without problems.
 12
 13At first I had problems with `.venv` environments for Python and the only
 14solution for excluding synchronization for this folder was to manually exclude a
 15specific folder which is not really scalable. FYI, my whole project folder is
 16synced on [Dropbox](https://www.dropbox.com/). This of course introduced a lot
 17of syncing of files and folders that are not needed or even break things on
 18other machines. In the case of **Python**, I couldn't use that on my second
 19machine. I needed to delete `.venv` folder and pip it again which synced files
 20again to the main machine. This was very frustrating. **Nodejs** handles this
 21much nicer and I can just run the scripts without deleting `node_modules` again
 22and reinstalling. However, `node_modules` is a beast of its own. It creates so
 23many files that OS has a problem counting them when you check the folder
 24contents for size.
 25
 26I wanted something similar to Dropbox. I could without the instant syncing but
 27it would need to be fast and had the option for me to exclude folders like
 28`node_modules, .venv, .git` and folders like that.
 29
 30I went on a hunt for an alternative to [Dropbox](https://www.dropbox.com/) 
 31and found:
 32
 33- [Tresorit](https://tresorit.com/)
 34- [Sync.com](https://sync.com)
 35- [Box](https://www.box.com/)
 36
 37You know, the usual list of suspects. I didn't include [Google
 38drive](https://drive.google.com) or [One drive](https://onedrive.live.com/)
 39since they are even more draconian than Dropbox.
 40
 41> All this does not stem from me being paranoid but recently these companies 
 42> have became more and more aggressive and they keep violating our privacy when 
 43> they share our data with 3rd party services. It is getting out of control.
 44
 45So, my main problem was still there. No way of excluding a specific folder from
 46syncing. And before we go into "*But you have git, isn't that enough?*", I must
 47say, that many of the files (PDFs, spreadsheets, etc) I have in a `git` repo
 48don't get pushed upstream to Git and I still want to have them synced across my
 49computers.
 50
 51I initially wanted to use [rsync](https://linux.die.net/man/1/rsync) but I would
 52need to then have a remote VPS or transfer between my computers directly.  I
 53wanted a solution where all my files could be accessible to me without my
 54machine.
 55
 56> **WARNING: This solution will cost you money!** DigitalOcean Spaces are $5 per
 57month and there are some bandwidth limitations and if you go beyond that you get
 58billed additionally.
 59
 60Then I remembered that I could use something like
 61[S3](https://en.wikipedia.org/wiki/Amazon_S3) since it has versioning and is
 62fully managed. I didn't want to go down the AWS rabbit hole with this so I
 63choose [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces/).
 64
 65Then I needed a command-line tool to sync between source and target. I found
 66this nice tool [s3cmd](https://s3tools.org/s3cmd) and it is in the Ubuntu
 67repositories.
 68
 69```bash
 70sudo apt install s3cmd
 71```
 72
 73After installation will I create a new Space bucket on DigitalOcean. Remember
 74the zone you will choose because you will need it when you will configure
 75`s3cmd`.
 76
 77Then I visited [Digitalocean Applications &
 78API](https://cloud.digitalocean.com/account/api/tokens) and generated **Spaces
 79access keys**. Save both key and secret somewhere safe because when you will
 80leave the page secret will not be available anymore to you and you will need to
 81re-generate it.
 82
 83```bash
 84# enter your key and secret and correct endpoint
 85# my endpoint is ams3.digitaloceanspaces.com because
 86# I created my bucket in Amsterdam regiin
 87s3cmd --configure
 88```
 89
 90After that I played around with options for `s3cmd` and got to the following
 91command.
 92
 93```bash
 94# I executed this command from my projects folder
 95cd projects
 96s3cmd sync --delete-removed --exclude 'node_modules/*' --exclude '.git/*' --exclude '.venv/*' ./ s3://my-bucket-name/projects/
 97```
 98
 99When syncing int he other direction you will need to change the order of the 
100`SOURCE` and `TARGET` to `s3://my-bucket-name/projects/` and `./`.
101
102> Be sure that all the paths have trailing slash so that sync knows that this 
103> are directories.
104
105I am planning to implement some sort of a `.ignore` file that will enable me to
106have a project-specific exclude options.
107
108I am currently running this every hour as a cronjob which is perfectly fine for
109now when I am testing how this whole thing works and how it all will turn out.
110
111I have also created a small Gnome extension which is still very unstable, but
112when/if this whole experiment pays of I will share on Github.