Author Archives: Carles Mateo

Troubleshooting a shell prompt irresponsible

You do df -h or ls / and the terminal freezes and not even CTRL + C works, you have a lock.

Normally this is due to a lock of the system trying to perform an IO.

Could be a physical spinning disk failing, but the most probably nowadays is that you have a network mount point and it is timing out.

If you execute mount and you get a timeout, and when you finally see the list you see a NFS, iSCSI or another kind of Network mount (you will see an Ip Address), check for errors.

To do this in CentOS/RHEL you can do as root:

dmesg | grep -i "timed"

or depending on the System

cat /var/log/messages | grep -i "timed"

You’ll get something like this:

[root@compute01 carles]# dmesg -T | grep timed | head -n5
[Fri Mar 20 02:27:44 2020] nfs: server storage07 not responding, timed out
[Fri Mar 20 02:27:44 2020] nfs: server storage07 not responding, timed out
[Fri Mar 20 02:27:44 2020] nfs: server storage07 not responding, timed out
[Fri Mar 20 02:27:44 2020] nfs: server storage07 not responding, timed out
[Fri Mar 20 02:27:45 2020] nfs: server storage07 not responding, timed out

Please note I use dmesg -T in order to have human readable date instead of Unix Epoch.

You can count the errors today:

[root@compute01 carles]# dmesg -T | grep time | grep "Mon Apr 6" | wc --lines
3123

I cancelled my Amazon Prime subscription

I was using a lot Amazon. Sending parcels to my previous job offices, and now to Blizzard offices, so I subscribed to Amazon Prime. With COVID-19 virus we were sent to do Remote Work, and now with the lock down basically I’m 99.99% of the time at home.

I did a test to see how it works sending to home during the pandemic.

I choose two different items, I reviews the order, they were going to be delivered separately, one day of distance.

I choose two items that will fit in my mailbox, separated or together. One USB3 3mts male female and a Blu-ray movie.

My surprise comes when I go to the mailbox one day before and I see that I have a paper from an-post telling that they pass by to deliver my parcel, and they did not leave because it doesn’t fit the mailbox and they did not want to leave it a common space. For my surprise both Amazon parcels were grouped and sent before time. Maybe in a bigger box. But the mailman did not ring my door.

The paper tells me to get my parcel in the middle of the city, during the lock down. No way! I’m not going to risk my health and specially from elders, just to grab a cable and a movie.

I had the chance to request re-delivery to an Post, so I do. I fill all the info, I inform my phone number, email, I indicate which door to ring, and two days after as promised… a paper from an Post!.

They did not even rang my bell again.

I go to Amazon to cancel the order, but the process is only created for if you got the items.

Fuck it. I’m not going to order anything else to Amazon until that COVID-19 passes.

I don’t know if the postman just avoids people for fear to contagion or the process of an Post is awful and he didn’t get any information. But I’ll not buy anything even if I cannot buy in other places cause the lock down.

I was going to maintain my Amazon Prime subscription, even if I know that I’ll not use it much with the lock down, but makes no sense. Also:

  • I use Netflix and my Raspberry Pi 4, I was not using Amazon Prime Video.
  • I use Spotify, I was not using Amazon Prime Music.
  • I like to read in paper, not in eBook, so I was not using the eReader options.

A nice way to loss a customer.

Datacenters, D&R and coronavirus

I’ve been working for years within Data centers, with D&R strategies, and then in the middle of COVID-19, with huge demands on increments of bandwidth and compute, some DCs decided to do not allow in the Engineers of their customers.

As somebody that had my own Startup and CSP and had infrastructure in DCs and servers from customers in colocation, and has replaced Hw components at 1AM, replaced drives from broken RAIDs, and fixed systems so many times inside so many Datacenters across the world, I’m shocked about that.

I understand health reasons can be argued, but I still have Servers in Datacenters because we all believed they were the most safe place, prepared for disaster and recovery, with security, 24×7… and now, one realise that cannot enter to fix or upgrade the own machines.
Please note, still you can use the remote hands from the DC, although this is not a good idea many times, I’m not sure this will still be an available option when the lock down in those countries becomes more strict.

I’m wondering if DCs current model have any future at all.

I think most of the D&R strategies from now will be in the cloud, in different regions, with different providers, so companies can resist providers or governments letting them down.

Blocking some offending Ip’s easily with Ubuntu ufw

