Cockpit Project: Cockpit 192

Share Button

Cockpit is the modern Linux admin interface. We
release regularly. Here are the release notes from version 192.

Machines: Auto-detect guest operating system

When creating a new VM, the “OS Vendor” and “Operating System” fields are now
set automatically after specifying the installation sources for many vendors.
This uses the libvirt osinfo-detect utility.

Machines OS auto-detection

Translation cleanup

Instead of showing just a predetermined set of languages, the language dialog
now offers all available translations, ordered alphabetically, in their native
translations:

New language dialog

Also, translations with less than 50% completion coverage were removed.

Allow accounts with non-standard shells

Previously, logging into Cockpit was restricted to users who have a shell
specified in /etc/shells, enforced
through pam_shells. This was found
to be too strict, and excludes users with e. g. the tlog-rec-session shell for
session recording.

Cockpit now accepts shells that are unchangeable by non-administrastors, yet
still allow a user to log in. However, shells which do not allow a user to log
in, such as /sbin/nologin or /bin/false, may still be used to deny access to
Cockpit.

Try it out

Cockpit 192 is available now:

Powered by WPeMatico

Share Button

Fedora Community Blog: Stories from the amazing world of release-monitoring.org #3

Share Button

The darkness is slowly falling on my wizard tower, where I’m spending most of the time, when working on the new stuff in realm of the release-monitoring.org. But if you already arrived I could give you some of my time. You probably want to know what I’m working on. It’s not really a secret, but if you insist, I will tell you what happened in the realm in past weeks. So take a chair and hear my words.

Missing scribe

This story began on 28th March. I was looking at the news arriving by carrier pigeons (fedora-devel mailing list in Thunderbird 🙂 ) and there was one asking this question “Is Anitya not working again?”. I was terrified at first that something happened on Anitya and I’m not aware of it. So I cast a teleportation spell and transported myself directly to Anitya (checked release-monitoring.org openshift instance). Everything was in order.

So I asked by using the carrier pigeons a few additional questions. It turned out that the original sender of the message was using Abstract Positive Intuition (API) to introduce plenty of new projects to Anitya.

I started to look for the root of this inconvenience and it doesn’t take long to find it. I arrived to the department that is taking care of the Abstract Positive Intuition (API) and found out, that there is no scribe sending messages when we get a new request for projects added to Fedora universe (when new mapping is added through API, there was trigger to send message about this). I fixed this quickly in my work in progress version by adding a new scribe (fixed in master on GitHub).

But the damage has been done. I asked the original sender to provide me a list of Fedora universe projects (list of packages) he added to Anitya and started working on magical formulae (python script) to make things right. This took more time than I thought, but I’m able to now fix similar issues when they happen. I added the magical formulae to my library, to have it close to hand when something happen, you can look at it, if you dare. However you need certain rights to be able to use it.

After fixing the projects (the script is deleting the latest version from the list of projects and let the cronjob to check for them again) on the list that original sender sent to me I was approached by two others that had similar problems. So I can say that this work already paid off.

Support for multiple prefixes

Every time a news (version) from some project arrives, Anitya needs to do some changes before it could be shown to everyone interested. One of the things that Anitya does is stripping the news of unimportant parts like prefix. This prefix could be any text. Until recently Anitya only supported one prefix, which wasn’t enough for some projects. And now I did some magic and we are supporting multiple of those prefixes.

I will conjure a few images to present you how this works. On the first image you could see some project we are watching without any changes.

So what I do is to change the project and define two prefixes split by ‘;’.

And now you can see the output.

As you can see this isn’t the best example, because this caused the order of news to change. In standard situation you wouldn’t remove parts of the news itself, but things like ‘rel’, ‘release-‘, ‘project-‘ and similar.

Hungry rat

Recently we had a particularly hungry rat in Anitya, which always ate one of the workers when someone tried to change the known aliases of the project (package mappings). This caused that instead of the original worker, who knew something about the alias, we send fresh one that didn’t know nothing (first distribution was shown instead of the mapped one.)

