The minimal life support – The MARS discussions (III)

Let’s say everything else is fine and we plan to have soon 50 people living on Mars. What would we need for a minimal welfare state? I can imagine whoever signed for such an enterprise must be of a special type of people, however, this is not a reason for being uncivilised. Let’s start with the basic needs and keep building up from there.

Food is a must. We all know, as I said before, that probably we can plant potatoes on Mars. With potatoes we can prepare a wide variety of dishes, but it’s not going to be enough for a healthy diet. We need variety. This is my bet: mushrooms. They are easy to grow and varied in flavour. They can even be used to build walls, doubling then on usage. Imagine it like this: when you’re hungry, you can eat a wall. In addition it is relatively easy to transport them, as easy as seeds, but they may not need as much space, or as much light as a crop of wheat, for example. How about animals? What kind of animals they will have, if any? Will they bring pigs, cows, or chickens? Those big animals may not easily fit on a spaceship, where each millimetre and each pound costs money. The solution is to travel with eggs : chicken, doves, and fishes. The biosphere can then be completed with insects like earthworms.

We have described above a very basic ecosystem where the human is at the top. We can discuss how to control that in another post, but where should that ecosystem be? Integrated with the colony or separated? I would say separated – after all animals are animals – so we will need at least two buildings, the Biodome and the Housedome. Our putative martians can go to the Biodome to enjoy an Earth-like farm, so to say, and keep the Housdome automatically cleaned. Maybe the Housedome can even be just the cockpit of the Spaceship, or maybe built from a dismantled one. I will add a third one that I will call the Tooldome, where the workshop is situated, basically a huge space with atmospheric pressure so that people can work comfortably without any spacesuit on, for example, repairing a rover or an air machine, like the ones used to create a breathable environment. It can also be used as a party hall, or cinema, or even a baseball field. Yeah, why not. Baseball in Mars! Technicalities will be discussed in the future, if I stay here, of course. That I will, most probably. So see you next time!

Advertisement

HOWTO: fix your wordpress install after a system update – main page shows only php code

Background: we had a very big disconnection and the local WP installation didn’t come back after all the other systems came back. I have access to the website (so the apache2 service is running) but the main site as well as the admin site show only php text code. I tried rebooting the computer (a virtual machine) without luck. A very simple solution this one has. As usual, the solution is in StackOverflow.

sudo apt install php7.0 libapache2-mod-php7.0 
php7.0-mysql php7.0-curl php7.0-json

I restart then my apache2 and my website comes back. Fiu! Have a nice weeked, or see you tomorrow for the Mars discussion post…

HOWTO: add Java and CSS to your python dash application

This is a pretty sad first post for February. A lot of things have been going on, so many that I’ve not been able to approach to a computer in a relaxed way. Anyway, here’s my tip of the day. To apply CSS styles and use java on your dash applications, place the files in a specific folder called assets. They will be found and used. Hopefully!

---app.py
---assets/style.css
---assets/picture.gif
---data/data.csv

For Flask you have a link here. That’s all for the moment.

Hitchhiking – Sundays from the past (II)

I come from a relatively poor background, meaning I never had the chance to buy a car when I had the age for it. Besides, I was unemployed, but that’s the subject of another post maybe. So to go from A to B when I was a teenager sometimes I was hitchhiking, carpooling or riding a train.