Ok, so we know that there are several ip’s that have attempted to hack the blog.

We know they try different urls looking for a exploit, or they try to hack a password by brute force…

We are using Amazon EC2 and the old infrastructure, not a VPC Network, so we cannot block a specific Ip to our Web Server.

In an article from 2015 I explained How to Stop a BitTorrent based DDoS attack, and was using iptables for that.

In this example I will show how to use ufw to block tow specific Ip’s, execute as root or with sudo:

ufw insert 1 deny from 89.35.39.60 to any
ufw insert 2 deny from 85.204.246.240 to any
ufw allow OpenSSH
ufw allow 22/tcp
ufw allow "Apache Full"
ufw enable
ufw status numbered

You can do ufw status numbered to see the status of ufw and the rules order.

root@ip-111-111-111-111:/home/ubuntu# ufw status numbered
Status: active
To Action From
-- ------ ----

[ 1] Anywhere DENY IN 89.35.39.60
[ 2] Anywhere DENY IN 85.204.246.240
[ 3] Apache Full ALLOW IN Anywhere
[ 4] OpenSSH ALLOW IN Anywhere
[ 5] 22/tcp ALLOW IN Anywhere
[ 6] Apache Full (v6) ALLOW IN Anywhere (v6)
[ 7] OpenSSH (v6) ALLOW IN Anywhere (v6)
[ 8] 22/tcp (v6) ALLOW IN Anywhere (v6)
root@ip-111-111-111-111:/home/ubuntu#

If you need to delete a rule, use the number on the left and, just type:

sudo ufw delete 2

Making responsive WordPress Theme Twenty Twelve to support greater resolutions

This is the first article I write about FrontEnd in here, as this is very casual and trivial, and I wanted to specialize the blog in Extreme IT, going deep into knowledge and difficult questions. And in any case, more for BackEnd, Engineering, and Hardware and Operations.

But as it is something useful and myself didn’t found an answer when I googled it, I think is no bad to share it here. Nevertheless I’ll not make it appear in the front page to be loyal to my essence.

So I like Twenty Twelve WP Theme. It’s clear, that’s what I expect from a blog from an Engineer: easy to read. Maybe is to Spartan, but that’s grant.

The instructions to do like me:

  1. Make a copy of your original Twenty Twelve Theme in another directory, at the same level
  2. Edit the file /var/www/blog.carlesmateo.com/wp-content/themes/2021-blog-carlesmateo-com/style.css
  3. Add a new section like this

So I defined a new @media screen with min-width of 1800px.

Why 1800px and not 1920px like Full Hd?. Because Ubuntu use some width for the lateral bar.

Then over body .site section I set a max-width: 1800px that will do the trick for some browsers, and the rem value that will do the trick for Chrome.

Now the main section of the block can be correctly displayed using most of the space available.

Media Player in my Raspberry Pi 4

Just installed a media player in my Raspberry Pi 4

So I mentioned it was one of my pending tasks, to do while I’m confined here, at home, to help the Irish government to stop the quick spread of the coronavirus.

I’m happy that the situation in Ireland has stabilized, unlikely in Spain, where that historical lack of discipline and selfishness and super ego to believe Madrid the capital of the world, and so deciding not to close it for quarantine, will cause a lot of pain. I hope the closing of frontiers in Catalonia works.

Well, what I do you’re probably asking yourself, so I installed LibreELEC https://libreelec.tv/.

They have a very nice SD image writer for Linux, Mac and Windows, that will install the proper image on the micro-SD for your ARM device.

This Raspberry Pi 4 comes with Wifi integrated and a Gigabit Ethernet network port.

When I was in Barcelona, I had Kodi with Raspberry pi 2 and version 3.

This model v. 4 is much more cooler. I bought the 4GB version, and has 2xHDMI 4K.

So it is great to connect to any modern TV.

In Barcelona, I have Linux tower as NFS Server sharing my files with the Pi. Work good, even for the 100Mbit NIC of the version 3, but at that time I was only playing Full HD as the Pi didn’t supported greater resolution, and I only had that resolution on my displays too.

For now, I’m going to explore how is reading from a USB 3.0. Let’s see if it’s able to play smoothly.

The cool thing also is that I have SSH access, and so I can use the Pi for many more things. :)

