Nil
Des del 12 de Febrer la vida m’ha canviat encara més. Per sort és per un gran motiu, el Nil va arribar just el dia en que entravem a la setmana 40 realment tot plegat va anar de llibre, rodat i ràpid. Com tothom em recorda, si amb un nen no tenies temps amb dos ja ni et planteges tenir-ne. Aquests consells que quasi ja formen part de la cultura popular no podien ser més certs. Només cal fixar-me en el detall que he necessitat tot aquest temps per trobar una estona per parlar tranquil·lament sobre el seu naixement.
A continuació ús adjunto una fotografia, a partir d’aquí ja podeu començar a especular sobre a qui s’assembla.
Abans d’acomiadar-me només voldria afegir que si tenir un fill fa il·lusió, quan veus que dos d’ells s’abracen el cor s’entendreix i cau la llagrimeta. Després arriben dies assenyalats com el dia del pare i regals meravellosos fan del dia un fet innoblidable.
Gràcies meumins per aquesta família tan fantàstica.
Linux: Mounting file as a partition
When we have a file with a ‘dd’ of a full disk and we want to mount a partition of that disk, we have to use an offset for jumping to the beginning of the partition that we want to mount.
Using ‘fdisk’ command we can find the partitions of that disk copied inside a file.
fdisk -l FILE_WITH_DISK_INSIDE
Once partition table is shown there is a column called ‘Start’ using the corresponding number in this column for the partition that we want we can obtain the offset required for our mounting point. Reasoning behind that is multiply start sector per number of bytes per sector.
# OFFSET = START * 512
mount -o ro,loop,offset=OFFSET FILE_WITH_DISK_INSIDE /mnt
I hope thanks to this technical note next time that I forget how to get the offset I find it fastly.
UPDATE 2018/08/29:
If you don’t want to do that manually, there is a small tool called losetup which maps the partitions of a disk image on a file.
# example, attaching partitions to loopback devices
losetup -P /dev/loop0 DISK_IMAGE
# just mount the devices now, they are /dev/loop0pX where X is the number of the partition
# dettach this assignament:
losetup -d /dev/loop0
socat tip: create virtual serial port and link it to TCP
Create a virtual serial port and publish it on TCP port:
socat pty,link=/dev/virtualcom0,rawer tcp-listen:2101
In another computer, for instance, another virtual port can be created and connected to the previous one:
socat pty,link=/dev/virtualcom0,rawer tcp:SERVER_IP:2101
If in any of those both sides we want to open a real serial port, for instance, in the server case we can run:
socat /dev/ttyS0,rawer tcp-listen:2101
More information on socat manpage.
Ubuntu synchronize NTP clock
Synchronise Linux clock when NTP service is running but the clock is not on time:
sudo service ntp stop sudo ntpd -gq sudo service ntp start
socat tip: VPN without cyphering
Fast reminder and tip for socat, it can work on two devices or more:
# SERVER: socat TCP-LISTEN:4443 TUN:192.168.255.2/24,up # CLIENT: socat TCP:SERVER_IP:4443 TUN:192.168.255.1/24,up
ngrok – service which solve services behind NAT issues
This is another short entry, in this case for recommending a service which we solve typical problem solved using a DNAT. Once we have a service on our laptop, or on a private server and we have to expose that service on the internet for some time or permanently usually we have to go the firewall, or router and create a NAT rule forwarding a port. This is a simple and powerful service which is going to solve that for you.
There is a free account for understanding and testing the service, other plans are available and especially affordable for professional requirements.
I was frogetting to say it’s compatible with Linux, Windows and Mac.