Category: Non classé

Ruby on MacBook M1 : Not updating version

In some cases, it seems that your ruby version can still on 2.6 (which is old, latest is 3.2.2 right now) even if you installed the lasted version with brew or rbenv. You can see also that you have rights problems and need sudo rights to install some gems.

# ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]
# rbenv install 3.2.2
# rbenv global 3.2.2
# ruby -v # WE CAN SEE THAT WE STILL HAVE OLD VERSION
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]

This is because MacOS comes with a “system Ruby” pre-installed. If we remove all we can see the pre-installed version is located in this folder:

$ which ruby
/usr/bin/ruby

What should we do to not use system Ruby

There are two methods that I recommend, the method using brew or the method using rbenv which both allows you to manage Ruby version.

Method 1 : Updating Ruby version with Brew

First you need to install the Ruby version with brew:

brew install ruby ruby-build

Then open a terminal and go on your personal folder (/Users/YOUR_USERNAME) and use the following command to switch from the Ruby system version to the brew version with the .zshrc file in your user folder:

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc

Method 2 : Updating Ruby version with RBEnv

If you still see the old version by checking the version doing ruby -v
First you need to install rbenv, which is a ruby version manager, we can install it with brew.

brew install rbenv ruby-build

Then open a terminal and go on your personal folder (/Users/YOUR_USERNAME) and use the following command to switch from the Ruby system version to the rbenv version with the .zshrc file in your user folder:

echo 'eval "$(rbenv init -)"' >> ~/.zshrc

Check the result

Then, open a new terminal (close the old one), if you updated correctly the zshrc file and have installed the correct ruby version, you should be able to see the good version:

% ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

Hope it will work for you. Do not hesitate if any question.

Comparison of price of Big King XXL (Burger King) in the world in EURO

I made this article in a purpose to know the cost of living across the world, this has not been made for commercial purpose and has been made for real analytic results on the cost of living.

FRANCE

Menus - Photo de Burger King, Villars - Tripadvisor

MENU BIG KING XXL : 8.80 EUR

GERMANY

Burger King Germany Price list / Menu - Joy Della Vita

MENU BIG KING XXL : 8.49 EUR (-0.31 EUR, -3.5%)

RUSSIA

MENU BIG KING XXL : 469.99 RUB = 5.63 EUR (-3.17 EUR, -36%)

MOROCCO

Burger King Tanger MENU 2021 | Livraison à Domicile | Les meilleurs  Restaurants à Tanger- EAT.MA

MENU BIG KING XXL : 65 DHS = 6.23 EUR (-2.57 EUR, -29.2%)

TURKEY

İstanbul Havalimanı'nda Burger King | Gökyüzü Haberci

MENU BIG KING XXL : 67 TL = 5.84 EUR (-2.96 EUR, -33.6%)

ITALY

Burger King Menu, Menu for Burger King, Eur, Roma

MENU BIG KING XXL : 7.40 EUR (-1.4EUR, -15.9%)

CZECH REPUBLIC

MENU BURGER KING XXL : 199 CZK = 7.89 EUR (-0.91 EUR, -10.3%)

Créer une Cloud Function sur Google Cloud

Bonjour,


Si vous avez réalisé une application minimaliste, il se peut que vous n’ayez pas forcément besoin d’une machine pour faire tourner votre API. Dans ce cas, si vous avez besoin d’une route sans avoir à gérer l’identification par exemple, les Cloud Functions peuvent suffire. Ils se trouvent dans la section Calcul:

Créez votre fonction:

Nommez votre fonction, puisque c’est un GET depuis votre appli, je vous conseille de commence par l’appeler get, par exemple si on retourne la liste des voitures, ce sera “getVoiture”. Ce sera un déclencheur HTTP :

Je conseille d’exiger le protocole HTTPS pour des raisons évidentes de sécurité. Vous pouvez commenter la première ligne. Vous pouvez ensuite faire votre liste de voitures au format JSON.

Vous pouvez ensuite tester la fonction depuis l’onglet TEST ou alors en allant directement dans l’URL du déclencheur dans l’onglet DECLENCHEUR :

Vérifier l’authenticité d’un diplôme d’un candidat

Bonjour à tous,

Etant donné que nous sommes en “Vive la France, Vive la République” le pays de Molière et de Baudelaire, l’état nous a mis à disposition une magnifique plateforme de vérification des diplômes accessible depuis https://diplome.gouv.fr/ si vous voulez vérifier les premiers diplômes d’un candidat à savoir son baccalauréat ou quelques diplômes comme le BTS, vu que j’ai fait un BTS avant de me diriger vers une license puis un Master:

Ainsi, pas de doutes, Jean Michel est bien diplômé. Attention cependant à bien vérifier l’académie et l’année pour trouver vos diplômes, car si vous avez été dans plusieurs départements, ce ne sera sans doute pas la même académie. Par exemple, en région Ile-de-France, vous avez 3 académies: Créteil, Paris, Versailles. Me concernant j’ai dû aller chercher dans celles de Créteil puis celle de Paris.

Host multiple frontend React/Angular app on one NGINX server

Is it possible that you have multiple web applications React.JS or Angular and you want it to be on one unique machine

You will have to check your NGINX configuration file /etc/nginx/nginx.conf or /etc/nginx/conf.d/ssl.conf – on CentOS/Fedora/RedHat.

ON THE SAME DOMAIN

One app will run on domain.com and the other app will run on domain.com/app2 :

server {
    listen 443 http2 ssl;
    listen [::]:443 http2 ssl;

    server_name DOMAIN.COM;
    #ssl_certificate /etc/letsencrypt/live/DOMAIN.COM/fullchain.pem; # managed by Certbot
    #ssl_certificate_key /etc/letsencrypt/live/DOMAIN.COM/privkey.pem; # managed by Certbot
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    
    # FIRST WEB APP - runs on https://DOMAIN.COM
    root /usr/share/nginx/firstapp/build;
    index index.html index.htm;
    try_files $uri $uri/ /index.html;

    # SECOND WEB APP - runs on https://DOMAIN.COM/app2
    location /app2 {
      autoindex on;
      index index.html;

      alias /usr/share/nginx/app2/build/;

      try_files $uri $uri/ /index.html;
    }
}

ON DIFFENTS DOMAINS

One app will run on app1.domain.com and the other app will run on app2.domain.com :

server {
    listen 443 http2 ssl;
    listen [::]:443 http2 ssl;

    server_name app1.domain.com;
    #ssl_certificate /etc/letsencrypt/live/app1.domain.com/fullchain.pem; # managed by Certbot
    #ssl_certificate_key /etc/letsencrypt/live/app1.domain.com/privkey.pem; # managed by Certbot
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    root /usr/share/nginx/app1/build;
    index index.html index.htm;
    try_files $uri $uri/ /index.html;
}
server {
    listen 443 http2 ssl;
    listen [::]:443 http2 ssl;

    server_name app2.domain.com;
    ssl_certificate /etc/letsencrypt/live/app2.domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/app2.domain.com/privkey.pem; # managed by Certbot
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    root /usr/share/nginx/app2/build;
    index index.html index.htm;
    try_files $uri $uri/ /index.html;
}

403 Forbidden / 404 Not authorized

In case of error, you will have to check your logs:

sudo tail -n 20 /var/log/nginx/error.log