I have my first update, I noticed that copying to that USB was not the best for me, as I tried to copy a .MKV file of 4.9GB and I encountered the limit of 4GB of FAT32. I could format the USB as ext4, but what I did is, SSH into the box, I see that I have two partitions on the SD for booting the Pi, the second one is a ext4 called storage. So I copied to the SD, through the network, using sftp the file I wanted.

The Gigabit connection was fast, but when the buffer fulled it started to show the real speed of the SD which is 15MB/s for writing.

Ext4 has no problem in holding a file 4.9GB so I’m watching my movie now. Will think about setting a NFS for the Pi as it will be very convenient. :)

I have an external, remote, keyboard logitech, but it happens that LibreELEC recognizes my Sony command, from the television. I don’t need the keyboard/mouse. Nice.

Here you can see my Raspberry Pi 4, connected to TV, in “combat mode”, naked, as PoC, before setting in its definitive place behind the TV.

Playing from the external USB 3.0 stick was also fluid, allowing 4K perfectly.

The only problem I has was when I was pushing movies to the USB through the network, and playing at the same time from the SD. It seems like the Raspberry reached its limits doing this and playing stuck frequently.

Remote working is here

So remote working is here.

After years in which many Engineers requested to the companies to be able to Remote Work, with most of answers No, now it happens that not only is good for the company, is the only way to ensure continuity of business, of many businesses.

One of my colleagues from Denmark, which government has shutdown the country by sending all the public servants to home, in order to prevent the spread of the coronavirus, told me:

“Yes, remote working is here, but has been necessary the four horsemen of the apocalypse”

It is curious, how Remote Working has arrived, no thanks to that was obvious, but due to external emergencies. And I’m glad that my company was prepared for business continuity.

I’ll be staying home, working remotely, in order to contribute to non-spreading the virus, specially among old people. I’m perfectly healthy but that’s a use case, many people will not develop the symptoms and still be able to spread to others.

So I have some plans related to technology to do at home, including few improvements to the blog. What are your plans?.

Update: 2020-03-13 23:16 UTC I’m thinking in all those business which are forces to close, and all the employees that will not get a salary, or will be fired, or will get a salary and the business owner maybe ends in bankrupt as is paying the salaries and no income is being generated.

Update: 2020-03-19 10:58 UTC Some of my friends, even in Human Resources/Recruiting, are starting to remote work for first time. So here is some advice:

I would recommend to get an external monitor, at least 22″, so you neck is not forcing position looking low and your eyes don’t suffer, good light (don’t in dark), a nespresso can be a good friend in the morning, and to have your hands and arms aligned correctly so you don’t suffer from a bad position. Watch the position of the wrists, your arms should be comfortably at the same level than the table, similar in an L, and your eyes be aligned to the top of your monitor. Finally I would recommend to follow a routine, like if you were going to work, so dress like you would do. Don’t stay at home all day in pijamas! ;)

News for the blog, upwards and onwards

2020-03-06 Heya, I’m doing a set of improvements to the blog.

One, you can already see. I added a new section to the CSS @media, so now screens bigger than 1,800 px in width, will use that width for rendering the page. The original WordPress theme at 960x was too small for our current screens. I will add a new CSS @media for 4K screens promptly.

Other is about the organization of the content. I want to separate a bit the contents, now articles are sequential and is difficult to discover nice contents if they have 2 or more articles more recent, so I will group articles by content and provide a small index on the top page. Also I will provide more areas for Operations, SRE, where it will be easy to locate code, scripts, tricks… things that are useful to our day to day. I also want to make visible the articles about living in different cities, for IT Engineers, with useful tricks and tips. And keep the more complex and more interesting Engineering matters in the main page.

Updates

2020-03-13 15:49 Added SSL to the blog

With more delay I wanted, I bought a SSL certificate, configured Apache, and after few changes to the blog has been set. One very annoying is that WordPress linked the images statically pointing to http://blog.carlesmateo.com so I changed the latest article’s images to point to relative path so they will work nice with http or https.

My reflection is that everything negative can have its positive output. With this coronavirus thing, I decided to focus into improving things. And so I’m doing. :)

Working in Barcelona, Catalonia, for IT Engineers

Created in: 2020-02-20 by Carles Mateo Last Updated: 2020-03-13 19:29 UTC

Note: This document is under construction

Society, Politics and laws