It took some effort and few of the ice spells (thank gods we don’t need to pay any health insurance) to finally find the rat and catch it. We are now using it to run in the wheel to create some magical energy for Anitya. It eats much, but it’s producing vast amount of energy.

The workers are now happy that nobody wants to eat them, when running with their information. And anybody who wants to change known aliases is happy, because the information is not lost.

Post scriptum

So, when you could see these changes in Anitya? Look for the version 0.16.0, which is currently still work in progress.

This is all for now from the world of release-monitoring.org. Do you like this world and want to join our conclave of mages? Seek me (mkonecny) in the magical yellow pages (IRC freenode #fedora-apps) and ask how can you help. Or visit the Bugcronomicon (GitHub issues on Anitya or the-new-hotness) directly and pick something to work on.

The post Stories from the amazing world of release-monitoring.org #3 appeared first on Fedora Community Blog.

Powered by WPeMatico

Share Button

Sirko Kemter: An Awesome Week

Share Button

Last week was one of the most awesome weeks, I ever had. Even the start was not so successful, I tried to get my bicycle repaired. Unfortunately as I came to the bike store in my area they was bringing out the furniture as it got closed. But on friday I got it repaired what was quiet an adventure and took the whole afternoon. I had to visit 5 shops to find the right size, but the ugly thing came later finding somebody who fixes the tire on the wheel. Normally you find here each ten meters somebody who fixes tires but nobody wanted to do it. 1.5 hours searching to find one, but now I can use my bicycle again, what saves me a lot of time and money.
The best day was by far the wednesday, first I got confirmed that Open Development Cambodia will host the next Translation Sprint and even more they would host us month for month. After a short consultation with the most active translators, we will do starting May bi-monthly Translation Sprints. I had 3 weeks ago a meeting at Open Development Cambodia and they just wanted me to note down what Fedora is and what we doing, just for their sponsors. The meeting took me the whole day, not the meeting itself but getting there was one hour for me without bike and of course one hour back. But now after 6 months searching and dozens of unsuccessful meetings I finished it and the next sprint can happen. I already made all the necessary tickets and after Khmer New Year we will announce it.


But the best what did happen, that my Moneypool for a new laptop got filled in not even 12 hours after I did blog about it. That really makes me happy, but since then I am not sure if I shall leave it open or close it. In case one I could try to get a better used one or even a new one, if some more donations get in. I did look what I could get, Thinkpads of the T-serie are over 1000US$ but some Edge seems to be in reachable distance. I would go for one even I had bad experiences with an Edge before. So far I decided to leave it open as I cant buy one right now during the New Year holidays anyway and to my birthday are 14 days left. So if you want to donate, you can do, you even can leave me a comment as I am not sure about it.

After I found a place for the next Translation Sprint and even for the following ones, I have now more time and energy again to work on the next “Different Release Party” together with PNC. I hope this works out.

Powered by WPeMatico

Share Button

Fedora Magazine: Kubernetes on Fedora IoT with k3s

Share Button

Fedora IoT is an upcoming Fedora edition targeted at the Internet of Things. It was introduced last year on Fedora Magazine in the article How to turn on an LED with Fedora IoT. Since then, it has continued to improve together with Fedora Silverblue to provide an immutable base operating system aimed at container-focused workflows.

Kubernetes is an immensely popular container orchestration system. It is perhaps most commonly used on powerful hardware handling huge workloads. However, it can also be used on lightweight devices such as the Raspberry Pi 3. Read on to find out how.

Why Kubernetes?

While Kubernetes is all the rage in the cloud, it may not be immediately obvious to run it on a small single board computer. But there are certainly reasons for doing it. First of all it is a great way to learn and get familiar with Kubernetes without the need for expensive hardware. Second, because of its popularity, there are tons of applications that comes pre-packaged for running in Kubernetes clusters. Not to mention the large community to provide help if you ever get stuck.

Last but not least, container orchestration may actually make things easier, even at the small scale in a home lab. This may not be apparent when tackling the the learning curve, but these skills will help when dealing with any cluster in the future. It doesn’t matter if it’s a single node Raspberry Pi cluster or a large scale machine learning farm.

K3s – a lightweight Kubernetes

A “normal” installation of Kubernetes (if such a thing can be said to exist) is a bit on the heavy side for IoT. The recommendation is a minimum of 2 GB RAM per machine! However, there are plenty of alternatives, and one of the newcomers is k3s – a lightweight Kubernetes distribution.

K3s is quite special in that it has replaced etcd with SQLite for its key-value storage needs. Another thing to note is that k3s ships as a single binary instead of one per component. This diminishes the memory footprint and simplifies the installation. Thanks to the above, k3s should be able to run k3s with just 512 MB of RAM, perfect for a small single board computer!

What you will need

  1. Fedora IoT in a virtual machine or on a physical device. See the excellent getting started guide here. One machine is enough but two will allow you to test adding more nodes to the cluster.
  2. Configure the firewall to allow traffic on ports 6443 and 8472. Or simply disable it for this experiment by running “systemctl stop firewalld”.

Install k3s

Installing k3s is very easy. Simply run the installation script:

curl -sfL https://get.k3s.io | sh -

This will download, install and start up k3s. After installation, get a list of nodes from the server by running the following command:

kubectl get nodes

Note that there are several options that can be passed to the installation script through environment variables. These can be found in the documentation. And of course, there is nothing stopping you from installing k3s manually by downloading the binary directly.

While great for experimenting and learning, a single node cluster is not much of a cluster. Luckily, adding another node is no harder than setting up the first one. Just pass two environment variables to the installation script to make it find the first node and avoid running the server part of k3s

curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 
K3S_TOKEN=XXX sh -

The example-url above should be replaced by the IP address or fully qualified domain name of the first node. On that node the token (represented by XXX) is found in the file /var/lib/rancher/k3s/server/node-token.

Deploy some containers

Now that we have a Kubernetes cluster, what can we actually do with it? Let’s start by deploying a simple web server.

kubectl create deployment my-server --image nginx

This will create a Deployment named “my-server” from the container image “nginx” (defaulting to docker hub as registry and the latest tag). You can see the Pod created by running the following command.

kubectl get pods

In order to access the nginx server running in the pod, first expose the Deployment through a Service. The following command will create a Service with the same name as the deployment.

kubectl expose deployment my-server --port 80

The Service works as a kind of load balancer and DNS record for the Pods. For instance, when running a second Pod, we will be able to curl the nginx server just by specifying my-server (the name of the Service). See the example below for how to do this.

# Start a pod and run bash interactively in it
kubectl run debug --generator=run-pod/v1 --image=fedora -it -- bash
# Wait for the bash prompt to appear
curl my-server
# You should get the "Welcome to nginx!" page as output

Ingress controller and external IP

By default, a Service only get a ClusterIP (only accessible inside the cluster), but you can also request an external IP for the service by setting its type to LoadBalancer. However, not all applications require their own IP address. Instead, it is often possible to share one IP address among many services by routing requests based on the host header or path. You can accomplish this in Kubernetes with an Ingress, and this is what we will do. Ingresses also provide additional features such as TLS encryption of the traffic without having to modify your application.

Kubernetes needs an ingress controller to make the Ingress resources work and k3s includes Traefik for this purpose. It also includes a simple service load balancer that makes it possible to get an external IP for a Service in the cluster. The documentation describes the service like this:

k3s includes a basic service load balancer that uses available host ports. If you try to create a load balancer that listens on port 80, for example, it will try to find a free host in the cluster for port 80. If no port is available the load balancer will stay in Pending.

k3s README

The ingress controller is already exposed with this load balancer service. You can find the IP address that it is using with the following command.

$ kubectl get svc --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.43.0.1 443/TCP 33d
default my-server ClusterIP 10.43.174.38 80/TCP 30m
kube-system kube-dns ClusterIP 10.43.0.10 53/UDP,53/TCP,9153/TCP 33d
kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d

Look for the Service named traefik. In the above example the IP we are interested in is 10.0.0.8.

Route incoming requests

Let’s create an Ingress that routes requests to our web server based on the host header. This example uses xip.io to avoid having to set up DNS records. It works by including the IP adress as a subdomain, to use any subdomain of 10.0.0.8.xip.io to reach the IP 10.0.0.8. In other words, my-server.10.0.0.8.xip.io is used to reach the ingress controller in the cluster. You can try this right now (with your own IP instead of 10.0.0.8). Without an ingress in place you should reach the “default backend” which is just a page showing “404 page not found”.

We can tell the ingress controller to route requests to our web server Service with the following Ingress.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-server
spec:
rules:
- host: my-server.10.0.0.8.xip.io
http:
paths:
- path: /
backend:
serviceName: my-server
servicePort: 80

Save the above snippet in a file named my-ingress.yaml and add it to the cluster by running this command:

kubectl apply -f my-ingress.yaml

You should now be able to reach the default nginx welcoming page on the fully qualified domain name you chose. In my example this would be my-server.10.0.0.8.xip.io. The ingress controller is routing the requests based on the information in the Ingress. A request to my-server.10.0.0.8.xip.io will be routed to the Service and port defined as backend in the Ingress (my-server and 80 in this case).

What about IoT then?

Imagine the following scenario. You have dozens of devices spread out around your home or farm. It is a heterogeneous collection of IoT devices with various hardware capabilities, sensors and actuators. Maybe some of them have cameras, weather or light sensors. Others may be hooked up to control the ventilation, lights, blinds or blink LEDs.

In this scenario, you want to gather data from all the sensors, maybe process and analyze it before you finally use it to make decisions and control the actuators. In addition to this, you may want to visualize what’s going on by setting up a dashboard. So how can Kubernetes help us manage something like this? How can we make sure that Pods run on suitable devices?

The simple answer is labels. You can label the nodes according to capabilities, like this:

kubectl label nodes  =
# Example
kubectl label nodes node2 camera=available

Once they are labeled, it is easy to select suitable nodes for your workload with nodeSelectors. The final piece to the puzzle, if you want to run your Pods on all suitable nodes is to use DaemonSets instead of Deployments. In other words, create one DaemonSet for each data collecting application that uses some unique sensor and use nodeSelectors to make sure they only run on nodes with the proper hardware.

The service discovery feature that allows Pods to find each other simply by Service name makes it quite easy to handle these kinds of distributed systems. You don’t need to know or configure IP addresses or custom ports for the applications. Instead, they can easily find each other through named Services in the cluster.

Utilize spare resources

With the cluster up and running, collecting data and controlling your lights and climate control you may feel that you are finished. However, there are still plenty of compute resources in the cluster that could be used for other projects. This is where Kubernetes really shines.

You shouldn’t have to worry about where exactly those resources are or calculate if there is enough memory to fit an extra application here or there. This is exactly what orchestration solves! You can easily deploy more applications in the cluster and let Kubernetes figure out where (or if) they will fit.

Why not run your own NextCloud instance? Or maybe gitea? You could also set up a CI/CD pipeline for all those IoT containers. After all, why would you build and cross compile them on your main computer if you can do it natively in the cluster?

The point here is that Kubernetes makes it easier to make use of the “hidden” resources that you often end up with otherwise. Kubernetes handles scheduling of Pods in the cluster based on available resources and fault tolerance so that you don’t have to. However, in order to help Kubernetes make reasonable decisions you should definitely add resource requests to your workloads.

Summary

While Kubernetes, or container orchestration in general, may not usually be associated with IoT, it certainly makes a lot of sense to have an orchestrator when you are dealing with distributed systems. Not only does is allow you to handle a diverse and heterogeneous fleet of devices in a unified way, but it also simplifies communication between them. In addition, Kubernetes makes it easier to utilize spare resources.

Container technology made it possible to build applications that could “run anywhere”. Now Kubernetes makes it easier to manage the “anywhere” part. And as an immutable base to build it all on, we have Fedora IoT.

Powered by WPeMatico

Share Button

Open Source Security Podcast: Episode 141 – Timezones are hard, security is harder

Share Button

Josh and Kurt talk about the difficulty of security. We look at the difficulty of the EU not observing daylight savings time, which is probably magnitudes easier than getting security right. We also hit on a discussion on Reddit about U2F that shows the difficulty. Security today is too hard, even for the experts.

Show Notes

    Powered by WPeMatico

    Share Button

    Richard W.M. Jones: virt-install + nbdkit live install

    Share Button

    This seems to be completely undocumented which is why I’m writing this … It is possible to boot a Linux guest (Fedora in this case) from a live CD on a website without downloading it. I’m using our favourite flexible NBD server, nbdkit and virt-install.

    First of all we’ll run nbdkit and attach it to the Fedora 29 live workstation ISO. To make this work more efficiently I’m going to place a couple of filters on top — one is the readahead (prefetch) filter recently added to nbdkit 1.12, and the other is the cache filter. In combination these filters should reduce the load on the website and improve local performance.

    $ rm /tmp/socket
    $ nbdkit -f -U /tmp/socket --filter=readahead --filter=cache 
        curl https://download.fedoraproject.org/pub/fedora/linux/releases/29/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-29-1.2.iso
    

    I actually replaced that URL with a UK-based mirror to make the process a little faster.

    Now comes the undocumented virt-install command:

    $ virt-install --name test --ram 2048 
        --disk /var/tmp/disk.img,size=10 
        --disk device=cdrom,source_protocol=nbd,source_host_transport=unix,source_host_socket=/tmp/socket 
        --os-variant fedora29
    

    After a bit of grinding that should boot into Fedora 29, and you never (not explicitly at least) had to download the ISO.

    Screenshot_2019-04-13_10-30-00

    To be fair qemu does also have a curl driver which virt-install could use, but nbdkit is better with the filters and plugins system giving you ultimate flexibility — check out my video about it.

    Powered by WPeMatico

    Share Button

    Davis Álvarez: Create your First Application with Laravel

    Share Button

    Since it’s initial launch in 2011, Laravel has experienced exponential growth. In 2015 it became the most outstanding PHP framework in GitHUb.

    Laravel’s philosophy is to develop PHP code in an elegant and simple way based on a model MVC (Model-View-Controller). It has a modular and extensible code through a package manager and robust support for database management.

    This guide is elaborated thinking in people who are starting with Laravel, a registration system will be developed to cover the basic operations of create, read, update and delete records, commonly known as CRUD.

    Server Requirements

    All the requirements of the server for the development of this guide are in the article Install Laravel with Apache and MySQL

    Create Database

    Execute the following command in the terminal:

    mysql -u root -p

    It will ask you for the password of the root user, once you enter the password correctly it will show you the mysql prompt>

    Starting MySQL from the command line
    Starting MySQL from the command line

    You can also use phpmyadmin to create the database, if you have it installed.

    From the terminal create the database to use:

    CREATE DATABASE laravelcrud;

    Create the username and password, which will be assigned to the created database:

    CREATE USER 'laravel_user'@'127.0.0.1' IDENTIFIED BY 'LaB_101

    Assign the created user to the database:

    GRANT ALL ON laravelcrud.* TO 'laravel_user'@'127.0.0.1';

    To reload the privilege table, the following command is executed:

    FLUSH PRIVILEGES;

    Create Laravel Project

    Execute the command that will create a new project called laravelcrud, this command will generate the entire structure of folders, files and dependencies necessary to run the application:

    laravel new laravelcrud
    Create new Laravel project
    Create new Laravel project

    Open The Project in the Preference Editor

    Once the new Laravel project is generated, open it in your  preferred editor, personally I like to use Visual Code.

    Through the terminal access to the project folder:

    cd laravelcrud

    Set Database Configuration

    Search the .env file and proceed to write the configuration of the database created and that will be used by the application:

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=laravelcrud
    DB_USERNAME=laravel_user
    DB_PASSWORD=LaB_101$

    To be sure that there is a connection between our application and the database, execute the command:

    php artisan migrate

    This command will create 3 tables in the default database:

    1. migratios
    2. password_resets
    3. users

    In the terminal connected to the MySQL prompt run:

    mysql> use laravelcrud;
    mysql> show tables;

    Additional in the project the migrations for those tables were automatically created in the generated folder app -> database-> migrations

    Create Model and Migration

    In the terminal execute:

    php artisan make:model Registry -m

    Two files will be created:

    1. Registry.php the model.
    2. create_registries_table.php the migration.

    You need to create the structure (schema) of the registry table to modify the newly created migration file found in app -> database -> migrations -> create_registries_table.ph

    In the class created for the migration, the methods up and down are automatically generated, modifying as follows:

    integer('id')->unsigned();
                $table->string('first_name',50);
                $table->string('second_name',50)->nullable();
                $table->string('surename',50);
                $table->string('second_surename',50)->nullable();
                $table->string('email',100);
                $table->string('cell_phone',50)->nullable();
                $table->string('phone',50)->nullable();
                $table->string('coments',500)->nullable();
                $table->integer('age');
                $table->boolean('flosspainfo')->nullable();
                $table->boolean('fedorainfo')->nullable();
                $table->boolean('latansecinfo')->nullable();
    
                $table->timestamps();
                $table->primary(array('id', 'email'));
    
                
            });
    
            DB::statement('ALTER TABLE registries MODIFY id INTEGER NOT NULL AUTO_INCREMENT');
        }
    
        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
            Schema::dropIfExists('registries');
        }
    }

    Re-execute the migration command:

    php artisan migrate

    To validate the creation of the table run the database command used previously and to validate the creation of the columns run in the terminal:

    use laravelcrud;
    show columns from registries;

    Create The Register View

    The first view is generated, to do this create the registries folder inside app -> resources -> views and then create the create.blade.php file inside this folder:

    
    
      
        
        FLOSSPA Asistencia Evento 
        
        
        
    
      
      
        
    FLOSSPA @if ($errors->any())
      @foreach ($errors->all() as $error)
    • {{ $error }}
    • @endforeach

    @endif @if (Session::has('success'))

    {{ Session::get('success') }}


    @endif
    {{csrf_field()}}

    To avoid CSRF attacks (Cross-site request forgery or cross-site request forgery) is a type of malicious exploit of a website in which unauthorized commands are transmitted by a user in which the website trusts. This vulnerability is also known by other names such as XSRF, hostile link, session thrust, and automatic attack. Larvel provides the protection {{csrf_field ()}}.

    To preserve the information in the form, it is achieved by adding value = {{old (‘first_name’)}} in each of the added controls.

    Now create the route to display the view, execute the following command:

    php artisan make:controller RegistryController --resource

    Inside the folder app -> Http -> Controllers you will find the controller, automatically generated with all the necessary methods for the CRUD.

    In order to have access to the methods created, a route referring to the controller must be added, the file app -> routes -> web.php is modified

    
    

    To watch the list of routes execute in the terminal:

    php artisan route:list

    In the create method of the controller, the following code is added:

    public function create()
    {  
       return view('registries.create');
    }

    Start the Laravel development server and you will watch the first view:

    php artisan serve

    Load the next URL in the browser:

    http://localhost:8000/registries/create

    Laravel application view
    Laravel application view

    In the public -> css folder, custom CSS was added and the images folder was created to add the image that is displayed on the screen. You can download the code from my GitHub account.

    In the model, you must handle the Mass Assignment vulnerability, the class found in app -> Registry.php is modified.

    
    

    For to save the data that is sent from the view, the RegistryController.php controller must be modified, including the Registry class and the static interface (Facades) Input.

    use AppRegistry;
    use IlluminateSupportFacadesInput;

    Now you must modify the store method:

    public function store(Request $request)
        {
           
            $registry = $this->validate(request(), [
                'first_name' => 'required',
                'surename' => 'required',
                'email' => 'required|email',
                'age' => 'integer|min:0'
              ]);
    
            
              $flosspainfo = Input::get('flosspainfo') == 'on' ? true :false;
              $fedorainfo = Input::get('fedorainfo') == 'on' ? true :false;
              $latansecinfo = Input::get('latansecinfo') == 'on' ? true :false;
              
    
              Registry::create([
                'first_name'=> Input::get('first_name'),
                'second_name'=> Input::get('second_name'),
                'surename'=> Input::get('surename'),
                'second_surename'=> Input::get('second_surename'),
                'email'=> Input::get('email'),
                'cell_phone' => Input::get('cell_phone'),
                'phone'=> Input::get('phone'),
                'coments'=> Input::get('coments'),
                'age'=> Input::get('age'),
                'flosspainfo'=> $flosspainfo,
                'fedorainfo'=>  $fedorainfo,
                'latansecinfo'=>  $latansecinfo
              ]);
      
              return back()->with('success', 'Información almacenada con éxito');
        }

    Load the view and try to save without filling the data, validation messages will be received.

    To display the messages in Spanish you can use the following translation package.

    List View

    Now you will create a list of all saved records, create the view in

    app–>resources–>views–> registries–>index.blade.php

    
    
      
        
        Index Page
        
      
      
        
    FLOSSPA
    @if (Session::has('success'))

    {{ Session::get('success') }}


    @endif @foreach($registries as $registry) @endforeach
    ID Nombre Apellido Email Teléfono Celular Acción
    {{$registry['id']}} {{$registry['first_name']}} {{$registry['surename']}} {{$registry['email']}} {{$registry['phone']}} {{$registry['cell_phone']}} Edit
    {{csrf_field()}}

    Modify the controller by adding the view load:

    public function index()
    {
        $registries = Registry::all()->toArray();
        return view('registries.index', compact('registries'));
    }

    Load the view http://localhost:8000/registries

    View of the list of records
    View of the list of records

    Edit View

    Create the editing functionality of a record, for it starts creating the view that is quite similar to that of the creation app -> resources -> views -> registries -> edit.blade.php

    
    
      
        
        FLOSSPA Editar Asistencia Evento 
        
        
        
    
      
      
        
    FLOSSPA @if ($errors->any())
      @foreach ($errors->all() as $error)
    • {{ $error }}
    • @endforeach

    @endif @if (Session::has('success'))

    {{ Session::get('success') }}


    @endif
    {{csrf_field()}}

    Modify the edit method, as well as the update method of the controller:

    /**
         * Show the form for editing the specified resource.
         *
         * @param  int  $id
         * @return IlluminateHttpResponse
         */
        public function edit($id)
        {
            $registry = Registry::find($id);
            return view('registries.edit',compact('registry','id'));
        }
    
        /**
         * Update the specified resource in storage.
         *
         * @param  IlluminateHttpRequest  $request
         * @param  int  $id
         * @return IlluminateHttpResponse
         */
        public function update(Request $request, $id)
        {
          
           $registry = Registry::find($id);
            $this->validate(request(), [
                'first_name' => 'required',
                'surename' => 'required',
                'email' => 'required|email',
                'age' => 'integer|min:0'
              ]);
    
            
              $registry->first_name = Input::get('first_name');
              $registry->second_name =  Input::get('second_name');
              $registry->surename = Input::get('surename');
              $registry->second_surename =  Input::get('second_surename');
              $registry->email = Input::get('email');
              $registry->cell_phone =  Input::get('cell_phone');
              $registry->phone = Input::get('phone');
              $registry->coments = Input::get('coments');
              $registry->age = Input::get('age');
              $registry->flosspainfo = Input::get('flosspainfo') == 'on' ? true :false;
              $registry->fedorainfo = Input::get('fedorainfo') == 'on' ? true :false;
              $registry->latansecinfo = Input::get('latansecinfo') == 'on' ? true :false;
              $registry->save();
              
      
              return back()->with('success', 'Registry updated successfully');
              
        }

    Deleting Record

    To delete a record, add the following in the destroy method of the controller:

    public function destroy($id)
    {
      $registry = Registry::find($id);
      $registry->delete();
      return redirect('registries')->with('success','Registry has been  deleted');
    }

    You can find the fully functional project in my GitHub account.

    The post Create your First Application with Laravel appeared first on Davis Álvarez.

    Powered by WPeMatico

    Share Button

    Fedora Community Blog: FPgM report: 2019-15

    Share Button

    Fedora Program Manager weekly report on Fedora Project development and progress

    Here’s your report of what has happened in Fedora Program Management this week.

    I have weekly office hours in #fedora-meeting-1. Drop by if you have any questions or comments about the schedule, Changes, elections, or anything else.

    Announcements and help wanted

    Help wanted

    Meetings and test days

    Fedora 30 Status

    Fedora 30 Beta is released. The Fedora 30 GA is scheduled for 30 April 2019.

    Schedule

    • 2019-04-16 — Final freeze begins
    • 2019-04-30 — Final preferred target
    • 2019-05-07 — Final target date #1

    Blocker bugs

    Bug ID Blocker status Component Bug Status
    1683197 Accepted (Final) gdm ASSIGNED
    1691909 Accepted (Final) gdm NEW
    1690429 Accepted (Final) gnome-shell NEW
    1688462 Accepted (Final) libdnf NEW
    1666920 Accepted (Final) systemd POST
    1699179 Proposed (Final) anaconda ASSIGNED
    1693409 Proposed (Final) gdm NEW
    1693409 Proposed (Final) selinux-policy NEW
    1699099 Proposed (Final) selinux-policy NEW
    1698550 Proposed (Final) shim NEW
    1697591 Proposed (Final) xorg-x11-server NEW

    Fedora 31 Status

    Changes

    Approved by FESCo

    Submitted to FESCo

    Rejected by FESCo

    The post FPgM report: 2019-15 appeared first on Fedora Community Blog.

    Powered by WPeMatico

    Share Button

    mythcat: Fedora 29 : Thonny editor for python.

    Share Button


    This Python IDE for beginners named Thonny is a simple editor with Python 3.7 built in.
    The official webpage can be found here and the GitHub project page is this.
    The development team is from the University of Tartu, Estonia with the help from the open-source community. Thonny grew up in University of Tartu (https://www.ut.ee), Institute of Computer Science (https://www.cs.ut.ee).
    I test it today with Fedora 29 and works well.
    Let’s start with the first step:

    [mythcat@desk ~]$ pip3 install thonny --user
    Collecting thonny
    ...
    Successfully installed astroid-2.2.5 asttokens-1.1.13 docutils-0.14 isort-4.3.17 jedi-0.13.3 lazy-object-proxy-1.3.1
    mccabe-0.6.1 mypy-0.700 mypy-extensions-0.4.1 parso-0.4.0 pylint-2.3.1 pyperclip-1.7.0 pyserial-3.4 thonny-3.1.2
    typed-ast-1.3.1
    ...
    [root@desk mythcat]# dnf install python3-tkinter.x86_64
    Last metadata expiration check: 0:21:20 ago on Tue 09 Apr 2019 09:57:24 PM EEST.

    Installed:
    python3-tkinter-3.7.2-5.fc29.x86_64 tk-1:8.6.8-1.fc29.x86_64

    Complete!

    This editor can be found on Fedora repo, but I used the last released version software.

    [root@desk mythcat]# dnf search thonny
    Last metadata expiration check: 0:36:55 ago on Tue 09 Apr 2019 09:57:24 PM EEST.
    ========================= Name Exactly Matched: thonny =========================
    thonny.noarch : Python IDE for beginners

    Powered by WPeMatico

    Share Button

    Remi Collet: QElectroTech on the road to 0.7

    Share Button

    RPM of QElectroTech version 0.70-rc1 (release candidate), an application to design electric diagrams, are available in remi-test for Fedora and Enterprise Linux 7.

    While the version 0.6, available in the official repository is already 1 year old, the project is working on a new major version of their electric diagrams editor.

    Official web site : http://qelectrotech.org/.

    Installation by YUM :

    yum --enablerepo=remi-test install qelectrotech

    RPM (version 0.70~rc1-1) are available for Fedora ≥ 27 and Enterprise Linux 7 (RHEL, CentOS, …)

    Follow this entry which will be updated on each new version (beta, RC, …) until the finale version release.

    Notice :a Copr / Qelectrotech repository also exists, which provides “development” versions (0.70-dev for now).

    Powered by WPeMatico

    Share Button