One of those summers I was going down a hill. I wanted to reach certain valley in the middle of the Big Mountains where my friends were already camping and I was coming late, due to an University exam. The bus from the Big Town delivered me to the closest village, still like 25 Km away from the destination. When I arrived to the last village was getting dark but I decided to walk to the target with my backpack, with the hope of being picked up before the end. My mood was high, and the blooming night was fresh and beautiful. I looked at the starts, considering simply giving up and opening my sleeping bag just there after the last turn. Then I saw a van, and I signed it. “Here” I shouted. To my surprise, the vehicle accelerated instead of breaking, and passed by my side in a breath. That somehow discouraged me to continue walking. Was I looking dangerous? Not at all, I was still looking like a city boy with camping gear. I looked around, considering temporary sheltering places. The moon looked at me. I was wondering how far was the camping. I had a name and a description of the road. Is that over there the entry to the rural path on my map? Unfortunately not. While I was consulting my indications under the scarce light, another car in my back slowed down and stopped. The driver spoke to me “Hop in!” he said. I quickly did and thanked him. The man was a typical local hunter, hut included. I asked about the camping place. He knows it, and it’s on his way. Well I’ve been lucky at the end. “Did you see a van passing buy before me?” inquires the driver. I nod. He says. “A white van, model XXX, right?” I say I’m not sure of the model but definitely white. I tell him I saw it like 15 minutes ago. “Great! Then the bastard is not far away! Can you please please open my cubby-hole? It’s right in front of you.” I open the glove compartment and to my surprise, what is inside falls over my lap. A gun, probably a Magnum by the size of it. I decide to act as if nothing happened. “Nice, ain’t it? Careful, it’s loaded.” And we are on a road filled with curves. I grab it the best way I can, since I don’t have military training. “I need to kill that bastard. I will be great if you could help me… anyway now you have your fingerprints all over it.” I keep cool and do not shiver, probably because I’m paralysed. I deny his offer with the excuse that my friends are waiting me. He insist, but despite of the craziness of the situation, he seems like a reasonable person. “Well, here we are.” My road. “Your road. Leave my toy over the sit, where I can quickly pick it up if I need it.” I slowly do as he says, and thank him for the lift. “My pleasure. Have a nice time!”

The next day, and the day after I check every local newspaper, looking for news about a gun fight. I find nothing, and slowly I stop checking, but I will never forget that 20 Km ride.

EDIT: backposted, since I didn’t publish it in his day (Sunday). Reason is I’m not sure I wrote about this already…didn’t I? Maybe I thought about it.

The minimal crew – The MARS discussions (II)

Have you ever meet an astronaut? One needs to check the requirements to become one to find out what kind of person an astronaut is. For starters, at least for ESA, it is required to speak 3 languages from the member nations. This is not so complicated to fulfil, since here in Europe we don’t speak English, but to be clear, it is already a red light about the communication issues you may face while working. For our discussion let’s dump this requirement and assume everybody will simply speak in English. An astronaut -so far- is some kind of Swiss knife and it’s supposed to be able to perform a lot of different tasks. With that picture in mind, what would be need to include in the first Mars crew? Let me remind you that SpaceX Starship has cargo space for 100 people. Since I’m assuming the first trip will also bring extra equip, like rovers, I will reduce the population to 50. Let’s start counting, and see where we get.

From the top, I would divide the 50 into 5 teams of 10 people. Maybe each group of 10 should be called with a colour, or a letter. I would go for colours, since on Earth we don’t even have the same alphabets. I will choose them already: yellow, green, brown, blue, and white. I’ve avoided red – the colour linked with Mars – and black – the colour of mourning – on purpose. Each colour should have one leader, and common actions would be decided by them. The leader should have of course a secondary ability beyond leadership, so we still have 10 people per colour. Let’s start covering functions. One person needs to be the medical doctor in each team, maybe each one an expert in a different field, respiratory issues, traumatology, digestive system, psychology, general, for example. Then we need a geologist. At the beginning it will be very important to know where you step, and what you can use and what not to build the necessary infrastructure. The geologist can maybe double as ecosystem officer and take care of the ecological budget, how much is consumed, how much is wasted. Speaking of which, we will need someone to take care of the plants, since I have no doubt we’ll plant at least potatoes on Mars. The five teams will account for 5 martian farmers, that is not a bad number, if you ask me. Another very important person is the mechanical engineer. Maybe we could use two per team. They will work together with the system engineer, that will be in charge of the connectivity, and with the software official – I’m not sure we need one per team, but I’m sure we will need a software expert.

I have issues filling up the three remaining positions. A cook per team? It’s important to prepare good meals with scarce components, but I don’t think it’s vital. Also, one cook per team is definitely too much, specially if you need to eat together. Let’s say it’s an option. So I’m going to fill the 15 empty sits in another way. We can have 5 tourists – they will need to fully pay their trips -, three cooks, three media experts, and three biologists. Which means we fill it up all the 50 – except one. That one is, and must be, the Captain.

