34 karma · joined Sep 1, 2013 (13y ago) · 23 submissions
comment 5mo ago · link · parent
Eventually, I wrote my own bidirectional sync tool that synchronizes a git checkout (for example, ~/.dotfiles) with the actual home directory. I run it as a systemd service, so I can simply edit or delete files in ~/.dotfiles, and everything else happens automatically.
I can add or remove files in the repository, and they will automatically be created or removed in their synchronized locations. At the same time, the target directories can contain other unrelated files, including an entire $HOME, and this does not interfere with synchronization in any way.
The bidirectional sync is particularly useful when a program, such as vs code, decides to modify its own configuration files, or when I'm feeling lazy and just want to edit ~/.bashrc directly and commit the changes later.
Achieving this requires some careful logic that, hopefully, I've managed to get right. At least at the time I wrote it, I hadn't seen these implemented in other systems.
Oh, and I use the same sync for some files I need to /etc, only for that I run sudo scripts and dont' have a always-on service for obvious reasons.
I'd be happy if someone else found it useful too: https://github.com/senotrusov/etcdotica
2.
One Terabyte of Kilobyte Age, Digging Through the Geocities Torrent(blog.geocities.institute ↗)
14 points · by senotrusov · 9mo ago · discuss
3.
Show HN: A tool to keep dotfiles and system configs in sync with a Git repo(github.com ↗)
1 points · by senotrusov · 9mo ago · discuss
4.
Show HN: Arch Linux installation lab notes turned into a clean guide(senotrusov.com ↗)
4 points · by senotrusov · 10mo ago · discuss
comment 1y ago · link · parent
Considering that access is limited to the countries on the list [0], I wonder what motivated their choices, especially since many Balkan countries were left out.
[0]: https://developers.google.com/gemini-code-assist/resources/a...
comment 1y ago · link · parent
I built it because I work across multiple machines and often worry about which projects are on which computer or whether I’ve left any files in unique locations. Now I can diff the summaries between devices to see what’s out of sync, which repositories have uncommitted changes, and which folders have been modified.
I avoid using cloud sync services, and most of my files are already in git anyway. I find that having clear visibility is enough, I just need to know what to commit, push, pull, or sync manually.
I would be glad if it proves useful to someone besides me.
comment 4y ago · link · parent
Back than I just read the redis docs, understands that BRPOPLPUSH is the right method to call, and made a few ruby functions to do so, you could see it here [1], they are plain and simple.
From my perspective, it's just feature starving OSS part, to push customers towards the paid solution.
[1]: https://github.com/senotrusov/redis-call/blob/master/lib/red...
comment 5y ago · link · parent
I usually work in multiple Linux virtual machines and I have a Bash script to setup regular backup of all my many $HOMEs.
I did not yet have the script for verification (did it manually just to be sure), but the rest is here if someone is interested https://github.com/senotrusov/sopkafile/blob/main/lib/ubuntu...
comment 5y ago · link · parent
comment 7y ago · link · parent
It took me some time to figure it all out. I wrote a script to not manually repeat configuration steps next time. Although it's quite opinionated it still grew to 600 lines.
Feel free to check it out, maybe it can help someone https://github.com/senotrusov/backup-script
comment 7y ago · link · parent
I use syncthing to synchronize files. It's fast, stable, cost me nothing and the only limit I have is the size of my disks.
Syncthing is decentralized, that means that two machines have to be powered on at the same time to be able to perform sync. Raspberry Pi allows me to have that always-on machine at home which is small, quiet and unnoticeable in my electricity bill. Syncthing works across internet bypassing NAT thanks to the community-ran relays (I also run one of them). I could take my laptop everywhere and file changes will still reach my Raspberry Pi.
I hook up an external Seagate USB HDD and it runs just fine without an extra power source. Syncthing keeps up-to-date copy of all my files on that external HDD.
I use borg-backup to take hourly snapshots of my files. Those snapshots are encrypted and I upload them offsite without any worries that some cloud provider could possibly read them. I use rclone for that, it can interface with a number of cloud providers out there. It just take your files and one-way sync them into the cloud.
The setup of rclone and borg-backup is not particularly complicated but still requires some time. Directories, encryption keys, periodic jobs have to be configured. I abstracted all that into one script which is a bit opinionated but works for me. That script can be run on Linux on on MacOS. I used my Mac for that before Raspberry Pi. It uses system or launchd to run periodic jobs https://github.com/senotrusov/backup-script
I installed Ubuntu server on that Raspberry Pi to have familiar environment.
Sadly Raspberry Pi lacks secure boot and have no internal TPM functionality. My external HDD is encrypted but I can't trust Raspberry Pi to hold the encryption key. In rare event of reboot I have to ssh in and manually enter the LUKS key.
This setup is still prone to an evil maid attack as someone could replace or modify the SD card to log that key. That scenario is highly unlikely as I am no particular interest to anyone. What is slightly more realistic is that someone could brake into my house to steal stuff. For that my data is secure as the key is lost the moment you power off the Raspberry Pi.
Overall I'm pretty happy with that setup. My Raspberry Pi slowly blinks with it onboard red LED to indicate that all that services run well and alarms me with fast blinks if something is not right.
comment 8y ago · link · parent
I find myself rarely do triggers. Not because I can't. It's just more handy to do on the ActiveRecord layer having access to all my ruby code.
Indexes, indexes on PL/pgsql procedures, foreign keys and constraints – they absolutely have their place in Rails applications.
Although you could do a rather complicated SELECT's with ActiveRecord, sometimes, for particular queries, I prefer to create a database VIEW and then point the ActiveRecord model to it.
comment 11y ago · link · parent
I was lucky to not hit OOM and I've got 5.648s for setting properties outside of the constructor and 3.680s for setting them inside of the constructor, so just as the post predicts.
At the same time, if I'm trying to simplify the test case and set only numeric values and not object ones, I've got nearly the same results: 3.953s and 3.922s for 10x more iterations (prop-benchmark-f.js and prop-benchmark-g.js).
(node 4.0.0 on Mac OS)
comment 11y ago · link · parent
Probably I got something wrong, but setting properties inside the constructor function (prop-benchmark-b.js) are almost 6 times slower that setting them outside of it (prop-benchmark-a.js)
https://gist.github.com/senotrusov/597514c773089b6989c6
What do you think, why I got such a different numbers?
Thank you!
comment 11y ago · link · parent
Wall Street International Magazine (wsimag.com) is searching for entry/mid Level HTML/JavaScript software engineer, for the full-time job in Budva, Montenegro (Europe). We are willing to arrange relocation.
HTML/CSS/JavaScript (possibly React) and simple server-side logic with Ruby on Rails.
We expect the candidate to be able to focus on the creating exceptional web-pages, produced with solid understanding of HTML and related technologies. We have a multinational team, our primary language of communication in office is English.
If you are interested in this position, please send your resume to info@wsimag.com
Thank you.
20.
Show HN: A tool to mark duplicates in iPhoto library – simple, fast, open source(github.com ↗)
3 points · by senotrusov · 11y ago · 1 comment
comment 12y ago · link · parent
https://github.com/senotrusov/redis-call - A Ruby library to access Redis using Hiredis takes care of thread-aware connections, handy API for keys' names construction, transactions and queues.
comment 12y ago · link · parent
A social content creation tool with cartography features.
A document consist of sections, sections contain paragraphs. One single paragraph may have many instances across different documents.
Users can repost paragraphs, createdby someone else. When the original author updates the paragraph then that update propagates to all the instances.
Similar, one section may simultaneously exists in different documents. Any changes in that section are visible in all that documents.
Forced anonymity but you can track individual contributor in the scope of a single discussion (visible user ids started from 1 for each thread).