Prime numbers are scary

Cyrus started filling up his backpack. Toothbrush, check. Dinosaur pyjama, his favourite, check. A winter trouser, the Moon ca be a cold place. Also the sweatshirt with the S of Superman. The portable generator, they don’t know how long until we have solar panels. Multitool, check. Paper. A pencil. Just in case everything else fails, he remembered something about that happening on the Apollo program. What was that? Something about a million dollar pen. Mark is a dreamer but he’s right, if we don’t do something about the current situation no one will. The politicians always want more money today, not tomorrow, the NASA, ESA, JAXA and ISA, they just want to publish papers, or to make documentaries, or get lovers. Whatever. Fortunately for him and Mark he knows how to escape from Earth, and they will easily cook a preliminary lineup, who’s the captain of the project and who’s coming.

Going downstairs, he jumped two steps at a time and landed almost slipping on his entrance hall. To the left, the kitchen was as messy as usual. No one was cleaning and his father systematically neglecting to charge the home assistant, that was laying close to the doorframe like a broken toy. He decided to delay his exit a little to gently place the robot over the charging platform, then look to his right. Through the door of the living room, the back of his sofa and the hanging feet of his father were visible. Hesitantly, he murmured a farewell. His father, a very successful software architect was not precisely a model for him, but Cyrus loved him, specially because of his parenting approach about technology and science in general. Instead of fairy tales at night he had differential calculus and quantum mechanics. One of his first monsters ended up being, in fact, the Prime Number Theorem. All those integers, unexplained, distributed over the natural space. Scary as hell.

His father moved.

“Cyrus? Are you going to school?”

“No dad. Today’s Saturday, no school. I’m going to Mark’s.”

“Good. I like Mark. He’s not very bright boy, but what he doesn’t have on IQ he has on creativity. OK, you may go.” Cyrus didn’t usually ask his father for an approval for his trips but he was happy to get it this time. “I know it’s just across the street, but don’t come back home after dark! And say hello to Mark’s mother from my side…” He didn’t wait to his father to leave the sofa so he shouted OK. Then, he headed to the door. “I’m going to Mark’s” he mumbled to the doorknob. The door, after recording the customary information, opened with a smooth sound. Outside, the sun was still shinning. He adjusted the straps of his backpack and left his home for good.

Note : Remember that the story starts here.

Bash : an awk crashcourse

I want to process the data from a CSV file with awk. Yes I know, python and so on, but for a man with a hammer, every problem looks like a nail. So let’s post the links and what we can do with them. We may want to print the value only if it’s not empty. Like this.

awk '{if ($4) print $0;}' < STUDENTS.csv

We may want more than one conditional if. There’s a thread about it here. From it, I will extract this.

$ awk 'BEGIN{if(val==""){print "null or empty"}}'

You get the idea. The final code snipped, including reading from a file, ends up like this:

while read y
do
#echo "Line contents are : $y "
echo $y | awk -F "," '{
if ( $9 =="" || $10 == "" || $13 == "" )
print "Some score for the student ",$2,
"is missing " $9" "$10" "$13;
else
print " \{ x:" $9 ", y:" $10 ",
z:" $13 ", name: \"" $2"\"\}," }'
done < STUDENTS.csv > COMPLETED.csv

We are reading STUDENTS.csv and storing only the names of the students who passed the subjects 9, 10, and 13 of the course. Bonus: you may want to delete some students from the file: you can do it with sed.

apache php 8.0 not showing phpinfo on Big Sur 11.2.2

Opps, I did it again! Updating my OS screwed up my phpMyAdmin server. But it’s the price I need to pay to stay up-to-date, I guess. My apache server was no more showing me the info.php page. Yes, that one that you get when you create a file with

<?php phpinfo(); ?>

