Open-source News

Cemu 2.0-1 Brings Many Smaller Linux Improvements For This Wii U Emulator

Phoronix - Tue, 09/06/2022 - 17:41
Last month saw the Cemu project go open-source and introduce Linux support with Cemu 2.0 for this Nintendo Wii U emulator that has been in development for years. Cemu 2.0-1 is now available with Linux improvements...

OpenWrt 22.03 Released With Updated Firewall, Support For 180+ New Devices

Phoronix - Tue, 09/06/2022 - 17:29
OpenWrt as the embedded Linux distribution designed to run on wireless routers and other networking devices is out with its 22.03 stable release...

Applying open organization principles to save factory energy

opensource.com - Tue, 09/06/2022 - 15:00
Applying open organization principles to save factory energy Ron McFarland Tue, 09/06/2022 - 03:00 1 reader likes this 1 reader likes this

The problem with energy costs is that most people don't think about them. They just look at their overall bill without considering how the energy was used. By monitoring and measuring energy use through sensors in very specific locations, energy waste can be made transparent and reduced.

That's the premise of the book Reinventing Fire: Bold Business Solutions for the New Energy Era, which offers methods to eliminate the use of fossil fuels by 2050 through energy waste reduction. It's also the premise of a story I began in an earlier article about two retired utilities salespeople-turned-consultants who started an open organization community to reduce energy waste in their region, which they call the "Reinventing Fire Community." Their work depends on the open organization principles of Community, Transparency, Collaboration, Inclusivity, and Adaptability.

In that article, I talked about actions one of my imaginary consultants recommended for home and commercial building owners. In this article, I discuss the other fictional consultant, who sold electricity to factories.

It may be surprising how much energy is wasted in factories. The fact is, there aren't enough energy specialists available right now, and most production managers have their attention on other things, particularly production volume. Too many top managers look at sales, profit margins, and gross profit and miss "boring" expenses. In addition, small savings are hard to see until they're multiplied hundreds of times.

In addition, most operations managers look at each process separately and individually. They can't see the overall energy waste picture until it's pointed out. This is where transparency and collaboration between people in all plant processes are essential. There might be countless duplications of processes where cooperation could be very beneficial. Real rewards may take 3-5 years to materialize, and unfortunately, many people only look at short-term gains.

Open Organization resources Download resources Join the community What is an open organization? How open is your organization? Factory energy consultant

In this hypothetical case study, the factory energy consultant goes to factories, starting with their previous electricity users. They offer suggestions on how to reduce yearly energy expenses by at least 10-50%. If equipment investment is required, the consultant promises that the equipment will pay for itself in 3-5 years of savings.

The consultant sets the following conditions for working together:

  1. The factory operator must be as transparent as possible about current energy use and expenses.
  2. The consultant will not give anyone this information except trusted partners they are working with to generate the very best proposals.
  3. There is no charge for the consulting, as they only want to reduce energy use in the community, and at this stage the consultants don't know how valuable they will be.
  4. The consultant would like a performance report and a general testimonial letter at the end of 2 years explaining how much the energy user's bill has been reduced.
Industrial energy use

How can this consultant use all the principles of Community, Transparency, Collaboration, Inclusion, and Adaptability?

First, the factory energy consultant makes an appointment with their most trusted electricity-using manufacturing company and explains that they can help the company save money, with a target of saving 27% of primary energy by 2050 while maintaining current production levels. This will save the company money and reduce the impact of volatile price changes or power failures.

The consultant explains the chart below to provide perspective on where energy waste can be avoided.

Image by:

From Reinventing Fire, by Amory Lovins (Ron McFarland, CC BY-SA 4.0)

In manufacturing, 40% of the primary energy (energy that comes directly from the source, such as coal, gas, oil, and so on) is used for heating, and another 40% is used for rotating shafts on machines. The remaining 20% goes to a wide range of processes like smelting, cutting, grinding, boring, lighting, and space conditioning. Those are the areas the consultant wants to explore.

Secondary energy is converted to electricity and delivered. There is loss during this conversion, as illustrated in the bar chart below. Electricity-system losses use nearly as much primary energy as process heat does.

Image by:

From Reinventing Fire, by Amory Lovins (Ron McFarland, CC BY-SA 4.0)

The consultant explains that there are two main areas to look at regarding energy-use reduction: heat and pressure. Where is extremely high temperature applied in the manufacturing process? Where is high pressure applied? Also, how can waste in one process become a raw material input for another? This includes excess heat and excess pressure. Sometimes these two are produced and used jointly, called combined heat and power (CHP). Those two can sometimes generate electricity from primary high heat and pressure and other times from leftover lower heat and pressure from a given process.