Barcelona is the capital of Catalonia, a Nation with a strong desire of freedom, that wants to get the independence from Spain (which invaded militarily in 1714 and bombed the city many times). Catalans are very different in small villages and in the city center, but me as Catalan, I think that we are nice but reserved, because we are used to be prosecuted just for being Catalans, so we people don’t earn our trust easily. However, if you make a Catalan friend, our loyalty is like family. This is related since medieval books already.

When we suffered the Spanish invasion in 1714, and later the invasion of dictator Franco with the help of Hitler and Mussolini, the Catalan language was forbidden, prosecuted, universities closed, Catalan Constitution removed, Parliament closed… but part of the freedom was recovered in 1975 when the fascist dictator Franco died. Most of the Catalan particularities were forced into assimilation to the Spanish model, however one interesting thing that was not changed was the Civil Right. That’s very important cause some laws survived and are different from the Spanish laws, and from most of the places in the world. One worth to mention is that our Civil Law gives us “Separation of Goods” (separacio de bens), and that means, that if two people marry and one has 3 houses and €20,000 in the bank, and the other has €500 in the bank and nothing else, if they divorce, they’ll get exactly what they had. So individual A will keep their 3 houses and €20,000 and B €500. This is very different from the “Earning Goods” (bienes gananciales) in Spain, where if they divorce A and B would get exactly half of everything. When they get married is like everything goes to the common pool.

Must say that there are details, like if the partner leaves the job in order of take care of the house, they may get something in compensation, or if there are children, at least one house will be for the mother if taking care of the children, and the father will have to pay a pension to feed and take care of the children. Still, it seems to me much more fair that what I saw in most of the countries (even if in some they have pre-marital contracts).

The Catalan society is hard worker and loves to read and to study. Compared often to the Jews, as an insult, by the fascist authorities in Spain during the dictator.

One show of the passion for reading can be manifested by Sant Jordi’s celebration, the 23th of April, which is a day in which girls gift a book to the men, and men gift a rose to the women they love, or they family or female friends.

The Castellers or Human Towers are declared World Heritage and have been present in many international celebrations like Olympic Games.

And the traditional parties in the villages have many books talking about them and are epic.

As Catholics, it is typical to have “el pesebre”, a recreation of the birth of Jesus, but our irreducible character have has to have particular elements like “el Caganer”, which have became world wide famous few years ago.

Pesebre de Nadal

The love for Freedom and the defense of Human Rights has been a characteristic tread of the Catalan culture since it’s origins, around the year 8th Century and the first bilingual dictionary known is Catalan-German German-Catalan. Catalans also invented the navigation code for ships that became universally accepted. Probably this loves for Freedom is what makes Barcelona and Catalonia a place full of entrepreneurs and small business owners. It is said that “Catalans, from the rocks they make bread” (els Catalans de les pedres en fan pans) about the inventive we have to detect opportunities where others see nothing.

The 11th September is the national day, and is the day the Catalans remember that they fight to the end for their freedom that 1714, alone, against Spain and France troops. That day every year, there are many cultural acts, and there is a demonstration for Independence that some years got to 2 Million people, from a total population of 7,5 Million. You can visit parts of the city where there are still holes in the walls from the different times Barcelona has been bombed, at different ages, from Romanic era to 20th century.

Weather

The weather in Barcelona use to be excellent. Sun is present from 7 in the morning to 20:00 almost all the year, and specially in June, July and August, people enjoy the beach.

It has a weather similar to California.

It rarely snows, but if you go to the North, near Pirineus montains, you can see snow in winter.

Even if weather use to be excellent, with no wind at all, and few frequent rain, must be said that when it rains it rains. Rain can last 4 hours and more, and be very intense. Very often the semaphores (traffic lights) stop working in Barcelona when it rains.

The city

The city is very well designed with most of it being square islands similar in size. Is easy to drive as every street is two ways and you can go back by just turning right right right right or left left left left.

With a beautiful architecture thanks to genius like Gaudi, or Dali (both put in jail for talking Catalan at different times) .

Sants street is the longest commerce way, in Europe they say, created by many small commercial stores. Many of them have been bought or replaced by Chinese, as the traditional owners could not afford the more and more higher rents for commercial locals in Barcelona. Still many resist.

Transport

The city has buses, metro, taxis, tram, bicycles that you can use paying a yearly sum.

Huber was forbidden by the Spanish government.