Instead, either I see just the text above (on Chrome) or nothing at all (on Firefox). And it was working fine before (Big Sur 11.1)! I decided to look ahead instead of to the past and install everything from scratch, using brew. You will find a grav guide about how to install apache with php here, with the plus that it shows you how to quickly change the php version in case that happens to be the problem. I’m not going to repeat the steps on the guide, just I want to mention the user experience.

Installing multiple php versions is taking quite some time, but brewing 8.0 took not so long in comparison with 5.6. For me compilation time is an indication of good code, so that was the one I kept at the end. And this is how it looks like:

 brew unlink php && brew link --overwrite --force php@8.0
 Unlinking /usr/local/Cellar/php/8.0.2… 24 symlinks removed
 Linking /usr/local/Cellar/php/8.0.2… 24 symlinks created
 user@bigsur  ~/Downloads $ > php -v
 PHP 8.0.2 (cli) (built: Mar  2 2021 15:56:26) ( NTS )
 Copyright (c) The PHP Group
 Zend Engine v4.0.2, Copyright (c) Zend Technologies
     with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies

Unfortunately this is not enough to fix php in my case. I mean of course even after following the already mentioned grav guide. The fix I found, after a few hours of experiments, on StackOverflow. As usual. Here you have it. And here I copy it:

  1. Change Listen 80 to Listen 127.0.0.1:80 in /usr/local/etc/httpd/httpd.conf
  2. use sudo /usr/local/bin/httpd -k start to start your httpd

After the restart, I have my php back. Hope this helps. Long live php 🙂 🙂

Howto : run a launch.jnlp on Big Sur

The login page. Credit image taken from here.

The ILO (Integrated Lights Out) management system, also known as IMPI, of a server is a must depending on how you work. It allows you not only to check the hardware status, but to virtually mount your ISO to reinstall the system, or to monitor a PXE boot. I don’t want to speak about it, but about the problem of getting the java remote console to work, specially if your server is not very modern, since the new IMPIs come with an HTLM5 console option. Let’s say you log in on a page like the one above, go to Remote Control -> Console Redirection and click on Launch Console. In my mac, when I do this from Chrome, a file launch.jnlp is downloaded. What do I do with that?

Step one: install Java. I followed this guide. In brief, get the OpenJDK pkg, and install it. I had no issues, and at the end I get this on my console:

java --version
 openjdk 11.0.10 2021-01-19
 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
 OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)

Now what? I go to the Downloads folder and I do right click, double click, etc, without any success. Maybe we need something else?

Step two: install JRE (the java runtime environment). You can download it from here. Once installed, we should be able to run the launch.jnlp from the command line. Like this:

javaws launch.jnlp 

Are we done? Unfortunately, not. Probably if we do this for the first time, we will get an Application block by security error. Which leads us to the third and last step.

