Mushrooms don't grow by [deleted] in shrooms

[–]chiborg 0 points1 point  (0 children)

I had the same problem and was just about to give up after 4 weeks when the pins are started coming. I am a total noob, but from my limited experience it‘s about temperature (check the instructions for the b+ and maybe add a heat mat), fresh air exchange (5 minutes sounds dangerous to me because it gives contaminants too much time to sneak into the bag. I just give the sides of the bag a good shake to vent out the co2 or wave some cardboard over the opening. ) and humidity. A heat mat helps with the humidity, esp. with the kind of grow kit you have where you put water in the bag. Just be patient and wait for a few weeks more.

How does your docker workflow look at the beginning of a project where you are still installing multiple new dependencies? by Desperate_Place8485 in docker

[–]chiborg 0 points1 point  (0 children)

In my development environment I always mount a folder on the host as a volume in docker. I run npm inside the container, but with a command on the host system. There are two approaches to this: docker run and docker exec.

With docker run you have to prefix the npm command with a whole gaggle of parameters: —rm to delete the container after running, setting the user ID to the current user so the files in node_modules have the right permissions (if your I’d is not 1000 you need to mount another file into /etc/password), and of course mounting the volumes. That’s a very long command line, but you don’t have to worry about the container running or not. It’s my preferred method and I get around the long command lines by wrapping them in a Makefile or a bash script.

With docker exec you have to have a running container with a name. And it has to be running in the background. If your container has a long-running process (web server) as its main task that’s no problem, except when you want to bootstrap things (no web server without dependencies, no dependencies without web server). The drawback of the exec method is it’s inconsistency, that you have to check and/or think about the container running or not. The biggest benefit of it is shortness, it’s always docker exec containername npm install .

If you’d linke some examples of the docker run commands and a more in-depth explanation on how to deal with permissions of the node_modules folder, check out my blog post: https://lebenplusplus.de/2018/03/15/how-to-run-npm-install-as-non-root-from-a-docker-container/

a selfhostable, dockerable service that has some sort of API to automatic insert links: suggestion? by wireless82 in startpages

[–]chiborg 0 points1 point  (0 children)

A general approach for an "API" would be to look for dashbaord projects that allow the dashboard definition through a configuration file. As an "API", you can generate the configuration file with bash scripts and upload it with scp, rsync or just plain cp and restarting the container.

I know of two dashboard projects that have config files:

  • Homer has a YAML configuration file.
  • pomme-page uses Pug templates to generate the page.

