A quick video, of 3 minutes, that shows you how it works.
If you don’t have pandas installed you’ll have to install it and lxml, otherwise you’ll get an error:
File "/home/carles/Desktop/code/carles/blog.carlesmateo.com-source-code/venv/lib/python3.8/site-packages/pandas/io/html.py", line 872, in _parser_dispatch
raise ImportError("lxml not found, please install it")
ImportError: lxml not found, please install it
You can install both from PyCharm or from command line with:
pip install pandas
pip install lxml
And here the source code:
import pandas as pd
if __name__ == "__main__":
# Do not truncate the data when printing
pd.set_option('display.max_colwidth', None)
# Do not truncate due to length of all the columns
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
pd.set_option('display.width', 2000)
# pd.set_option('display.float_format', '{:20,.2f}'.format)
o_pd_my_movies = pd.read_html("https://blog.carlesmateo.com/movies-i-saw/")
print(len(o_pd_my_movies))
print(o_pd_my_movies[0])
Aquest és el guió per al proper programa El nou món digital a Ràdio Amèrica Barcelona, que s’emet els Dilluns a les 14:30 Ireland 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 that airs on Mondays 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.
Aquesta és la pàgina del programa del Dilluns 18 de Juliol de 2022 amb la grabació en vídeo, en directe, i una secció extesa.
This is the page for today’s program, July 18th 2022. A video in English will be uploaded ASAP.
Avui duia una samarreta dels Catarres, que me la van signar a un concert a Irlanda, a Dublin. Us deixo una cançó que m’agrada d’ells.
Today I was wearing a t-shirt from “els Catarres”, a Catalan band. They signed it for me in a concert in Dublin, Ireland. I share one of their songs, which I like.
Seguretat
Parlem una mica, debatent, sobre problemes de seguretat i com els oients poden protegir-se:
Estafadors que truquen i es fan passar pel servei de salut per a capturar dades o per a fer-te baixar un programa.
La Mariel comentava la setmana passada sobre la notícia de la vanguardia que diu que l’estat espanyol lidera les posicions (de víctimes) de robatori d’informació.
Vull comentar que no m’agrada la vanguardia perque és hispanocèntrica i sempre dóna les notícies en el marc mental de l’estat espanyol, i a mi m’interessen les notícies en el marc mental dels països catalans:
Què passa a Girona? I a Perpinyà? I a Xàtiva? I a l’Alguer? Què passa a Andorra?
Aquest és el marc mental de notícies que m’interessa.
Bandes que han desactivat a Barcelona i que aprofitant ho apretats que està la gent passaven lectors RFID per a aprovar vendes de menys de 30 €.
Contra això hi ha unes fundes que jo he regalat a la meva família i amics.
I per robatori d’informació vol dir número de tarja de crèdit, credencials per a accedir a la banca electrònica.
Cal matitzar que el 60% dels atacs provenen de Rússia.
I en molts casos, no ho diu la notícia però jo ho sé, de la Xina.
Bàsicament indrets on és molt difícil perseguir als delinqüients.
Sobretot ataquen per correu electrònic i SMS fingint ser missatges del banc
De nou us recordo els perills d’emprar software pirata, i us recomano que tingueu sempre la càmera del portàtil coberta amb una pestanyeta.
Veiem què passa a Catalunya, segons informa Vilaweb:
Un grup d’estafadors informàtics ha robat 8 milions d’euros a entitats públiques catalanes com ara ajuntaments, consells comarcals i hospitals: la banda es va apropiar de més de mig milió d’euros del Servei Català de Trànsit (SCT), 544.320 de l’Ajuntament de Viladecans, 498.620 de l’Hospital de Sant Pau i 481.403 euros del Consell Comarcal del Baix Ebre
Van fer servir enginyeria social (es van fer passar per un proveïdor)
Explota el fet que Anglaterra està cobrant aleatòriament custom taxes (frontera)
Fixeu-vos que la url intenta enganyar fent creure que és anpost.ie però en realitat el domini és ie-postage-pay-fee.com
Podeu fer una cerca del domini a whois i veureu que el domini s’ha create fa quatre dies i que el propietari no és correu d’Irlanda AnPost, si no una persona individual amb un email de gmail.
Un típic email d’estafa dels clàssics, de tota la vida que també vaig rebre a l’email:
Scam
Notícies sobre seguretat
Han hackejat una base de dades de la policia a la Xina, i han robat més de 1,000 milions (1 billion anglès) de dades personals. Nom, adreça, document d’identitat…Demanen 10 bitcons, ara mateix USD $198,000 dollars
A Estats Units Amazon pot proporcionar a la policia la informació de les seves càmeres i porters automàtics sense necessitat de demanar permís al propietari
Imaginem si la policia espanyola pogués fer el mateix?.
L’anglès: llanceu-vos. Tinc companys que porten més de 10 anys a Irlanda, i segueixen tenint accent. Que no us aturi això. Hi ha varietats d’accents al món. I a Irlanda parlem l’Hiberno English.
Europa ha legislat que als 2024 els cotxes hauran de tenir uns limitadors de velocitat. Això te certs perills, com el risc de que assaltants t’interceptin.
Una filtració posa al descobert els emails d’Uber, i el co-fundador va emprar i estimular la violència per a fer crèixer el suport social a la companyia
FROM ubuntu:20.04
MAINTAINER Carles Mateo
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y vim python3-pip && \
apt install -y net-tools mc vim htop less strace zip gzip lynx && \
apt install -y apache2 mysql-server ntpdate libapache2-mod-php7.4 mysql-server php7.4-mysql php-dev libmcrypt-dev php-pear && \
apt install -y git && apt autoremove && apt clean && \
pip3 install pytest
RUN a2enmod rewrite
RUN echo "Europe/Ireland" | tee /etc/timezone
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_LOG_DIR /var/log/apache2
COPY phpinfo.php /var/www/html/
RUN service apache2 restart
EXPOSE 80
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
File: phpinfo.php
<html>
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>
</html>
File: build_docker.sh
#!/bin/bash
s_DOCKER_IMAGE_NAME="lampp"
echo "We will build the Docker Image and name it: ${s_DOCKER_IMAGE_NAME}"
echo "After, we will be able to run a Docker Container based on it."
printf "Removing old image %s\n" "${s_DOCKER_IMAGE_NAME}"
sudo docker rm "${s_DOCKER_IMAGE_NAME}"
printf "Creating Docker Image %s\n" "${s_DOCKER_IMAGE_NAME}"
# sudo docker build -t ${s_DOCKER_IMAGE_NAME} . --no-cache
sudo docker build -t ${s_DOCKER_IMAGE_NAME} .
i_EXIT_CODE=$?
if [ $i_EXIT_CODE -ne 0 ]; then
printf "Error. Exit code %s\n" ${i_EXIT_CODE}
exit
fi
echo "Ready to run ${s_DOCKER_IMAGE_NAME} Docker Container"
echo "To run in type: sudo docker run -p 80:80 --name ${s_DOCKER_IMAGE_NAME} ${s_DOCKER_IMAGE_NAME}"
echo "or just use run_in_docker.sh"
echo
echo "If you want to debug do:"
echo "docker exec -i -t ${s_DOCKER_IMAGE_NAME} /bin/bash"
If you are getting an error like this when you try to provision using rsync or running commands from SSH from a Docker Instance from a worker node in Jenkins, having your SSH Key as a variable in Jenkins, here is a way to solve it.
These are the kind of errors that you’ll be receiving:
Load key "ssh_yourserver": invalid format
web@myserver.carlesmateo.com: Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
script returned exit code 255
So this applies if you copied your .pem file as text and pasted in a variable in Jenkins.
You’ll find yourself with the load key invalid format error.
I would suggest to use tokens and Vault or Consul instead of pasting a SSH Key, but if you need to just solve this ASAP that’s the trick that you need.
First encode your key with base64 without any wrapping. This is done with this command:
Note that in this case I’m ignoring Strict Host Key Checking, which is not the preferred option for security, but you may want to use it depending on your strategy and characteristics of your Cloud Deployments.
Note also that I’m indicating as User Known Hosts File /dev/null. That is something you may want to have is you provision using Docker Containers that immediately destroyed after and Jenkins has not created the user properly and it is unable to write to ~home/.ssh/known_hosts
I mention the typical errors where engineers go crazy and spend more time fixing.
Aquest és el guió per al proper programa El nou món digital a Ràdio Amèrica Barcelona, a emetre Dilluns 11 de Juliol de 2022. 2022-07-11 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-07-11 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.
Aquesta és la pàgina del programa de ràdio emés l’11 de Juliol de 2022.
El nou món digital en Català
This is the page for the radio program streamed July 11th 2022. Soon I will upload the video in Catalan. Here is the version in English:
The New Digital World, New about Science, Technology, Entertainment and Video games in English.
Hi ha moltes novetats, i el temps de programa és limitat, així que he marcat en blau aquells articles dels que vull parlar.
Nous Gadgets
Xiaomi ha tret al mercat diversos models 12S Series amb càmeres super potents de Leica i sensor IMX989 de Sony.
Poden fer fotografies a 50.3-megapixel o a 48-megapixel ultra-wide
Netflix ha penjat la primera pel·lícula original doblada al català. Es tracta de la producció d’animació ‘El monstre marí‘ i és també el primer film original infantil que una plataforma dobla al català.
La plataforma l’ha doblat del seu pressupost, sense rebre cap subvenció.
‘El monstre marí’, a més, ha estat doblada a l’euskera i al gallec.
El 14 de Juliol s’entrena una sèrie de Resident Evil a Netflix. Zombies i monstres que no li agradarà a la Mariel.
He vist una sèrie nova de Netflix que m’ha agradat molt: God’s favorite idiot.
He vist disponible a Netflix Idiocracy, que encara que és antiga la recomano molt. És una pel·lícula d’humor que tracta sobre què passaria si la evolució fes a la espècie humana menys intel·ligent.
Està disponible al cinema: Thor Love and Thunder.
A una companya de feina li ha encantant.
I també disponible al cinema des de l’1 de Juliol:
Minions: The Rise of Gru
Samsung va estrenar el proppassat 30 de Juny el seu servei Gaming Hub per a les seves Smart TVs i Smart Monitors.
En vam parlar en anteriors programes, i bàsicament es pot jugar a jocs al cloud, sense menester consola o ordinador.
Amazon ha llançat el seu servei Luna Cloud, que permet jugar a jocs de manera gratuïta als subscriptors d’Amazon Games Prime, a canvi d’una quota mensual.
La Mariel em comentava abans sobre la notícia de la vanguardia que diu que l’estat espanyol lidera les posicions (de víctimes) de robatori d’informació.
I per robatori d’informació vol dir número de tarja de crèdit, credencials per a accedir a la banca electrònica.
Cal matitzar que el 60% dels atacs provenen de Rússia.
I en molts casos, no ho diu la notícia però jo ho sé, de la Xina.
Bàsicament indrets on és molt difícil perseguir als delinqüients.
Sobretot ataquen per correu electrònic i SMS fingint ser missatges del banc
De nou us recordo els perills d’emprar software pirata, i us recomano que tingueu sempre la càmera del portàtil coberta amb una pestanyeta.
Aquest és el guió per al proper programa El nou món digital a Ràdio Amèrica Barcelona, a emetre Dilluns 4 de Juliol de 2022. 2022-07-04 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-07-04 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.
And the program in English:
Actualitat
Elon Musk ha fet fora 200 treballadors d’Autopilot i ha tancat les oficines de San Mateo. Ha transferit 350 treballadors a altres oficines.
La majoria de les posicions eren referent a l’etiquetatge de la informació rebuda dels clients.
A l’inici de Juny Musk va enviar un email als treballadors comentant que te un “super bad feeling” i que hi hauria acomiadaments. Sembla que vol acomiadar un 10% dels treballadors per a adelantar-se i reduir costs doncs sospita que hi haurà una recessió.
Uber ha publicat el seu segon informe bi-anual per als anys 2019 i 2020. I uber va rebre 3,824 reports de sexual assault o comportament inapropiat. 101 persones van morir degut a accidents mentre anaven en uber (la companyia diu que en la majoria dels casos els accidents van ser causats per tercers)
En el primer informe bianual, que va cobrir 2017 i 2018, el report de sexual assault van ser 5,981.
Tenint en compte que el 2020 estàvem en pandèmia no sembla que hagi millorat el tema.
Això em fa preguntar-me quins criteris de seguretat te en compte uber abans de permetre a un conductor d’unir-se a la seva xarxa.
I Cruise, l’empresa de robo-taxis de General Motors, (taxis sense conductor) que pot circular en alguns carrers d’Estats Units, al vespre ha protagonitzat una vaga no planificada quan la seva flota de cotxes es va aturar sense motiu, bloquejant el tràfic durant hores a molts carrers de San Francisco.
A l’Abril un policia va flipar quan va aturar un vehicle que no duia les llums enceses, i es trobar que no tenia conductor, que era un robo-taxi. No el va poder multar.
És 4 de Juliol i als Estats Units és festa. Aquest dia i aquesta setmana hi sol haver ofertes amb descomptes.
M’ha cridat l’atenció la notícia que diu que el príncep de Gal·les, que va acceptar un maletí amb un milió d’euros i dues donacions més d’un milió cadascuna, en total dos milions i mig de lliures d’un magnat àrab, diu que ho va donar a caritat i que no ho farà més.
Entreteniment i videojocs
Com va intuïr la Mariel, Netflix i Disney+ estan treballant en un compte més barat amb anuncis
As in my case my jenkins container Id is 77b6a5a7ae8d in order to know the jenkins administrator password I check the logs for my jenkins Container with docker logs 77b6a5a7ae8d:
docker logs 77b6a5a7ae8d
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2022-06-26 21:02:05.492+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @549ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-06-26 21:02:05.583+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file
2022-06-26 21:02:05.613+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2022-06-26 21:02:05.674+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 11.0.15+10
2022-06-26 21:02:05.986+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2022-06-26 21:02:06.020+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2022-06-26 21:02:06.020+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2022-06-26 21:02:06.021+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms
2022-06-26 21:02:06.463+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2022-06-26 21:02:06.647+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started w.@7cf7aee{Jenkins v2.346.1,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2022-06-26 21:02:06.668+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStart: Started ServerConnector@4c402120{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2022-06-26 21:02:06.669+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: Started @1727ms
2022-06-26 21:02:06.669+0000 [id=25] INFO winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2022-06-26 21:02:06.925+0000 [id=32] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization
2022-06-26 21:02:07.214+0000 [id=39] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2022-06-26 21:02:10.781+0000 [id=47] INFO jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2022-06-26 21:02:10.794+0000 [id=35] INFO jenkins.InitReactorRunner$1#onAttained: Started all plugins
2022-06-26 21:02:10.803+0000 [id=42] INFO jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/var/jenkins_home/war/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2022-06-26 21:02:11.634+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: System config loaded
2022-06-26 21:02:11.635+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: System config adapted
2022-06-26 21:02:11.642+0000 [id=48] INFO jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2022-06-26 21:02:11.645+0000 [id=46] INFO jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2022-06-26 21:02:11.668+0000 [id=67] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$1: Started Download metadata
2022-06-26 21:02:11.675+0000 [id=67] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$1: Finished Download metadata. 4 ms
2022-06-26 21:02:11.733+0000 [id=52] INFO jenkins.install.SetupWizard#init:
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
3de0910b83894b9294989552e6fa9773
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
2022-06-26 21:02:22.901+0000 [id=52] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
2022-06-26 21:02:23.013+0000 [id=24] INFO hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
In my case the password is at the bottom, between the stars: 3de0910b83894b9294989552e6fa9773
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.
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.