Reducing energy consumption in factories

The consultant explains four areas where energy is used and can be reduced in any factory:

  • Level 1: Reduce manufacturing processing energy use. Sometimes this can be accomplished by using sensors and controls to stop equipment from running when not needed. Fine-tuning pressure controls and giving notifications when maintenance is needed to maintain ideal performance are other means of reducing energy use at this level.
     
  • Level 2: Reduce energy delivery losses. This can be achieved by insulating pipes, maintaining steam traps and air filters, and so on. Changing wiring can also reduce electrical energy loss. Old wires were developed only to prevent fires, but new versions are designed to save energy, cutting waste significantly. The consultant mentions that they should review the age and energy delivery efficiency of all wiring. Air compressors could be checked for energy-wasting leaks. Just making these changes could pay for itself in six months.
     
  • Level 3: Get better at generating in-house energy through better devices. Motors run drill presses, chillers, grinders, mixers, and blowers. The cost of running them for only a few weeks could be the same as entirely replacing the power motor itself. The consultant asks several questions: When are these motors running? Are they the right size and specifications for their use right now? Are there devices on the machines that measure energy use? Can variable-speed control be installed to reduce wasted RPMs? What is the age of the motors? These questions also apply to pumps, fans, furnaces, compressors, chillers, blowers, and boilers. The consultant explains that in most factories today, almost all boilers lack smart controls that reduce start-up and shutdown energy waste.
     
  • Level 4: Put energy waste to use. Waste heat and excess pressure can be either useless or a valuable energy source. Repeated cycles of heating and cooling take energy. In most factories, fuel is converted one-third into electricity and two-thirds into heat. That heat very often is thrown away. The amount of energy loss in US factories is equal to the amount of energy Japan uses for everything. That is a huge waste. Could that heat be transported to another process? The consultant might have to include a specialist from the Rocky Mountain Institute to address this topic.

The consultant adds that the four levels above can play off each other. Super-efficient boilers, ultrasound-aided drying systems, and other energy-saving devices are now available. The Industrial Assessment Centers from the US Department of Energy is a great source. There, US companies can learn where to reduce energy for free. The US Energy Information System could also be helpful.

Another thing to look at is industrial waste. Could what they throw away be converted into a byproduct?

[ Related read 4 reasons IT leaders should champion sustainability ]

Analyzing waste

When analyzing energy waste, start where the energy is applied and work backward to the power generation location. Reinventing Fire gives an example of a datacenter in the diagram below:

Image by:

From Reinventing Fire, by Amory Lovins (Ron McFarland, CC BY-SA 4.0)

Notice it starts on the left with the energy needed for computing, then reflects the process of energy loss through the datacenter, server, applications, and business process. Is that computation needed? Is the software efficient? Next, look at the IT equipment. Is it suitable for that type of work? Next, look at the cooling and power supply. Is it appropriate? This same type of questioning should be done for each process in the factory operations manager's facility.

The consultant mentions that starting at the use point is also helpful for piping and air/fluid flow. Generally, smaller pipes require more energy to pump fluid/air/gas through them and require larger pumps. This is true for curves in the piping as well. The less the curve angle, the better. First, design the piping size and curves, then select the pump required. The fatter and straighter, the smaller the pump requirement. Doing this right saves over half the energy required.

Many factories were designed when fuel was cheap, so these cost savings were not considered. The consultant gives the below example:

Image by:

From Reinventing Fire, by Amory Lovins (Ron McFarland, CC BY-SA 4.0)

Notice that most energy is lost right in the power station where the electricity is generated. Then, there is loss in getting the electricity to the location, to operate the motor, to run the drivetrain, pump and values and finally, the fluid going through the pipes. All those losses should be looked at. Therefore, the consultant asks the operations manager to explain all factory piping and air/fluid flow systems.

Assume they find areas that waste a lot of energy and retrofit the entire flow system. What about the size of the pumping equipment? Is it now too large for the process? Equipment is usually purchased to have the capacity to supply maximum demand. When that maximum demand is no longer needed, the motor should also be downsized, even if it has life in it. Motor choice, life, sizing, controls, maintenance, and associated electrical and mechanical elements interact intricately. Now, with a reduction in the requirement, the motors could be replaced with more efficient and smaller ones.

Over and above reduced pumping demand, equipment refurbishing can sometimes pay for itself in less than a few years. For example, bearing quality has improved over the years. That alone could generate significant savings.