It all ended up pretty much Star Trek lookalike, right? Now remember that a lot of items we now use, like the tablets, first appeared on that show. Please leave your comments below 🙂

A jupyter notebook in a docker: Jupyter Docker Stacks

Again I’m with python. I want to run as package independent as possible, so I want to run the external python apps in a docker. If we have a jupyter notebook, we can easily run it this way if we have it in a “test” folder. Note that the “test” folde needs to be readable for everyone (777) or you’ll get this error :

tornado.web.HTTPError: HTTP 403: Forbidden

Anyway, this is what I get when I run my docker mapping the test folder:

# > docker run -p 8888:8888 -v "${PWD}"/test:/home/jovyan/work 
jupyter/scipy-notebook
Entered start.sh with args: jupyter lab
Executing the command: jupyter lab
[I DATE ServerApp] jupyter_server_terminals
| extension was successfully linked.
[I DATE ServerApp] jupyterlab
| extension was successfully linked.
[W DATE NotebookApp] 'ip' has moved from NotebookApp
to ServerApp. This config will be passed to ServerApp.
Be sure to update your config before our next release.
[W DATE NotebookApp] 'ip' has moved from NotebookApp
to ServerApp. This config will be passed to ServerApp.
Be sure to update your config before our next release.
[I DATE ServerApp] nbclassic
| extension was successfully linked.
[I DATe ServerApp] Writing Jupyter server cookie secret
to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I DATE ServerApp] notebook_shim
| extension was successfully linked.
[I DATE ServerApp] notebook_shim
| extension was successfully loaded.
[I DATE ServerApp] jupyter_server_terminals
| extension was successfully loaded.
[I DATE LabApp] JupyterLab extension loaded from
/opt/conda/lib/python3.10/site-packages/jupyterlab
[I DATE LabApp] JupyterLab application directory
is /opt/conda/share/jupyter/lab
[I DATE ServerApp] jupyterlab
| extension was successfully loaded.
[I DATE ServerApp] nbclassic
| extension was successfully loaded.
[I DATE ServerApp] Serving notebooks
from local directory: /home/jovyan
[I DATE ServerApp] Jupyter Server 2.1.0 is running at:
[I DATE ServerApp] http://XXX:8888/lab?token=XXX
[I DATE ServerApp] or http://127.0.0.1:8888/lab?token=XXX
[I DATE ServerApp] Use Control-C to stop this server
and shut down all kernels (twice to skip confirmation).
[C DATE ServerApp]

To access the server, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/jpserver-7-open.html
Or copy and paste one of these URLs:
http://XXX:8888/lab?token=XXX
or http://127.0.0.1:8888/lab?token=XXX

The Jupyter Docker stack documentation is available here. Happy docking!

Doomscrolling

I’m a big mobile phone user (aren’t you also?) and as such I’m addicted to doomscrolling. In fact, I feel like I’m contributing to it right now by writing this post, instead of something useful for me and for some of my readers. Truth is, the device is in my pocket, and the book or ebook in my backpack, so I tend to go for the easiest solution if I want to waste some idle time. To scroll down my newsfeed was giving me a weird pleasure before, I wanted to reach the bottom of the screen, where the news that I’ve been looking for were hidden because I didn’t read them in time. But the price was never there. There are no big news missing. There’s no end to it, just a constant flow of monsters, like pictured above. In addition, they all look similar. I’ve read the same from different sources and I have the impression I’m being served by the middleman. That is, my stuff is not pure, it comes to me filtered by the different media and by my choices. Sometimes, it’s the same s*it in a different language, or with a different header. So I’m going to try to opt out. I don’t know how to do that, but if I find a solution, I will let you know. Because additions are a problem. All of them, even the harmless ones, like this one, or the bad habit to read your spam before deleting it. I’ve wasted so much time already that I don’t want to think about it. Stay healthy!

perl: warning: Setting locale failed on Debian GNU/Linux 11 (bullseye)

I love these titles. They look like coming from a disaster movie or something. I’ve encountered this one while trying some of our software on a Debian 11 docker. The full error looks like this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

