Fix Postgresql data corruption “invalid page in block … of relation base/16384/…

Bad news yesterday after a power failure on a server, impossible to restart my Helium ETL service: the database has been corrupted and the service is failing with the message “invalid page in block 54206178 of relation base/16384/186119818”

I had to spend time on the web and chatGPT wasn’t helping me (I’m kidding, this bot is stupid) to find a correct way to solve this, luckily, this has been resolved and here is the way I did it.

Continue reading

Tips, get allocated device IP for mac OS X Internet share

Short story, I’m updating a Laird gateway connected to my mac book and using the Wifi connection to reach Internet. I need to get the allocated IP to access it using the web UI.

I found two ways (only one working) on Internet:

[~] ping

This way, you can get different devices responding to the ping broadcast and list the addresses. I’ve got nothing interesting but it’s good to know.

[~] arp -i bridge100 -a
? ( at (incomplete) on bridge100 ifscope [bridge]
? ( at xx:xx:xx:xx:44:dd on bridge100 ifscope [bridge]
? ( at (incomplete) on bridge100 ifscope [bridge]

Here we have a device responding on where the Laird is.

Secure your children Internet access

I’m a big fan of PiHole for my children but also for my IoT devices [not the one I build but the one I’m purchasing 🙂 ]. That said, there are two things missing in it:

  • The first one is that Pi-Hole is operating on DNS request so any malicious solution using its own DNS or direct IP will bypass Pi-Hole protection.
  • The second one is the lake of functionalities like stopping Internet for a certain group of user during certain period of time.

So, when a friend of me contacted me to share its work on a different solution using a proxy, I’ve been happy to let him make a blog post here to introduce his solution. And this solution can be used in complement of PiHole. So, let’s make some place here to Manu PILLANT

Continue reading

Embedded product with Raspberry Pi Compute Module

Raspberry Pi is a good solution for creating low-cost, powerful embedded devices when you have no need of self powered solution.

I had to create a such device recently to make a programming machine for my IoT devices. I was looking for a compact solution, powered with PoE, industrial grade, able to run a Java program and host a custom HAT with my home-made chip programmer.

Here you see a picture of the first prototype of this product with the different components visible: The green board is a Rapsberry Pi compute module CM3+ with 16GB eMMc flash drive. The blue motherboard is a Waveshare PoE board for CM3+. The Black board is my custom HAT hosting the programming solution based on a STM32.

In this post, I’ll detail a bit these different components and the way they are configured to illustrate how to easily make a such system alive.

Continue reading

Transfer UDP over SSH

When you want to transfer some UDP protocol from a remote server not directly accessible from your local host you can use a combination of SSH and socat to make this communication possible.

The application case is, as an exemple, a SNMP communication with a server in a DMZ to get metrics in a local area dashboard. Like in this exemple.

You have an intermediate host where SSH is accessible you can use as a gateway.

1- on the local host (on the left side), create a SSH tunnel with a TCP port forwarding (here 10000).

ssh -L 10000:localhost:10000 **gateway_host_ip**

2- on the gateway host, route the traffic received from the port we have previously associated to the UDP target host:port

socat tcp4-listen:10000,reuseaddr,fork UDP:**target_host_ip**:**udp_port**

3 – on the local host, route the traffic received from the given UDP port to the previously associated TCP port for tunnelling

socat -T15 udp4-recvfrom:**udp_port**,reuseaddr,fork tcp:localhost:10000

That’s it.

Centos 7 – install a mongo cluster with 3 replica set

This post is describing how to setup a Mongo Db database in a clustering mode. I choose to deploy 3 replica set on 3 different bare metal server running centos 7 and to add 1 arbiter to reduce vote problem during a server crash or reboot.

You will find the different steps to make this configuration running, the way to secure it in a vlan and to activate the authentication.

I also added some elements on the way to backup it. Feel free to propose enhancement and links in the comments.

Continue reading