Taxis in Barcelona are very characteristics, all the same color, black and yellow. In the airport there is an official taxi stop, so don’t get to any random guy that asks you if you want a taxi. The taxi drivers are in a specific place and they will not go to you, as they expect you to go to them.

In the city you can stop a taxi just by raising your hand horizontally, but only the cars with a green light turned on are available, the other have a customer inside and will not stop.

Airports

Local food

One typical food. “La calçotada”. Which is a social party, normally for lunch where we eat scallion/spring onions and meat cooked at the fire on the barbecue. We peel the external layers, and eat with a sauce called “romesco”.

Calçots, scallions grilled at the barbequeu
Butifarra d’ou (egg sausage, to eat like that)

Population

Languages

Religion

airbnb and hotels price

The controversial mayoress has forbidden airbnb in Barcelona. It is only allowed to red a room, but not the entire flat.

Hotels prices range from €110 to €175 per night, except when the city is full and prices double or triple. For example for the Mobile World Congress.

Price of the rent

In the recent years rent has increased a lot.

In the year 2020 a flat with furniture, 5 years old new, 80 square meter in a middle class zone, can cost around €1,200/month.

English and expats

Well, it’s a shame. In Barcelona few people talk a decent English or even understands it.

You better print the address of the places you go to show to the taxi driver.

Salaries for IT

Barcelona is one of the most attractive places in Europe for IT.

A low cost of live compared to major cities like Berlin, London, Edinburgh, Cork or Dublin, and salaries very high for IT, with the excellent weather, a market of 40 millions Spaniards and 7.5 million Catalans (around 10 if we count Catalan speaking zones in the Meditarrean sea).

The minimum inter-professional salary is (updated to Jul 2019) €1,050 net per month.

Salaries for a Senior Software Engineer with 5 years experience will range between €35,000 and €55,000 gross per year. Most of companies provide an optional bonus too.

€55,000 gross per year is approximately €3,267 net per month within 12 payments in a year.

Internet

Buying Hardware

Barcelona is full of Hardware stores. There is one street where they are concentrated, is called Sepulveda street.

Security

Police

Nightlife

Dangers/Terror histories/Bad experiences

There are many to tell, I’ve pending explaining seeing thieves in the airport, fake taxi drivers offering their services, pickpocketers in the center, skinheads robbing in the metro… don’t ever leave your belongings unattended.

LGTB+

Restaurants

Those are my recommendations.

La parra

I come here since I was a child

http://restaurantlaparra.cat/

Santamasa

http://www.santamasarestaurant.com/

Centric 35

Is from a good friend of mine 😊 The Cheff and owner. If you tell Oriol that you’re a friend of Carles he will be very happy.

https://www.tripadvisor.ie/Restaurant_Review-g187497-d3635494-Reviews-Centric_35-Barcelona_Catalonia.html

https://restaurantcentric35.business.site/

Clarius (Catalan-French cuisine)

https://hedofoodia.blogspot.com/2019/05/clarius-restaurant-barcelone.html

Can Xurrades

http://www.canxurrades.com/


1881 per Sagardi

Restaurant and terrace in the Museu d’Historia de Catalunya
Plaça de Pau Vila, 3, 08003 Barcelona
At the top of the Museum of History of Catalonia you can enjoy a restaurant, a coffee bar, and a terrace for having cocktails. The terrace is a cityview where you can see all the port and part of Barcelona. Is very beautiful at nights. There are few tapas bars and pubs and open discos just down next to the Museum’s entrance.

http://www.mhcat.cat/la_visita/mirador_restaurant/restaurant_1881

The museum is very interesting too.

1902 Cafe Modernista

Next to the Recinte Modernista Museum, you can have tasty tapas with beautiful views and after going to the museum.

Carrer de Sant Antoni Maria Claret, 167 | Recinte Modernista de Sant Pau, 08025 Barcelona
(st Sant Antoni Maria Claret, 167)


https://www.tripadvisor.ie/LocationPhotoDirectLink-g187497-d6503265-i137778634-1902_Cafe_Modernista-Barcelona_Catalonia.html

The terrace is owned by the restaurant which is inside, and is very nice, and the menu looks amazing.

Iconic places in Barcelona city

Sagrada Familia from Gaudi.

F.C.B. Football Club Barcelona stadium “Nou Camp”.

Nearby Iconic places

Monserrat, has unique type of rounded mountains. And on top, in the church, there is “la Moreneta” which is a figure of the Mother of Christ, which is black.

Activites