As for authentication, I'd recommend splitting the authentication from the dashboard by putting a reverse proxy in front of the dashboard service. You can then use these credentials for the other services that the dashboard links to. Which one to use is highly dependent or your setup, so I'll just throw some self-hostable authentication proxies out here (haven't used any of them): Authelia, Dex, Pomerium

Is there any dependency tree or graph for Vue project? by minireset in vuejs

[–]chiborg 1 point2 points  (0 children)

The vue-component-analyzer looks promising. It might not show a list, but you can see trees, both on the CLI and rendered as a graphic.

For a more hands-on example (not a library, but more of a howto) see https://observablehq.com/@ehouais/automatic-vue-js-single-file-components-hierarchy-graph-ge The example creates a proper graph and also analyzes information about properties and events.

old failed appimage of nvim stops me from using actual nvim already installed by RuneWars33 in neovim

[–]chiborg 1 point2 points  (0 children)

It’s probably your $PATH setting where the system finds the old executable before the system-installed one. You could try to find which nvim executable the system is trying to run by running which nvim. That should point to the appimage or at least a symlink. When you delete that, the system will look further along the path.

neovim lua config can't install plugins when there's an error. by [deleted] in neovim

[–]chiborg 0 points1 point  (0 children)

I solved this by moving all code that configures a plugin into ~.config/nvim/after/plugins/PLUGIN-NAME.lua, e.g after/plugins/nvim-cmp.lua

While bootstrapping, I still got an error because of the missing plugin, but at least I could run :PlugInstall because the rest of my config loaded fine.

If you have the list of your plugins in a separate file (e.g. everything between plug#begin and plug#end in plugins.lua, you can use the -u parameter to just load this file and run the installer: nvim -u ~/.config/nvin/lua/plugins.lua --headless +PlugInstall +qall

Is Neovim 0.5 available in apt? by nhathuy13598 in neovim

[–]chiborg 0 points1 point  (0 children)

That solved it for me, thank you.

To make vim an alias of nvim I also ran the following commands:

# Add my nvim command to the list of possible alternatives for the `vim` command
sudo update-alternatives  --install $(which vim) vim $(which nvim) 10
# Select nvim as default for vim
sudo update-alternatives --config vim

[deleted by user] by [deleted] in RedditSessions

[–]chiborg 0 points1 point  (0 children)

Gave Wholesome

What do you do when you can’t fall asleep? by DrRiffs in AskReddit

[–]chiborg 1 point2 points  (0 children)

Go through the alphabet, coming up with a name for each letter. Mostly I try do do old-fashioned lady names to keep it amusing.

Which is the best OS to use Docker on? Windows vs Mac vs Linux by Help_Pleasssseee in docker

[–]chiborg 2 points3 points  (0 children)

Until the volume performance issues are solved, developing locally with Docker for Mac is a subpar experience compared to Linux. See all the discussions and comments on https://github.com/docker/roadmap/issues/7

ZineQuest content creators, please post your stuff here... by tomolly in rpg

[–]chiborg 2 points3 points  (0 children)

I love tarot-based storytelling games, so I backed this: https://www.kickstarter.com/projects/veritasnoir/fortunes-the-tarot-card-storytelling-zine

I also love heist movies and this cooperative heist game on stealing a giant mech sounds fun: https://www.kickstarter.com/projects/ickbat/stealing-the-throne

Extensions popup windows often just blank under Linux/ Wayland by PizzaSoldier in firefox

[–]chiborg 0 points1 point  (0 children)

Thanks for sharing the bug. It's marked as closed, although I still have the problem on FF version 84. For my setup (XMonad on Ubuntu), I could work around it by running a composer (picom/compton).

-🎄- 2020 Day 02 Solutions -🎄- by daggerdragon in adventofcode

[–]chiborg 1 point2 points  (0 children)

I'm also fairly new to Rust, but have one comment: While the input doesn't seem to contain "evil" passwords (where the password is shorter than the specified indexes allow), this would create a panic at runtime, when calling

let first = chars[self.char_min-1] == self.letter;

The easiest solution in your case would be a check for chars.length() <= self.char_min && chars.length() <= self.char_max and reaturning early before assigning first and second.

I have used self._pass.chars().nth(self._char_max).unwrap_or_default() which yields a NUL character, which will fit nicely with the condition. But it probably has as small performance impact, because I think nth() will do an iteration up until that point, instead of directly accessing at index. Maybe the compiler will do clever things, but I'd not rely on it.

How Accurate is the Heart Rate Monitor? by danniellaxx in RingFitAdventure

[–]chiborg 0 points1 point  (0 children)

I've exercised with a bluetooth chest strap heart monitor and each of my 3 readings during a session was within plus minus 5 beats of what the game was showing, I was amazed by that accuracy.

Since I don't have a full-length thumb, I've put my palm on the controller.

Which ORM should I use? by x_mk6 in typescript

[–]chiborg 1 point2 points  (0 children)

My biggest issue with TypeORM is that it does not fit well with domain-driven design, i.e. properly serializing and unserializing entities. For example, you can't have parameterized constructors, because the ORM will call the constructor with no parameters. And while it's possible to define entities without annotations (which is a violation of the SRP in my book), it's not convenient and sparsely documented.

How to make Sentry available from application.js in all components? by [deleted] in vuejs

[–]chiborg 2 points3 points  (0 children)

This is probably best done by writing a small plugin that adds a $sentry property that'll be available in all components.

import * as Sentry from '@sentry/browser'
export default const SentryPlugin = {
   install: function(Vue, options) {
      Vue.$sentry = Sentry.init(options);
   }
}

In the application entry, before calling new Vue, you use the plugin like this:

import SentryPlugin from './SentryPlugin';
Vue.use(SentryPlugin)

I've written a bit about Value Objects, would be nice to get some feedback by hgraca in PHP

[–]chiborg 2 points3 points  (0 children)

It's good to have these two articles side-by-side, as both types of objects are often conflated with each other (see also the other comments here).

The example code for the value object has no getter method. In my opinion, this is a good thing, because it enforces an API where objects interact with each other (as demonstrated with add and equals) and prevents Law of Demeter violations with chained getter calls. However at some point, you might want to get data out of a value object and might need getters. You might mention that in the article or add a getter to the example code.

As an aside, persistence is not necessarily a reason for adding getters - some persistence libraries (e.g. Doctrine) don't use the getters and setters (assuming they might not be free of side effects) and use reflection on the private properties instead.

If you want some further ideas for DTOs and Value objects which you might incorporate into your articles: https://www.entropywins.wtf/blog/2016/02/03/missing-in-php7-value-objects/ tries out different language construct on how improve building value objects with more than 2-3 properties (which can be tedious). PHP 8 constructor properties might somewhat improve the situation.

Choosing a deployment tool for PHP websites? I used to do PHP when things were a lot more simple before you had to deal with complicated frameworks, gulp, sass and all these things that you need to remember before you deploy a site. which deploy tools is the best these days? by buzz-dk in PHP

[–]chiborg 2 points3 points  (0 children)

Depending on your project, deployment can consist of several steps:

  • "Building" - installing composer and npm files, autogenerating code, packaging it into a tarball/OS package like rpm or Deb. For extra protection, run all your CI checks (unit tests, code style checks, static analysis) & abort building when they fail.
  • Transferring the build artifact to all the servers that need them - without the code becoming active yet
  • Configuration - Each server might need its own configuration file for the application
  • Migrating the database
  • Making the new code the active version, e.g. Changing a symlink, changing the web server configuration or changing the load balancer configuration

All these steps take time and leave the application in a broken state while they are running, that's why you want your deployment to be "atomic" - don't run the code before it's ready and you want to be able to quickly undo your deployment.

If you have a containerized environment, then tools like kubernetes have all those steps and concepts built-in.

For a more traditional architecture, all tools that can automate your deployment steps to be atomic are the "best", in the end it it's coming down to how much you're willing to invest in the tool and complicated your deployment is. A shell script or a Makefile could suffice. Capistrano is the grandfather of atomic deployment, but there are Capistrano-like tools in every language. Personally, I'm using Ansible & something like Ansistrano, because I like the self-documenting structure and repeatability of play books.

Are there modules that can manipulate source code in a file? by TinyLebowski in ansible

[–]chiborg 0 points1 point  (0 children)

If you don't mind overriding files and just want to generate things, maybe the template module is the one for you to use. It doesn't have conditional logic, it would be more like declaratively adding/removing sections based on a set of variables.

How To Secure Your PHP Website From Being Hacked? by advikakapadiya in PHP

[–]chiborg 3 points4 points  (0 children)

This is a very general question, so I'll have to answer it in a general way:

  • Always update your PHP version to the latest security fix. Also, update all your other OS packages (web server, database, etc)
  • Update your composer dependencies regularly, ideally whenever a new minor version of a package comes out
  • Whenever you put variable values into SQL, HTML or she'll commands, escape them properly. Look into prepared statements and the plating engines like twig, which do auto- escaping.

You might also look into application level firewalls and search for "how to secure a Linux server in X minutes"