The consultant asks about any furnaces in the factory, a major energy user. They mention that reverberatory furnaces to melt aluminum can be replaced by electric heaters with ceramic coatings. This is called isothermal melting, which saves energy and floor space. Solar heating is another major power source for industry, with falling prices and higher efficiency.

Production equipment lifecycle

Items used for production go through a lifecycle, and old equipment need not be thrown away. Before they are declared as a total waste, resources could be:

  • Recovered (brought out of retirement and used again)
  • Reused (moved from a main process to a backup process)
  • Repaired (just fixed with upgraded parts)
  • Remanufactured (reshape for continued use)
  • Recycled (break down raw materials for added use)

The consultant asks about the age and life of all the production equipment. How many years of life does each piece of equipment have? What is the recycling program?

Energy sourcing

Whether for buildings, homes, or factories, energy sourcing will change greatly from centralized supply to distributed supply in the years ahead. The consultant recommends they look over the entire factory and ask where solar panels and mini wind-power generators might be installed. Additionally, they ask about any community energy grid projects in the region.

Furthermore, they ask about the vehicle fleet (including delivery trucks and forklifts) and internal-combustion-powered generators, cranes, and any material-moving equipment. Could they be powered by electricity? If so, they might be a potential power source as well.

Company incentives

After reviewing all these energy-saving measures, the consultant mentions that looking at energy waste isn't just about processes. It's about employee attention too. Issues of energy waste, transparency, collaboration, and adaptation must be inclusive to all front-line workers. They should be included and encouraged to form their own "Reinventing Fire Communities" so they can see waste firsthand. The consultant mentions that many companies have drawn employees' attention to energy waste by introducing competitions between divisions, comparing waste reduction percentages from their current energy consumption benchmarks. A wide range of incentives, raffles, games, contests, and awards can may also attract employee interest.

Community expansion

To ensure expertise develops as quickly and efficiently as possible, the factory energy efficiency consultant and the building consultant in the previous article discuss and collaborate on how their meetings with energy users went. They also kept the Rocky Mountain Institute in the loop. That way, everyone can learn from each other's experiences. For total transparency, their meeting reporting system is interconnected.

With many successes in reducing energy waste in factories, buildings, and homes, they gathered many testimonial letters on how they have helped individual families and companies. With those letters and experiences, the two fictional consultants decided to carefully expand their community and purpose to consult for warehouses, stores, shopping malls, industrial park developers and operators (not involved in manufacturing), and distribution centers. For this expansion, they started looking for consultants as dedicated to reducing energy waste as they are.

Those were equally successful, so they discussed whether these projects could be monetized and opened discussions of establishing a start-up company in the area.

This has been a theoretical case study largely informed by Reinventing Fire: Bold Business Solutions for the New Energy Era. But you can see the critical role open organization principles have played in this scenario. Energy waste is reduced. Companies and families save a great deal of money. Lifestyles have not changed, but quality of life has improved. And lastly, a potentially viable business model is created that could spread both nationally and possibly globally.

This example shows how one community turns to open organization principles to help factories save energy.

Image by:

Opensource.com

The Open Organization Sustainability What to read next Saving home energy using open organization principles This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

A beginner's guide to making a dark theme for a website

opensource.com - Tue, 09/06/2022 - 15:00
A beginner's guide to making a dark theme for a website Sachin Samal Tue, 09/06/2022 - 03:00 1 reader likes this 1 reader likes this

Having a dark theme for your website is a common feature these days. There are various ways to add a dark theme to your website, and in this article, I demonstrate a beginner-friendly way of programming a dark theme for the web. Feel free to explore, make mistakes, and, more importantly, learn by manipulating the code in your own way.

Image by:

(Sachin Samal, CC BY-SA 4.0)

Programming and development Red Hat Developers Blog Programming cheat sheets Try for free: Red Hat Learning Subscription eBook: An introduction to programming with Bash Bash shell scripting cheat sheet eBook: Modernizing Enterprise Java Icons

I like to provide a visual way for my users to discover the dark mode feature. You can include an easy set of icons by inserting the Font Awesome link in the element of your HTML.


<html lang="en">
<head>
  <title>Toggle - Dark Theme</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
</head>

Inside your tag, create a Font Awesome moon icon class, which you will switch to the Font Awesome sun icon class later using JavaScript. This icon allows users to switch from the default light theme to the dark theme and back again. In this case, you're changing from fa-moon while in the light theme to fa-sun while in the dark theme. In other words, the icon is always the opposite of the current mode.

<body>
  <div id="theme-btn" class="far fa-moon"></div>
</body>

Next, create a CSS class in your stylesheet. You'll append this using the JavaScript add() method to toggle between themes. The toggle() function adds or removes a class name from an element with JavaScript. This CSS code creates a changeTheme class, setting the background color to dark gray and the foreground color (that's the text) to light gray.

