Author Archives: Carles Mateo

How to deploy a DigitalOcean droplet (instance) and use userdata

You can see how to deploy a new droplet also named Instance or VM to DigitalOcean Cloud Provider in this video.

You can see how User Data works in this other video.

The userdata script is run as root the first time the instance is deployed.

I provisioned using this userdata script:

#!/bin/bash

sudo apt update && sudo apt install -y net-tools vim mc htop less strace zip gzip lynx curl wget git apache2

cd /opt/
git clone https://gitlab.com/carles.mateo/ctop.git

If you look for ctop.py check this page:

CTOP.py

For information about User Data from Digital Ocean:

https://docs.digitalocean.com/products/droplets/how-to/provide-user-data/

News from the Blog 2022-06-22

For the first part of June I’ve been quiet on Social Media as I was on holidays and taking some scheduled tests for my health in the hospital.

Carles in the Media/Press/Streaming

Twitch

I started streaming live Python coding sessions in Twitch. I’m giving it a try to see if coders have engagement.

The Software I use to broadcast from Linux is OBS.

I started with my Open Source project ctop.

I had a very long and interesting session on 2022-06-06 about OpenZFS, Data Centers, NVMe, iSCSI, Hard Drives, Storage, performance, Data Centers

More funny things happened like when I was installing a VirtualBox VM live, and the ZFS pool became irresponsible due hardware errors in one SATA Spinning drive.

Things from broadcasting live…

Some of the feedback I got from talented Engineers is that even if the original matter to talk about was interesting, seeing everything falling apart live due to unexpected hardware problems, and me troubleshooting live is being the best of the show… which I found very amusing.

RAB Radio the new digital world

I keep doing my radio space for Radio America Barcelona, once per week, addressed to the Catalan Community across the world and expats.

This radio program, streamed also via Twitch, is available in Catalan language only. RAB.

Open Source

carleslibs

I’ve been working in version 1.0.8 branch, and after a session of refactor on Twitch where I found a bug in MenuUtils class, I fixed it and released v. 1.0.8. You can see the video on the link.

Now I’m working on the branch v. 1.0.9.

ctop

I’ve been working in the branch 0.8.9.

My first Twitch broadcast was about adding Unit Testing to MemUtils class.

You can see all my videos:

http://www.youtube.com/channel/UCYzY-2wJ9W_ooR64-QzEdJg

Infrastructure

OpenStack

I recommend you the videos in this page about Operating OpenStack at Scale.

Some of my Blizzard colleagues talk on it.

https://superuser.openstack.org/articles/upgrades-in-large-scale-openstack-infrastructure-openinfra-live-episode-6/

https://www.openstack.org/videos/summits/denver-2019/how-blizzard-entertainment-uses-autoscaling-with-overwatch

My last physical server in a Data Center

This week I decommissioned my last physical server in a Data Center.

It has been a long journey since I created my company to launch my own projects, and I started having my own infrastructure, back at 2000.

I was offering VPS at that time, with VMWare as Hypervisor.

This last Rack Server served me well for 21 years.

Now everything is Cloud, and is not viable to host and maintain servers unless this is your main occupation. Server’s motherboards die, hard drives die and they need to be replaced. Maintaining infrastructure it’s a full time job and you require somebody to do it. Also using fixed servers only prevents you from moving fast, locks a lot of money, and from spawning more compute capacity.

If you are curious this Rack Server is a Super Micro with Intel Xeon processor and SCSI drives.

Security

Firewall

I keep blocking thousands of IP Addresses every day.

When I see a pattern of an IP trying an attacks against the Server I look at the IP and if it’s from a hosting provider I just block the entire range.

I keep blocking any IP Address coming from Russia or Belarus since they invaded Ukraine.

My Health

I visited the hospital for a programmed following on my health.

The analysis are super good, and it’s super clear that I’ve improved radically. My discipline with the diet, taking the medicines and doing exercise regularly has been crucial.

My Doctor is confident that I’ll have a full recovery, but to do so I need to loss a lot of weight in a year or two.

So, I need to focus on my health and in doing exercise, being happy and avoid any kind of negative stress.

The cost of the travels and the medicines have put some stress into my economy, but I’m fortunate that I can handle it.

Entertainment / Life / Reflections

Star Wars and racism

I’m really enjoying new Start Wars series Obi Wan, and I’ve been profoundly shocked to read that there are fans being racist against the black characters.

https://www.theverge.com/2022/5/31/23148468/star-wars-obi-wan-moses-ingram-third-sister

So just writing here to show my support to human beings from all races, genders including transgender, LGTB+, conditions and preferences.

Fixing the Error Can’t locate IPC/Run.pm in @INC in CentOS 7.5

So if you get an error like this:

Can't locate IPC/Run.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_ipmi_sensor line 35.
BEGIN failed--compilation aborted at ./check_ipmi_sensor line 35.

