Hacker News new | past | comments | ask | show | jobs | submit | senotrusov's comments login

It surprises me that it is a problem that needs to be solved, and not just a way it should be done from day one. Back in 2011 I wrote a small ruby class that interacts with redis and provides me a reliable method to consume messages from queue.

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...


Maybe due to it's distinct and utility design I still remember my granddad's Russian-made jerrycan that he used to fill his motorcycle with gasoline, in his remote Siberian village in the 80's.


Restic is amazing. I like how Restic could be automated.

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...


Cool repo! You've now sent me down a deep Sopka rabbit hole..


I'm really glad that you find it interesting, it was my solo project for the long time. Feel free to contact me on discord stan#9673 if you need any help or just for the general shell-scripting related chat :)


There is also a tool ssh-import-id. It could do the similar with the command "ssh-import-id gh:<github username>". It checks if key is already in authorized_keys, and it's handy if you want to run the command in idempotent manner. It's available in Ubuntu packages, don't know about other distributions.


Cool concept, lovely graphics and nice interface!


I use BorgBackup to make a local backup on linux and mac machines and rclone to upload that backup to the cloud.

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


I use Raspberry Pi 2 to synchronize files across my ubuntu/macos/windows machines, backup them into the encrypted backup and then upload that backup offsite.

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.


Rails provide ruby DLS for migrations but you can always put plain SQL in that migration files. I do this most of the time and the Rails conveniently tracks which script needs to be executed against particular database state and runs them for me.

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.


> 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.

Database views + ActiveRecord are a super power.


Trying to understand the described matter I created some simple code to benchmark different cases.

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!


There is a bug in your code:

    var o = new F(i, i, i, i, i, i, i, i, i, i, z)
    z = o
    // ... skipped 
    o.z = z
This makes o.z = o, so only the last object survives. When you use constructor you actually link all of them together - which means there is more garbage around - GCs are more expensive.

If you fix this bug, e.g. by doing

    var o = new F(i, i, i, i, i, i, i, i, i, i, z)
    o.z = z
    z = o
you actually OOM in prop-benchmark-a.js case because object there is less compact than one created by constructor. Just as the post predicts.


Thank you!

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)


> 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).

Well, the secret here is that even if you have an empty constructor V8 still initially gives enough slack to you object for 10 in-object properties, and by coincidence you have precisely 10 properties.

Just add one more and observe the difference.


Wall Street International Magazine | Montenegro, Europe, RELOCATION | INTERN/entry/mid level software engineer, JavaScript/Rails

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: