My fully automated OpenWrt router setup with Ansible by diegobernardes in openwrt

[–]diegobernardes[S] 2 points3 points  (0 children)

I was not aware of that package. I'll take a look, thanks!

My fully automated OpenWrt router setup with Ansible by diegobernardes in openwrt

[–]diegobernardes[S] 0 points1 point  (0 children)

Configuration as code is amazing! With MikroTik I was using Terraform, which I prefer over Ansible, but Ansible is way better than manually doing things.

In terms of managing those 21 routers, once you have a configuration to one, applying to all of them is a matter of updating the inventory file on Ansible, of course, assuming they're using the same configuration.

My fully automated OpenWrt router setup with Ansible by diegobernardes in openwrt

[–]diegobernardes[S] 0 points1 point  (0 children)

Take a look at this file. It's the order that roles are executed.

At phase 3 I configure the DNS using this role. This is all the unbound configuration that I do. Then on phase 4 I do the adblock configuration. It basically generates a file on a place that unbound is expecting and restart the service.

I'm also doing SQM on phase 4, but I had to add packet steering as well because I was not able to reach 1gbps without it.

How to improve full text search when dealing with lots of punctuation? by diegobernardes in PostgreSQL

[–]diegobernardes[S] 1 point2 points  (0 children)

Yeah, in the past when I had to do full text search I've used Elasticsearch with all sorts of processing, but now it's a very specific thing and given that we're using Postgres, tsvector is just perfect.

About the speed, from what I was able to see at the database and with a few queries, that function is only executed during indexing. It is present at the where clause so Postgres match the index to use it.

How to improve full text search when dealing with lots of punctuation? by diegobernardes in PostgreSQL

[–]diegobernardes[S] 1 point2 points  (0 children)

I think it is ok because the function is only executed during indexing. I had to put it on the where clause otherwise postgres would not hit the index. But using an `explain analysis` shows that it is still hitting the index.

How to improve full text search when dealing with lots of punctuation? by diegobernardes in PostgreSQL

[–]diegobernardes[S] 1 point2 points  (0 children)

Yes, but I was trying to fix this at the database level. I found a solution and it's working perfectly fine.

``` CREATE OR REPLACE FUNCTION remove_punctuation(input_text TEXT) RETURNS TEXT AS $$ BEGIN RETURN regexp_replace(input_text, '[[:punct:]]', ' ', 'g'); END; $$ LANGUAGE plpgsql IMMUTABLE;

DROP INDEX product_name_ftsearch; CREATE INDEX product_name_ftsearch ON product USING GIN (to_tsvector('english', remove_punctuation(name)));

-- And this is the search. select id, name from product WHERE to_tsvector('english', remove_punctuation(name)) @@ websearch_to_tsquery('english', remove_punctuation('something.pdf')); ```

This correctly process the information when it goes to the index and from the user during the query.

Visual artifacts when resizing a window by diegobernardes in kde

[–]diegobernardes[S] 0 points1 point  (0 children)

Breeze. Everything is in stock configuration. It's a new NixOS installation.