The solutions is simple.

sudo yum makecache

yum install perl-IPC-Run

You’ll see the list of mirrors and an output similar to this:

Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
centos-updates                                                                                                                                          | 3.4 kB  00:00:00
epel                                                                                                                                                    | 4.7 kB  00:00:00
extras                                                                                                                                                  | 3.4 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package perl-IPC-Run.noarch 0:0.92-2.el7 will be installed
--> Processing Dependency: perl(IO::Pty) >= 1.08 for package: perl-IPC-Run-0.92-2.el7.noarch
--> Running transaction check
---> Package perl-IO-Tty.x86_64 0:1.10-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================
 Package                                     Arch                                  Version                                    Repository                                  Size
===============================================================================================================================================================================
Installing:
 perl-IPC-Run                                noarch                                0.92-2.el7                                 centos-base                                122 k
Installing for dependencies:
 perl-IO-Tty                                 x86_64                                1.10-11.el7                                centos-base                                 42 k

Transaction Summary
===============================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 163 k
Installed size: 397 k
Downloading packages:
(1/2): perl-IO-Tty-1.10-11.el7.x86_64.rpm                                                                                                               |  42 kB  00:00:00
(2/2): perl-IPC-Run-0.92-2.el7.noarch.rpm                                                                                                               | 122 kB  00:00:11
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                           15 kB/s | 163 kB  00:00:11
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-IO-Tty-1.10-11.el7.x86_64                                                                                                                              1/2
  Installing : perl-IPC-Run-0.92-2.el7.noarch                                                                                                                              2/2
  Verifying  : perl-IPC-Run-0.92-2.el7.noarch                                                                                                                              1/2
  Verifying  : perl-IO-Tty-1.10-11.el7.x86_64                                                                                                                              2/2

Installed:
  perl-IPC-Run.noarch 0:0.92-2.el7

Dependency Installed:
  perl-IO-Tty.x86_64 0:1.10-11.el7

Complete!

RAB El nou món digital 2022-06-27 [CA]

Aquest és el guió per al programa El nou món digital a Ràdio Amèrica Barcelona, que es va emetre Dilluns 27 de Juny de 2022. 2022-06-27 14:30 Irish Time / 15:30 Zona horària Catalunya / 06:30 Pacific Time.

Disclaimer: Treballo per a Activision Blizzard. Totes les opinions són meves i no representen cap companyia.


This is the script of my radio program at Radio America Barcelona on Monday 2022-06-27 14:30 Irish Time / 15:30 Catalonia Time / 06:30 Pacific Time.

For my English speaking friends and followers I recorded an English version. :) Disclaimer: I work for Activision Blizzard. Opinions are my own. My opinions do not represent any company.

English version (recorded later):

Actualitat

Entreteniment i videojocs

Dones en ciència i tecnologia

  • Parlant de dones a la ciència, he comprat aquest magnífic llibre que parla de 50 dones que han fet progresar la humanitat d’una manera increïble.
Una variant de blat de moro americà, en referència a la Doctora Barbara McClintock

Programes anteriors

Programa anterior: RAB El nou món digital 2022-06-20 [CA]

Proper programa: RAB El nou món digital 2022-07-04 [CA]

Tots els programes: RAB

RAB El nou món digital 2022-06-20 [CA]

Aquest és el guió per al proper programa El nou món digital a Ràdio Amèrica Barcelona, a emetre Dilluns 20 de Juny de 2022. 2022-06-20 14:30 Irish Time / 15:30 Zona horària Catalunya / 06:30 Pacific Time.

Disclaimer: Treballo per a Activision Blizzard. Totes les opinions són meves i no representen cap companyia.


This is the excerpt of my radio program at Radio America Barcelona on Monday 2022-06-20 14:30 Irish Time / 15:30 Catalonia Time / 06:30 Pacific Time.

Disclaimer: I work for Activision Blizzard. Opinions are my own. My opinions do not represent any company.

Actualitat

  • El preu de la benzina a Irlanda, dissabte 18 de Juny, nit

Seguretat

  • Shields Health Care Group, una companyia de salut de Massachusetts ha rebut un hackeig que ha exposat les dades personals de 2 milions d’usuaris (social security numbers, medical record information, patient IDs and insurance details).
  • Un problema de seguretat amb Microsoft Word permet a un atacant executar comandes al sistema, i guanyar control del sistema. La manera com et poden afectar és enviant-te o descarregant d’internet un document word infectat.
    Aquest document aprofita un error de seguretat d’una eïna de control de qualitat de Microsoft per a poder connectar-se a una URL, baixar un arxiu, i executar els programes.
    Sembla ser que cap antivirus ho detecta.
    La manera de protegir-se és no baixar cap document Word.
    Si hem d’enviar documents, com factures, sempre és millor enviar PDFs.
    Si utilitzem gmail, podem previsualitzar documents PDF dins una finestra sense arribar a obrir-los.
    Aquest problema de seguretat porta més de 7 setmanes reportat i encara no ha estat sol·lucionat.
    És un altre dels motius pels que prefereixo emprar LibreOffice i la suite online de Google Docs, que s’executa al navegador.
  • En 10 mesos els cotxes completament autònoms, o parcialment conduint de manera autònoma han estat involucrats en 392 xocs als Estats Units.
    • D’aquests, el 70% és a dir 273 xocs van succeïr amb Tesla Autopilot o Full Self-driving beta activats.
    • Honda va estar involucrada en 90 accidents.
    • Subaru en 10.
    • Ford, GM, VW i Toyota van estar involucrats en 5 o menys accidents.
    • No sabem si els vehicles automàtics van ser els culpables, o víctimes d’altres conductors o quants vehicles estaven circulant de cada marca en aquest període.
    • https://www.engadget.com/self-driving-car-technology-crash-data-172606258.html
  • Un enginyer, candidat al senat als Estats Units, està fent una campanya per a prohibir l’auto-pilot de Tesla.
    Està horroritzat que s’estiguin testejant funcionalitats beta en carreteres obertes, amb tràfic real.
    Al gener el CEO de Tesla, Elon Musk, va dir que el pilot automàtic (full-self-driving o FSD) serà la funcionalitat que més beneficis els aporti. De moment ja han doblat el preu d’aquesta funcionalitat opcional de $6,000 a $12,000 USD.
  • I a Califòrnia Cruise ha rebut permís per a cobrar pels seus taxis sense conductor.
    La seva flota de 30 vehicles completament elèctrics, només podran operar a determinats carrers, a un màxim de 30 milles per hora (48 Km/h) i en condicions meteorològiques que no incloguin: pluja forta, boira forta, fum intens, neu o calamarsa.
  • I això em fa pensar que les feines que puguin fer robots seran substituïdes per robots.
  • França força per llei l’ús d’expressions franceses per a referir-se a e-sports, jocs al cloud o streaming.

“streamer” and “cloud gaming,” according to AFP. Going forward, the far more convoluted terms joueur-animateur en direct and jeu video en nuage must be used for any government communications.

https://www.engadget.com/france-officially-bans-english-gaming-terms-like-e-sports-and-streaming-091427663.html

Diuen que volen fer servir paraules que qui no juga a videojocs ni sap informàtica puguin ententre… com si redefinim martell com cosa de ferro que amb la mà modela metall…

Entreteniment

  • Doctor Strange in the multi-verse of madness s’estrena a Disney+ el 22 de Juny

https://www.engadget.com/doctor-strange-in-the-multiverse-of-madness-disney-plus-release-date-192445653.html

  • Pels fan de Guardians of the Galaxy i de Groot, aquell simpàtic arbre/nen, el 10 d’Agost Disney Plus estrena I am Groot (per cert el videojoc de Guardians of the Galaxy està prou bé)

https://www.engadget.com/i-am-groot-august-10-release-date-201401124.html

Videojocs

El XBOX Game Show Extended del 14 de Juny d’enguany:

Programes anteriors

Setmana passada: RAB El nou món digital 2022-06-13 [CA]

Setmana següent: RAB El nou món digital 2022-06-27 [CA]

Tots els programes: RAB

RAB El nou món digital 2022-06-13 [CA]

Aquest és el guió per al proper programa El nou món digital a Ràdio Amèrica Barcelona, a emetre Dilluns 13 de Juny de 2022. 2022-06-13 14:30 Irish Time / 15:30 Zona horària Catalunya / 06:30 Pacific Time.

This is the excerpt of my radio program at Radio America Barcelona on Monday 2022-06-13 14:30 Irish Time / 15:30 Catalonia Time / 06:30 Pacific Time.

Notícies

Història

De les moltes dones increïbles que han fet avançar la humanitat i la tecnologia, avui m’agradaria parlar de Margaret Hamilton, que és la científica i programadora que va fer que la nau tripulada Apolo pogués aterrar a la lluna el 1969, en la missió Apollo 11.

No només va escriure el Software de la nau, si no que va haver de lluitar amb management, que no es prenia seriosament la tasca de programació, que no entenien, i li va dotar a la enginyeria de software d’un respecte necessari.

Va salvar la missió quan per un error humà, la tripulació va activar sensors de baixa prioritat que van saturar el processador de la nau. Ella havia previst l’escenari de molts errors humans, malgrat els seus caps li deien que no calia, i es va poder redreçar la situació i la nau va aterrar a la lluna perfectament.

Aquí es veu el codi que va escriure, en gruixuts llibres, que posats un sobre l’altre superen l’alçada de la científica.

Ella va començar a fer servir el terme Software Engineer, per a que managemen reconegués la importància d’aquesta funció. I va crear conceptes sobre Reliability de Software que fem servir actualment.

https://www.amightygirl.com/blog?p=20084

Lego també va fer un kit el 2017 LEGO Women of NASA set.

Videojocs

Moltes fires de videojocs han anunciat els títols per a Agost i 2023.

A mi m’encanta la quantitat de títols que es podran jugar amb cascos de realitat virtual.

N’hi ha molts, però jo vull destacar un que s’estrena el proper 16 de Juny, que és remake retro de les tortugues ninja, on poden jugar fins a 6 jugadors simultàniament.

I el Goat Simulator 3

  • Sony Playstation està apostant molt fort pels jocs de realitat virtual.
    Han desenvolupat un nou casc i comandaments de realitat virtual que seran la pera.
  • Es pot jugar gratis al resident evil village, sense tenir compte a Stadia, amb el navegador chrome o el mòbil. En ser una demo no pots guardar la partida, però pots saber com és el joc.

Altres programes

Programa anterior: RAB El nou món digital 2022-06-08 [CA]

Següent programa: RAB El nou món digital 2022-06-20 [CA]

Twitch Stream about ZFS, zpool scrubbing, Hard drives, Data Centers, NVMe, Rack Servers…

Twitch stream on 2022-06-06 10:50 IST

In this very long session we went through actual errors in a ZFS pool, we check the Kernel, we remove and reinsert the drive, conduct zpool scrub… in the meantime I talked about Rack, Rack Servers, PSU, redundant components, ECC RAM…

Sorting an Array of Tuples in Python

In this video I show a nice way to work with Data in Python, by using Tuples.

I also show how to easily and conveniently sort the Data based on your preferred criteria by using lambdas.

What happens if we have accents, ç, Ç etc…

You can download the code from:

https://gitlab.com/carles.mateo/python_combat_guide/-/blob/master/src/arrays_with_tuples.py

Fixing the problems installing napalm-base in Ubuntu 20.04 LTS

One of my friends wanted to use SaltStack and https://github.com/napalm-automation/napalm-salt

But he had problems installing napalm-base package.

Note that the package is no longer maintained.

He tried with the last one, and with the previous one (0.25.0), but he always got the error: ModuleNotFoundError: No module named ‘pip.req’

pip3 install napalm-base==0.25.0

Defaulting to user installation because normal site-packages is not writeable
Collecting napalm-base==0.25.0
  Using cached napalm-base-0.25.0.tar.gz (35 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-gzd07xzq/napalm-base_aace1b03ac0e4045bbc85e27c788ebc1/setup.py", line 5, in <module>
          from pip.req import parse_requirements
      ModuleNotFoundError: No module named 'pip.req'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

TL;TR: The problem is that pip version 10, changed the structure for req.

There are several solutions that can be done to make it work, but the easiest way is to downgrade pip, and install the package. After pip can be upgraded again.

python -m pip install pip==9.0.3
pip3 install napalm-base

RAB El nou món digital 2022-06-08 [CA]

Aquest és el guió per al proper programa El nou món digital a Ràdio Amèrica Barcelona, a emetre Dimecres 8 de Juny de 2022. 2022-06-08 14:30 Irish Time / 15:30 Zona horària Catalunya / 06:30 Pacific Time.

This is the excerpt of my radio program at Radio America Barcelona on Wednesday 2022-06-08 14:30 Irish Time / 15:30 Catalonia Time / 06:30 Pacific Time.

En ser festiu el Dilluns 6 de Maig, el programa s’emetí el Dimecres 8 de Maig.

Notícies

Entreteniment

  • S’estranarà aviat una nova pel·lícula de Bola de Drac Z, Dragon Ball Z per a la Mariel ;)
    Es diu: Dragon Ball Super: Super Hero
    Hi ha una campanya per a que es dobli al Català.
https://www.youtube.com/watch?v=aupREwEgclQ

Podeu segui:

@DoblatgeCatala

@RacoManga

  • S’ha estrenat la tercera temporada de The Orville a Disney+
    És una paròdia prou ben trobada i divertida d’Star Trek.
  • Netflix Geeked Week

https://www.theverge.com/2022/5/26/23141205/netflix-geeked-week-preview-sandman-cyberpunk-one-piece

Videojocs

  • M’ha agradat la història de la primera programadora que va fer un videojoc on l’heroïna era una dona

https://gamehistory.org/wabbit/?utm_source=pocket-newtab-global-en-GB

  • Al Juliol apareixerà per a Playstation i PC Stray, un joc on ets un gat en un món post-apocalíptic ple de robots.

Trucs

Seguretat en general:

Enllaç al programa següent: RAB El nou món digital 2022-06-13 [CA]

Enllaç al programa anterior: RAB el nou món digital 2022-05-30 [CA]