The solution is pretty easy. It’s described in this post. I choose apt-get install iperf. I log out and log in again and the error is gone. Yeah, this was more like the tip of the day, but …let’s go!

A python dash web multiplot example reading CSV data

I previously used plotty to get a python plot on a website. It’s time to elaborate. Now we want to have two plots with data from a CSV file. It’s not as complicated as it sounds. Allow me to show and explain.

import dash
from dash import dcc, html
from dash.dependencies import Input, Output
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import pandas as pd

app = dash.Dash(__name__)

df = pd.read_csv('data3colums.csv')
##columns are named here and you need to use these names
df.columns=['Time','data','Size(T)']
fig = px.line(df, x="Time",y="data",markers=True)
fig2 = px.line(df, x="Time",y="Size(T)",markers=True)
app.layout = html.Div(children=[
# All elements from the top of the page
html.Div([
html.H1(children='Time series one'),
html.Div(children='''Title one'''),
dcc.Graph(id='graph1',figure=fig),
]),
# New Div for the new 'row' of the page
html.Div([
html.H1(children='Time Series two'),
html.Div(children='''Title two'''),
dcc.Graph(id='graph2',figure=fig2),
]),
])
if __name__ == '__main__':
app.run_server(debug=True,host='IP-OF-MY-MACHINE')

If you want to know more about how to plot data from CSV here you have the plotly documetation. It can be useful also to know about plotting time series, since at least in my CSV I have time tags. And here you have the stackoverflow post about this topic. Because we can’t forget about stackoverflow.

EDIT: this post has been backdated to “yesterday” because I forgot to publish it, so another post may come later. Hopefully…this will mean I had time for my things 😉

The kiss in the church – Sundays from the past (I)

If there is a place less appropriated to start a relationship than a church, I don’t know it. Maybe a subway, but in my childhood playground we didn’t have of those. I want to try to evoke the atmosphere to explain the situation a little. We were young, barely teenagers. My friend was an altar boy, and that Sunday evening, he was given the keys to all. His orders were to clean the Clock Tower, and he was allowed by the priest to bring help. What better help than his best friend – that will be me – and two girls that he was fancy about? What could happen in a church, after all?

We collected the girls at the back door of the sacristy. The portal was right after the main body of the church, a solid white building with a straight floor plan with space for around two hundred villagers. The lights were electrical, and of course, there were candles. We entered the main building from behind the altar, the way the priest uses. I still remember the view. The altar is a little elevated, so when I was standing there I was able to imagine the face of every other believer sitting in front of me. My aunt in the second row, the butcher in the middle, the three sisters in the back. No, even there I didn’t consider for me a religious path, if you ask me. My friend the altar boy pushed us down then. “Let’s go” he said “first we need to look at the clock tower, then we can check if there’s some wine left! ” I knew about the wine, and, like the girls, I think we were very curious about that also. The clock tower was in an annex to the main floor, and it was possible to ring the bell from below, close to the main entrance, where two small rooms were attached to the main, heavy, wooden door leaves leading to the village square. The small room to the right was conducting to the tower, the one to the left, to the church offices and the house of the priest.

When the girls saw the upward spiral staircase, they decided to stay at the bottom.”I need to do this” my friend said “but you can wait here. Please don’t move anything, I don’t want to be blamed of messing up with the liturgy.” Suddenly I was alone with two girls, and they were discussing about whom to choose. Me or the altar boy? Or to be more precise, who was choosing the altar boy? Then he returned and it was time to act. “Let’s play now a game,” my friend said “let’s get by couples in the confessional and see what we feel.” The girls, hesitant, didn’t agree. “OK I have a better place. Have you seen where the priest stores the tunics? It’s a gorgeous closet where we can all stand inside!” They did agree to go there. We quickly headed to the furniture – it was in the sacristy, so somehow on the way out – and I entered first, followed by one of the girls. Indeed the wooden item was enormous inside. Then my friend made his move and closed the door of the closet, leaving us both in, in the twilight. She quickly grabbed me by the waist. My heart jumped. “I will let you leave… only if you kiss her on the lips!” And I kissed her.