.changeTheme {
  background: #1D1E22;
  color: #eee;
}Toggle between themes

To toggle the appearance of the theme button and to apply the changeTheme class, use the onclick(), toggle(), contains(), add(), and remove() JavaScript methods inside your tag:

<script>
    //gets the button by ID from your HTML element
    const themeBtn = document.getElementById("theme-btn");
    //when you click that button
    themeBtn.onclick = () => {
    //the default class "fa-moon" switches to "fa-sun" on toggle
      themeBtn.classList.toggle("fa-sun");
    //after the switch on toggle, if your button contains "fa-sun" class
      if (themeBtn.classList.contains("fa-sun")) {
    //onclicking themeBtn, the changeTheme styling will be applied to the body of your HTML
        document.body.classList.add("changeTheme");
      } else {
    // onclicking themeBtn, applied changeTheme styling will be removed
        document.body.classList.remove("changeTheme");
      }
    }
</script>

The complete code:


<html lang="en">
<head>
  <title>Toggle - Dark Theme</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
</head>
<style>
/* Toggle Dark Theme */
#theme-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: #596AFF;
}
#theme-btn:hover {
  color: #BB86FC;
}
.changeTheme {
  background: #1D1E22;
  color: #eee;
}
</style>
<body>
  <div id="theme-btn" class="far fa-moon"></div>
<script>
const themeBtn = document.getElementById("theme-btn");
themeBtn.onclick = () => {
  themeBtn.classList.toggle("fa-sun");
  if (themeBtn.classList.contains("fa-sun")) {
    document.body.classList.add("changeTheme");
  } else {
    document.body.classList.remove("changeTheme");
  }
}
</script>
</body>
</html>Complete themes

The code so far may not fully switch the theme of a complex website. For instance, your site might have a header, a main, and a footer, each with multiple divs and other elements. In that case, you could create a standard dark theme CSS class and append it to the desired web parts.

Get familiar with your browser's console

To inspect your browser's console, on the webpage where you run this code, press Ctrl+Shift+I or right-click and select the Inspect option.

When you select Elements in the console and toggle your theme button, the browser gives you an indication of whether or not your JavaScript is working. In the console, you can see that the CSS class you appended using JavaScript is added and removed as you toggle.

Image by:

(Sachin Samal, CC BY-SA 4.0)

Add a navigation and card section to see how adding the CSS class name on an HTML element with JavaScript works.

Example code for a dark theme

Here's some example code. You can alternately view it with a live preview here.


<html lang="en">
<head>
  <title>Toggle - Dark Theme</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>

<style>
  #header {
    width: 100%;
    box-shadow: 0px 4px 10px rgba(52, 72, 115, 0.35);
  }
  nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
  .nav-menu {
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nav-menu li {
    margin: 0 0.5rem;
    list-style: none;
    text-decoration: none;
  }
  .nav-menu li a {
    text-decoration: none;
    color: inherit;
  }
  h1 {
    text-align: center;
  }

  /* Toggle Dark Theme */
  #theme-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #596AFF;
  }

  #theme-btn:hover {
    color: #BB86FC;
  }
  .changeTheme {
    background: #1D1E22;
    color: #eee;
  }
  /*-- Card Section --*/
  .card-section .card {
    border: none;
  }
  .card-body {
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px,
      rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
  }
  .card-body ul {
    margin: 0;
    padding: 0;
  }
  .card-body ul li {
    text-decoration: none;
    list-style-type: none;
    text-align: center;
    font-size: 14px;
  }
</style>