Step three: add the application URL to the Java exception list. Like this.

  1. Go to System Preferences and click Java. The Java Control Panel opens in a separated window.
  2. Navigate to the Security Tab.
  3. Click the ‘Edit Site List‘ button (bottom right).
  4. Click the Add button in the Exception Site List window.
  5. Click in the empty field under Location field to enter the URL (http://my-ilo.com). You may get a Security Warning. In principle, it’s OK, so click on Continue.
  6. Check that the URL is now on the list, close the Panel, and run the command line again.

I hope this helps. I’m so happy Java is fading away, as an user, I’m always fighting to find the right configuration of JDK + JRE + hardware…

Mars again (2021)

Official Mars picture (taken from NASA site)

The Red Planet is an hostile place, but no more than other extreme places on Earth we have found life, like around hydrothermal vents or under a real thick ice cap in Antartica. I don’t need to tell you that on the above picture we have the NASA view of it. I chose it to express my regards to the technicians and scientist that achieved such an impressive result. In addition this year we can call ourselves specially lucky, since we can add to the info coming from Perseverance the one from two non-aligned missions, the HOPE probe from the Arabian Emirates and the Chinese Tianwen1. The allies (NASA + ESA + friends) and the above mentioned independent missions are trying to answer in a way or another the same question, that unfortunately is not anymore, or not only, if there is life on Mars, but how we will live over it. You can argue that NASA is not researching on that. And you are correct, but I say that knowing if there are microbes or similar will avoid scenarios like the one depicted on the amusing National Geographic TV Serie Mars S2, where the first settlement on the Red Planet suffers from a martian-native virus. It will be great if they find life, but it will not stop the colonisation wave. We will go, or they will go, the problem is how. And probably the security for the astronauts will be the same independently of the output of these three missions, since it will be based, as usual, on the budget. Let’s hope we have enough money for security by the time the first house is printed on Mars. I look forward for that.

A flexnet server on a Debian 10 VM

We are trying to configure a flexnet license server for Amira/Avizo on a linux virtual machine (VM) that we call lic for simplicity. We could use a real machine, but the virtual machine solution seems like more professional. Once the VM is up and running, I get the package from the website and I follow the instructions. This is my output.

root@lic:~/FlexNetLicenseServerTools# chmod 777 install_fnp.sh
root@lic:~/FlexNetLicenseServerTools# ./install_fnp.sh
Installing licensing service from
./FNPLicensingService/FNPLicensingService to
/usr/local/share/FNP/service64/11.14.0

Checking LSB compatibility...
*** WARNING: 32-bit LSB packages not installed
*** WARNING: 64-bit LSB packages not installed
LSB compatibility checks complete

Checking system for trusted storage area...
Configuring for Linux, Trusted Storage path
/usr/local/share/macrovision/storage...
Creating /usr/local/share/macrovision/storage...
Setting permissions on
/usr/local/share/macrovision/storage...
Permissions set...


Checking system for Replicated Anchor area...
Configuring Replicated Anchor area...
Creating Replicated Anchor area...
Setting permissions on Replicated Anchor area...
Replicated Anchor area permissions set...
Configuring Temporary area...
Creating Temporary area...
Setting permissions on Temporary area...
Temporary area permissions set...
Configuration completed successfully.

root@lic:~/FlexNetLicenseServerTools#

Looks like everything was fine. Next step is to adjust the library paths. I save it on my .bashrc, since this VM is going to be used only for this purpose.

export LD_LIBRARY_PATH=FlexNetLicenseServerTools/$LD_LIBRARY_PATH

Now I run the command to activate the license. The next line is taken from the tutorial. The output is mine.

./ServerFNOODActivation -a A1A2-B2D6-0CD4-044B Avizo_2019.1 5
Status: 4, Creating request
Status: 5, Request created
Status: 6, Context created
Status: 7, Connected to remote server
Status: 8, Request Sent
Status: 9, Polling for response
Status: 10, Waiting for response
Status: 9, Polling for response
Status: 11, Done
Response processed successfully. Actions were:
    Configuration  TrustedId "1"
FNOOD SUCCESS CODE: 600
    Create         fulfillment "181904727"
FNOOD fulfillment: 181904727
FNOOD SUCCESS CODE: 600

Time to try to connect an installed instance to this. Maybe on the next post 🙂

NaNo not, micro (III)

In the sunset, the snowflakes started to grow while looking at the sky. They became electric blue sharp ninja stars first, then Christmas cartoons, falling all over our shrinking word, shattering with the noise of broken glass after the fall. I turned my head to look at my friend, sitting close to me, sipping his hot cocoa, staring through the window as if this was happening to him every other winter. “That’s a heavy snow” he said. “Indeed” I commented “but maybe easier to clean afterwards. If only we knew about it in advance…”

How to create a SSL certificate for HTTPS on CentOS 7.X (and errors)

Image of the “not secure” message taken from this site

One of the annoyances you may find as a web developer is the handling of certificates. I did develop a few sites for my intranet (like a wiki, a munin monitoring service, etc) and up to now no one complained, but we should do the things right, and according to the enterprise. Just in case, so to say. So how do I move all my web develop from http to https? I will follow a variation of this tutorial from digitalocean.

yum install mod_ssl
mkdir
/etc/ssl/private

chmod 700 /etc/ssl/private
openssl req -x509 -nodes -days 365 -newkey
rsa:2048 -keyout
/etc/ssl/private/apache-selfsigned.key
-out /etc/ssl/certs/apache-selfsigned.crt

The output of the last command looks like this for me:

Generating a 2048 bit RSA private key
..........................+++
........................+++
writing new private key to
'/etc/ssl/private/apache-selfsigned.key'
-----
You are about to be asked to enter information
that will be incorporated
into your certificate request.
What you are about to enter is what is called a
Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:XX
State or Province Name (full name) []:Wonderland
Locality Name (eg, city) [Default City]:Alice
Organization Name (eg, company)
[Default Company Ltd]:
Mad Hatter Inc.
Organizational Unit Name (eg, section) []:
Dept. of Looking Good When Drinking Tea
Common Name (eg, your name or your server's hostname) []:
server.secure.org
Email Address []:Lewis.Caroll@domain.gov

Now we do the Perfect Forward Secrecy thing. A pretentious name, I believe. I’ve included the relevant output, of course edited.

openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
Generating DH parameters, 2048 bit long safe prime,
generator 2
This is going to take a long time
.....+.......................................
..............................+..............
.................................+...........
.............................................
.................
++*++*
cat /etc/ssl/certs/dhparam.pem |
sudo tee -a /etc/ssl/certs/apache-selfsigned.crt

We have also manually appended the generated file to the end of our self-signed certificate. Let’s set it up. We open the configuration file /etc/httpd/conf.d/ssl.conf and change the DocumentRoot to our test folder (we don’t want the security to screw up all the server). The rest I do as suggested. Add the SSL paths, paste the block after the VirtualHost block. Go to the reference if you need to do the same. We want our server to provide both unencrypted HTTP and encrypted HTTPS traffic, so I don’t do the “optional” step. Let’s check the configuration:

apachectl configtest
Syntax OK
systemctl restart httpd.service

Now we check the address… and… it’s somehow working on firefox but not on chrome. On chrome I get the NET::ERR_CERT_INVALID error. That we can fix, somehow, by generating a new certification in another way. As usual, StackOverflow saved the day.

Sorry for the post if you know all of this already. Sometimes I think I live in a fantasy land. Wonderland, to be more precise 😀

The center of the island of stability is not at element 114 (Flerovium)

A silicon detector system inside a vacuum chamber, surrounded by new germanium detectors

It’s been a while since I post some real science news. This is not because there are no news, it’s maybe because I’m not called to comment on them. Does the island of stability deserve my attention? It does as a Physicist and as an Experimentalist, speacially if the article that I comment (here the original source) claims the theory differs from the experimental results. I will try to digest a little the original article in the next lines.

Under the leadership of Lund University in Sweden and with the participation of other partners, Flerovium 114 was produced and then examined whether it has a closed proton shell. You may want to know what is a closed shell. Allow me to explain. Noble gases, like xenon and argon, are inert, meaning the don’t react with other elements, because their electrons form a closed shell, not letting any other element attach to them by sharing an electron. For the nucleus, closed shells of proton and neutrons produce an stability. The closed shells are corresponding to certain numbers, 2, 8, 20, 28, 50, 82, 126, called magic numbers since they have an explanation, but a very complicated one, based on a lot of quantum calculations and approximations. Facts with a complex explanation are traditionally called of magic origin 🙂

The Lund results suggest that, contrary to calculations, Flerovium is not a magic core. So is it the a magic core conected with the magic numbers? Definitely. In the late 1960s, Sven-Gösta Nilsson from Lund University, among others, formulated a theory about the existence of super-heavy elements beyond the ones naturally ocurring, like Uranium (92). Since the 60s, super-heavy elements, like Bohrium (107), Hassium (108) or Meitnerium (109) have been created on accelerators and many predictions have been confirmed. It was also predicted that a magical combination of protons and neutrons would lead to sharply increasing half-lives in the superheavys. Now what the hell is this half-life? It is a measure of how long until such a super-heavy element decay into lighter elements. Take the above mentioned Bohrium, for example, with a half-life of around 61 seconds. If you have, let’s say, 10 atoms, after that time, half of the atoms should “transform” onto something else, and you will end up only with 5 Bohrium atoms.

So when do we have magic numbers? This occurs when the shells in the atomic nucleus, which each hold a certain number of protons and neutrons, are completely filled. “Such a closed, magical proton shell structure was also predicted for Flerovium, element 114,” explains Dirk Rudolph from Lund University, spokesman for the international experiment. “If this was correct, Flerovium would be in the center of the island of stability, an area of ​​the nuclide map in which the super-heavy elements would have to have particularly long lifetimes due to the shell closures.”

An international collaboration conducted experiments to determine whether Flerovium cores show magical properties. On FAIR phase 0 experiment program, 4 trillion Calcium48 nuclei were accelerated every second with twenty protons by the GSI linear accelerator UNILAC to ten percent of the speed of light for 18 days. They were shot onto a thin sheet of Plutonium-244 with 94 protons in order to generate Flerovium by nuclear fusion. Strong magnets of the GSI recoil separator TASCA separated the Flerovium nuclei from the intense Calcium ion beam, after which they were registered in a detection apparatus. The detector measured the radioactive decay of thirty Flerovium cores with high efficiency and accuracy. 

“Our study shows that Element 114 is no more stable than others in its vicinity. This is a very important piece of the puzzle in the further search for the center of the coveted island of stability, ”says Christoph Düllmann from the University of Mainz. The new results are interpreted, in the article, as a a greelight to move the focus from search for the center of the island of stability in the area of ​​element 114 to the study of even heavier elements, as the yet undiscovered element 120.

Who’s the captain of the project? And who’s coming?

“Very good, I see you have a mind as clear as usual.” Cyrus smiled and adjusted his glasses over the small nose once more.”Just let me remind you that this time this is not a game.” Immediately after the phrase his friend’s face became haunted. To cheer him up, Mark added.”Of course we’re going to have fun with this! And don’t forget my mother is going to prepare us the lunch box!”

“Right.” The hologram of his interlocutor flickered. The coming storm decided to announce its presence by a rumbling thunder. Both kids shivered.”OK then let me gather my things and I’ll come over in about… 15 standard minutes. Will that be alright for you?”

“Yes of course, I need time to prepare the … building site. Can you bring over your bugget and your… blueskirt already? Or do we need to ask permissions for that?” The guy with the round glasses nodded and smiled. His face became apparently bigger as he approached to the comm, ready to switch if off. Then he changed his mind and moved back so that his full body was again in focus, floating over the comm.

“I guess I can. Although I still have a few questions before we start building, or drawing. Or planning our expenses.” He took off his glasses to methodically clean them. Mark didn’t move a muscle. He knew his friend was doing that when evaluating a problem. When Cyrus placed his glasses back over his nose, he waited for the questions to raise. “First one is, who’s the captain of the ship? I trust you Mark, but I don’t know if I can let the command of our survival plan on someone’s else, like this bully, Raoul. So who else is coming?”

“I’m the captain. It’s my idea, and I have the building site. My backyard is bigger than yours and our house is closer to the school. And the shopping mall. And the hardware store. And don’t forget my mama is preparing us the food!” He paused. His friend approved his statements with a nod. “About who’s coming, I’m open to suggestions. I understand we need to build a crew, like in the sci-fi shows. You will be of course Engineering, or Science, or something like that. But the other positions I didn’t decide yet. Can you also think about a bagette for that?”

Read the previous parts of this project if you like here: how to escape from Earth first, then it’s not easy at all to build a rocket. And of course comments are welcomed 🙂