<body>
  <header id="header">
    <nav>
      <div id="theme-btn" class="far fa-moon"></div>
      <div class="navbar">
        <ul class="nav-menu">
          <li class="nav-item">
            <a class="nav-link fas fa-home" href="# "> Home
            </a>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <section>
    <h1>Beginner Friendly Dark Theme</h1>
  </section>

  <section class="card-section mt-3">
    <div class="container text-center">
      <div class="row">

        <div class="col-md-4 col-sm-12">
          <div class="card p-1 dark-theme">
            <div class="card-body">
              <h6>What is Lorem Ipsum?</h6>
              <ul>
                <li>Sed sit amet felis tellus.</li>
                <li>Sed sit amet felis tellus.</li>
              </ul>
            </div>
          </div>
        </div>

        <div class="col-md-4 col-sm-12">
          <div class="card p-1 dark-theme">
            <div class="card-body">
              <h6>What is Lorem Ipsum?</h6>
              <ul>
                <li>Sed sit amet felis tellus.</li>
                <li>Sed sit amet felis tellus.</li>
              </ul>
            </div>
          </div>
        </div>

        <div class="col-md-4 col-sm-12">
          <div class="card p-1 dark-theme">
            <div class="card-body">
              <h6>What is Lorem Ipsum?</h6>
              <ul>
                <li>Sed sit amet felis tellus.</li>
                <li>Sed sit amet felis tellus.</li>
              </ul>
            </div>
          </div>
        </div>

      </div>
    </div>
  </section>
  <script>
    const themeBtn = document.getElementById("theme-btn");
    const darkTheme = document.querySelectorAll(".dark-theme");
    themeBtn.onclick = () => {
      themeBtn.classList.toggle("fa-sun");
      if (themeBtn.classList.contains("fa-sun")) {
        document.body.classList.add("changeTheme");
        for (const theme of darkTheme) {
          theme.style.backgroundColor = "#1D1E22";
          theme.style.color = "#eee";
        }
      } else {
        document.body.classList.remove("changeTheme");
        for (const theme of darkTheme) {
          theme.style.backgroundColor = "#eee";
          theme.style.color = "#1D1E22";
        }
      }
    }
  </script>
  </body>
</html>

The for...of loop of JavaScript applies ".dark-theme" class styling properties to each card on the page, regardless of its position. It applies the theme to all web parts selected with querySelectorAll() in the tag. Without this, the font and background color remain unchanged on toggle.

{
          theme.style.backgroundColor = "#eee";
          theme.style.color = "#1D1E22";
}

If you set background-color or any color property to the page, your dark theme would not work as expected. This is because the preset CSS style overrides the one yet to be appended. If you set the color of the HTML font to black, it stays the same in the dark theme, which you don't want. For example:

* {
  color: #000;
}

By adding this code in your CSS or in a tag, you set the font color to black for all the HTML on the page. When you toggle the theme, the font stays black, which doesn't contrast with the dark background. The same goes for the background color. This is common if you've used, for instance, Bootstrap to create the card sections in the code above. When Bootstrap is used, the styling for each card comes from Bootstrap's card.scss styling, which sets background-color to white, which is more specific than a general CSS rule for the entire page, and so it takes precedence.

You must target such cases by using a JavaScript selector and set your desired background-color or color using document.style.backgroundColor or document.style.color properties.

Dark theme with multiple web parts

Here's an example of a personal portfolio with a dark theme feature that may help you understand how to enable dark mode when you have multiple web parts.

These steps are a beginner-friendly approach to programming dark themes. Whether you target your HTML element in JavaScript by using getElementById() or getElementByClassName(), or with querySelector() or querySelectorAll(), depends on the content of your website, and how you want to program as a developer. The same is true with the selection of JavaScript if…else statements and loops. Feel free to choose your own method. As always, consider the constraints and flexibility of your programming approach. Good luck!

Learn how to program dark website themes using HTML, CSS variables, classes, and JavaScript methods.

Accessibility Programming JavaScript What to read next A practical guide to light and dark mode in Jekyll This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How to Monitor Website and Application with Uptime Kuma

Tecmint - Tue, 09/06/2022 - 11:57
The post How to Monitor Website and Application with Uptime Kuma first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Uptime Kuma is a fancy self-hosted monitoring tool that you can use to monitor websites and applications in real time. Uptime Kuma Features Monitors uptime for HTTP(s) websites, TCP Ports, and Docker containers and

The post How to Monitor Website and Application with Uptime Kuma first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Mesa Preparing Software Fallback For S3TC Texture Compression

Phoronix - Tue, 09/06/2022 - 07:16
Mesa recently landed BPTC software fallback handling that is a requirement for OpenGL 4.2 support but BPTC is not natively supported by all GPU hardware, particularly on the embedded side. That software emulation support for BPTC is similar to what already has existed within Mesa for the ASTC and ETC formats too. A merge request is pending that also adds S3TC software fallback handling, which helps out some of the smaller, embedded GPU drivers too for getting more games running that are dependent on S3 Texture Compression...

PHP 8.2 RC1 Released With Various Fixes & Improvements

Phoronix - Tue, 09/06/2022 - 04:03
After a series of alpha and beta releases over the past several months, out this past week is the first release candidate of the upcoming PHP 8.2...

Radeon RADV Driver Lands Vulkan Mesh Shader Support

Phoronix - Mon, 09/05/2022 - 21:57
Being merged a few minutes ago into Mesa 22.3 is the Radeon Vulkan driver "RADV" support for the recently ratified mesh shader extension...

Pages