opensource.com

Subscribe to opensource.com feed
Updated: 20 min 40 sec ago

Learn to code with my retro computer program

Wed, 01/04/2023 - 16:00
Learn to code with my retro computer program Jim Hall Wed, 01/04/2023 - 03:00

I teach university courses part-time, including a class about general computing topics, open to all majors. This is an introductory course that teaches students about how technology works, to remove the mystery around computing.

While not a computer science course, one section of this course covers computer programming. I usually talk about programming in very abstract terms, so I don't lose my audience. But this year, I wanted my students to do some "hands-on" programming in an "old school" way. At the same time, I wanted to keep it simple, so everyone could follow along.

I like to structure my lessons to show how you got from "there" to "here." Ideally, I would let my students learn how to write a simple program. Then I would pick it up from there to show how modern programming allows developers to create more complex programs. I decided to try an unconventional approach — teach the students about the ultimate in low-level programming: machine language.

Machine language programming

Early personal computers like the Apple II (1977), TRS-80 (1977), and IBM PC (1981) let users enter programs with a keyboard, and displayed results on a screen. But computers didn't always come with a screen and keyboard.

The Altair 8800 and IMSAI 8080 (both made in 1975) required users to enter a program using "switches and lights" on a panel. You would enter an instruction in machine language, using a bank of switches, and the machine would light up the ones and zeros of each binary instruction using LEDs.

Image by:

(Cromemco, CC BY-NC-SA 3.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 An open source developer's guide to building applications

Programming these early machines required knowing the machine language instructions, called opcodes, short for operation codes, to perform basic operations like adding two numbers or storing a value into the computer's memory. I wanted to show my students how programmers would enter a series of instructions and memory addresses by hand, using the switches and lights.

However, using an actual Altair 8800 would be too much overhead in this class. I needed something simple that any beginner-level student could grasp. Ideally, I hoped to find a simple "hobby" retro computer that worked similarly to the Altair 8800, but I couldn't find a suitable "Altair-like" device for less than $100. I found several "Altair" software emulators, but they faithfully reproduce the Altair 8800 opcodes, and that was too much for my needs.

I decided to write my own "educational" retro computer. I call it the Toy CPU. You can find it on my GitHub repository, including several releases to play with. Version 1 was an experimental prototype that ran on FreeDOS. Version 2 was an updated prototype that ran on Linux with ncurses. Version 3 is a FreeDOS program that runs in graphics mode.

Programming the Toy CPU

The Toy CPU is a very simple retro computer. Sporting only 256 bytes of memory and a minimal instruction set, the Toy CPU aims for simplicity while replicating the "switches and lights" programming model. The interface mimics the Altair 8800, with a series of eight LEDs for the counter (the "line number" for the program), instruction, accumulator (internal memory used for temporary data), and status.

When you start the Toy CPU, it simulates "booting" by clearing the memory. While the Toy CPU is starting up, it also displays INI ("initialize") in the status lights at the bottom-right of the screen. The PWR ("power") light indicates the Toy CPU has been turned on.

Image by:

(Jim Hall, CC BY-SA 4.0)

 

When the Toy CPU is ready for you to enter a program, it indicates INP ("input" mode) via the status lights, and starts you at counter 0 in the program. Programs for the Toy CPU always start at counter 0.

In "input" mode, use the up and down arrow keys to show the different program counters, and press Enter to edit the instruction at the current counter. When you enter "edit" mode, the Toy CPU shows EDT ("edit" mode) on the status lights.

Image by:

(Jim Hall, CC BY-SA 4.0)

The Toy CPU has a cheat sheet that's "taped" to the front of the display. This lists the different opcodes the Toy CPU can process:

  • 00000000 (STOP): Stop program execution.

  • 00000001 (RIGHT): Shift the bits in the accumulator to the right by one position. The value 00000010 becomes 00000001, and 00000001 becomes 00000000.

  • 00000010 (LEFT): Shift the bits in the accumulator to the left by one position. The value 01000000 becomes 10000000, and 10000000 becomes 00000000.

  • 00001111 (NOT): Binary NOT the accumulator. For example, the value 10001000 becomes 01110111.

  • 00010001 (AND): Binary AND the accumulator with the value stored at an address. The address is stored in the next counter.

  • 00010010 (OR): Binary OR the accumulator with the value stored at an address.

  • 00010011 (XOR): Binary XOR (“exclusive or”) the accumulator with the value stored at an address.

  • 00010100 (LOAD): Load (copy) the value from an address into the accumulator.

  • 00010101 (STORE): Store (copy) the value in the accumulator into an address.

  • 00010110 (ADD): Add the value stored at an address to the accumulator.

  • 00010111 (SUB): Subtract the value stored at an address from the accumulator.

  • 00011000 (GOTO): Go to (jump to) a counter address.

  • 00011001 (IFZERO): If the accumulator is zero, go to (jump to) a counter address.

  • 10000000 (NOP): No operation; safely ignored.

When in "edit" mode, use the left and right arrow keys to select a bit in the opcode, and press Space to flip the value between off (0) and on (1). When you are done editing, press Enterto go back to "input" mode.

Image by:

(Jim Hall, CC BY-SA 4.0)

A sample program

I want to explore the Toy CPU by entering a short program that adds two values, and stores the result in the Toy's memory. Effectively, this performs the arithmetic operation A+B=C. To create this program, you only need a few opcodes:

  • 00010100 (LOAD): Load (copy) the value from an address into the accumulator.

  • 00010110 (ADD): Add the value stored at an address to the accumulator.

  • 00010101 (STORE): Store (copy) the value in the accumulator into an address.

  • 00000000 (STOP): Stop program execution.

The LOAD, ADD, and STORE instructions require a memory address, which will always be in the next counter location. For example, the first two instructions of the program are:

counter 0: 00010100
counter 1: some memory address where the first value A is stored

The instruction in counter 0 is the LOAD operation, and the value in counter 1 is the memory address where you have stored some value. The two instructions together copy a value from memory into the Toy's accumulator, where you can work on the value.

Having loaded a number A into the accumulator, you need to add the value B to it. You can do that with these two instructions:

counter 2: 00010110
counter 3: a memory address where the second value B is stored

Say that you loaded the value 1 (A) into the accumulator, then added the value 3 (B) to it. The accumulator will now have the value 4. Now you need to copy the value 4 into another memory address (C) with these two instructions:

counter 4: 00010101
counter 5: a memory address (C) where we can save the new value

Having added the two values together, you can now end the program with this instruction:

counter 6: 00000000

Any instructions after counter 6 are available for the program to use as stored memory. That means you can use the memory at counter 7 for the value A, the memory in counter 8 for the value B, and the memory at counter 9 for the stored value C. You need to enter these separately into the Toy:

counter 7: 00000001 (1)
counter 8: 00000011 (3)
counter 9: 00000000 (0, will be overwritten later)

Having figured out all the instructions and the memory locations for A, B, and C, you can now enter the full program into the Toy. This program adds the values 1 and 3 to get 4:

counter 0: 00010100
counter 1: 00000111 (7)
counter 2: 00010110
counter 3: 00001000 (8)
counter 4: 00010101
counter 5: 00001001 (9)
counter 6: 00000000
counter 7: 00000001 (1)
counter 8: 00000011 (3)
counter 9: 00000000 (0, will be overwritten later)

To run the program, press the R key when in "input" mode. The Toy CPU will show RUN ("run" mode) in the status lights, and execute your program starting at counter 0.

The Toy has a significant delay built into it, so you can watch the Toy execute each step in the program. You should see the counter move from 00000000 (0) to 00000110 (6) as the program progresses. After counter 1, the program loads the value 1 from memory location 7, and the accumulator updates to 00000001 (1). After counter 3, the program will add the value 3 and update the accumulator to show 00000100 (4). The accumulator will remain that way until the program stores the value into memory location 9 after counter 5 then ends at counter 6.

Image by:

(Jim Hall, CC BY-SA 4.0)

Exploring machine language programming

You can use the Toy to create other programs and further explore machine language programming. Test your creativity by writing these programs in machine language.

A program to flash the lights on the accumulator

Can you light up the right four bits on the accumulator, then the left four bits, then all of the bits? You can write this program in one of two ways:

A straightforward approach would be to load three values from different memory addresses, like this:

counter 0: LOAD
counter 1: "right"
counter 2: LOAD
counter 3: "left"
counter 4: LOAD
counter 5: "all"
counter 6: STOP
counter 7: 00001111 ("right")
counter 8: 11110000 ("left")
counter 9: 11111111 ("all")

Another way to write this program is to experiment with the NOT and OR binary operations. This results in a smaller program:

counter 0: LOAD
counter 1: "right"
counter 2: NOT
counter 3: OR
counter 4: "right"
counter 5: STOP
counter 6: 00001111 ("right")Count down from a number

You can use the Toy as a countdown timer. This program exercises the IFZERO test, which will jump the program to a new counter only if the accumulator is zero:

counter 0: LOAD
counter 1: "initial value"
counter 2: IFZERO (this is also the "start" of the countdown)
counter 3: "end"
counter 4: SUB
counter 5: "one"
counter 6: GOTO
counter 7: "start"
counter 8: STOP
counter 9: 00000111 ("initial value")
counter 10: 00000001 ("one")

The Toy CPU is a great way to learn about machine language. I used the Toy CPU in my introductory course, and the students said they found it difficult to write the first program, but writing the next one was much easier. The students also commented that writing programs in this way was actually fun, and they learned a lot about how computers actually work. The Toy CPU is educational and fun!

I wrote an educational retro computer called the Toy CPU so that my students could learn about machine language.

Image by:

Opensource.com

Programming Education What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Create a highly available distributed database with Apache ShardingSphere

Tue, 01/03/2023 - 16:00
Create a highly available distributed database with Apache ShardingSphere zhaojinchao Tue, 01/03/2023 - 03:00

Modern business systems must be highly available, reliable, and stable in the digital age. As the cornerstone of the current business system, databases are supposed to embrace high availability.

High availability (HA) allows databases to switch services between primary and secondary database nodes. HA automatically selects a primary, picking the best node when the previous one crashes.

MySQL high availability

There are plenty of MySQL high availability options, each with pros and cons. Below are several common high availability options:

  • Orchestrator is a MySQL HA and replication topology management tool written in Go. Its advantage lies in its support for manual adjustment of the primary-secondary topology, automatic failover, and automatic or manual recovery of primary nodes through a graphical web console. However, the program needs to be deployed separately and has a steep learning curve due to its complex configurations.
  • MHA is another mature solution. It provides primary/secondary switching and failover capabilities. The good thing about it is that it can ensure the least data loss in the switching process and works with semi-synchronous and asynchronous replication frameworks. However, only the primary node is monitored after MHA starts, and MHA doesn't provide the load balancing feature for the read database.
  • MGR implements group replication based on the distributed Paxos protocol to ensure data consistency. It is an official HA component provided by MySQL, and no extra deployment program is required. Instead, users only need to install the MGR plugin on each data source node. The tool features high consistency, fault tolerance, scalability, and flexibility.
Apache ShardingSphere high availability

Apache ShardingSphere's architecture actually separates storage from computing. The storage node represents the underlying database, such as MySQL, PostgreSQL, openGauss, etc., while compute node refers to ShardingSphere-JDBC or ShardingSphere-Proxy.

Accordingly, the high availability solutions for storage nodes and compute nodes are different. Stateless compute nodes need to perceive the changes in storage nodes. They also need to set up separate load balancers and have the capabilities of service discovery and request distribution. Stateful storage nodes must provide data synchronization, connection testing, primary node election, and so on.

Although ShardingSphere doesn't provide a database with high availability, it can help users integrate database HA solutions such as primary-secondary switchover, faults discovery, traffic switching governance, and so on with the help of the database HA and through its capabilities of database discovery and dynamic perception.

When combined with the primary-secondary flow control feature in distributed scenarios, ShardingSphere can provide better high availability read/write splitting solutions. It will be easier to operate and manage ShardingSphere clusters using DistSQL's dynamic high availability adjustment rules to get primary/secondary nodes' information.

More on edge computing Understanding edge computing Why Linux is critical to edge computing eBook: Running Kubernetes on your Raspberry Pi Download now: The automated enterprise eBook eBook: A practical guide to home automation using open source tools eBook: 7 examples of automation on the edge What is edge machine learning? The latest on edge Best practices

Apache ShardingSphere adopts a plugin-oriented architecture so that you can use all its enhanced capabilities independently or together. Its high availability function is often used with read/write splitting to distribute query requests to the secondary databases according to the load balancing algorithm to ensure system HA, relieve primary database pressure, and improve business system throughput.

Note that ShardingSphere HA implementation leans on its distributed governance capability. Therefore, it can only be used under the cluster mode for the time being. Meanwhile, read/write splitting rules are revised in ShardingSphere 5.1.0. Please refer to the official documentation about read/write splitting for details.

Consider the following HA+read/write splitting configuration with ShardingSphere DistSQL RAL statements as an example. The example begins with the configuration, requirements, and initial SQL.

Configuration schemaName: database_discovery_db

dataSources:
  ds_0:
    url: jdbc:mysql://127.0.0.1:1231/demo_primary_ds?serverTimezone=UTC&useSSL=false
    username: root
    password: 123456
    connectionTimeoutMilliseconds: 3000
    idleTimeoutMilliseconds: 60000
    maxLifetimeMilliseconds: 1800000
    maxPoolSize: 50
    minPoolSize: 1
  ds_1:
    url: jdbc:mysql://127.0.0.1:1232/demo_primary_ds?serverTimezone=UTC&useSSL=false
    username: root
    password: 123456
    connectionTimeoutMilliseconds: 3000
    idleTimeoutMilliseconds: 60000
    maxLifetimeMilliseconds: 1800000
    maxPoolSize: 50
    minPoolSize: 1
  ds_2:
    url: jdbc:mysql://127.0.0.1:1233/demo_primary_ds?serverTimezone=UTC&useSSL=false
    username: root
    password: 123456
    connectionTimeoutMilliseconds: 3000
    idleTimeoutMilliseconds: 50000
    maxLifetimeMilliseconds: 1300000
    maxPoolSize: 50
    minPoolSize: 1

rules:
  - !READWRITE_SPLITTING
    dataSources:
      replication_ds:
        type: Dynamic
        props:
          auto-aware-data-source-name: mgr_replication_ds
  - !DB_DISCOVERY
    dataSources:
      mgr_replication_ds:
        dataSourceNames:
          - ds_0
          - ds_1
          - ds_2
        discoveryHeartbeatName: mgr-heartbeat
        discoveryTypeName: mgr
    discoveryHeartbeats:
      mgr-heartbeat:
        props:
          keep-alive-cron: '0/5 * * * * ?'
    discoveryTypes:
      mgr:
        type: MGR
        props:
          group-name: b13df29e-90b6-11e8-8d1b-525400fc3996Requirements
  • ShardingSphere-Proxy 5.1.0 (Cluster mode + HA + dynamic read/write splitting rule)
  • Zookeeper 3.7.0
  • MySQL MGR cluster
SQL script CREATE TABLE `t_user` (
  `id` INT(8) NOT NULL,
  `mobile` CHAR(20) NOT NULL,
  `idcard` VARCHAR(18) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

First, view the primary-secondary relationship:

mysql> SHOW READWRITE_SPLITTING RULES;
+----------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
| name           | auto_aware_data_source_name | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
+----------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
| replication_ds | mgr_replication_ds          | ds_0                   | ds_1,ds_2              | NULL               |                     |
+----------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
1 ROW IN SET (0.09 sec)

You can also look at the secondary database state:

mysql> SHOW READWRITE_SPLITTING READ RESOURCES;
+----------+---------+
| resource | STATUS  |
+----------+---------+
| ds_1     | enabled |
| ds_2     | enabled |
+----------+---------+

The results above show that the primary database is currently ds_0, while secondary databases are ds_1 and ds_2.

Next, test INSERT:

mysql> INSERT INTO t_user(id, mobile, idcard) VALUE (10000, '13718687777', '141121xxxxx');
Query OK, 1 ROW affected (0.10 sec)

View the ShardingSphere-Proxy log and see if the route node is the primary database ds_0.

[INFO ] 2022-02-28 15:28:21.495 [ShardingSphere-Command-2] ShardingSphere-SQL - Logic SQL: INSERT INTO t_user(id, mobile, idcard) value (10000, '13718687777', '141121xxxxx')
[INFO ] 2022-02-28 15:28:21.495 [ShardingSphere-Command-2] ShardingSphere-SQL - SQLStatement: MySQLInsertStatement(setAssignment=Optional.empty, onDuplicateKeyColumns=Optional.empty)
[INFO ] 2022-02-28 15:28:21.495 [ShardingSphere-Command-2] ShardingSphere-SQL - Actual SQL: ds_0 ::: INSERT INTO t_user(id, mobile, idcard) value (10000, '13718687777', '141121xxxxx')

Now test SELECT (repeat it twice):

mysql> SELECT id, mobile, idcard FROM t_user WHERE id = 10000;

View the ShardingSphere-Proxy log and see if the route node is ds_1 or ds_2.

[INFO ] 2022-02-28 15:34:07.912 [ShardingSphere-Command-4] ShardingSphere-SQL - Logic SQL: SELECT id, mobile, idcard FROM t_user WHERE id = 10000
[INFO ] 2022-02-28 15:34:07.913 [ShardingSphere-Command-4] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-02-28 15:34:07.913 [ShardingSphere-Command-4] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT id, mobile, idcard FROM t_user WHERE id = 10000
[INFO ] 2022-02-28 15:34:21.501 [ShardingSphere-Command-4] ShardingSphere-SQL - Logic SQL: SELECT id, mobile, idcard FROM t_user WHERE id = 10000
[INFO ] 2022-02-28 15:34:21.502 [ShardingSphere-Command-4] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-02-28 15:34:21.502 [ShardingSphere-Command-4] ShardingSphere-SQL - Actual SQL: ds_2 ::: SELECT id, mobile, idcard FROM t_user WHERE id = 10000Switch to the primary database

Close the primary database ds_0:

Image by:

(Zhao Jinchao, CC BY-SA 4.0)

View whether the primary database has changed and if the secondary database state is correct through DistSQL:

[INFO ] 2022-02-28 15:34:07.912 [ShardingSphere-Command-4] ShardingSphere-SQL - Logic SQL: SELECT id, mobile, idcard FROM t_user WHERE id = 10000
[INFO ] 2022-02-28 15:34:07.913 [ShardingSphere-Command-4] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-02-28 15:34:07.913 [ShardingSphere-Command-4] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT id, mobile, idcard FROM t_user WHERE id = 10000
[INFO ] 2022-02-28 15:34:21.501 [ShardingSphere-Command-4] ShardingSphere-SQL - Logic SQL: SELECT id, mobile, idcard FROM t_user WHERE id = 10000
[INFO ] 2022-02-28 15:34:21.502 [ShardingSphere-Command-4] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-02-28 15:34:21.502 [ShardingSphere-Command-4] ShardingSphere-SQL - Actual SQL: ds_2 ::: SELECT id, mobile, idcard FROM t_user WHERE id = 10000

Now, INSERT another line of data:

mysql> INSERT INTO t_user(id, mobile, idcard) VALUE (10001, '13521207777', '110xxxxx');
Query OK, 1 ROW affected (0.04 sec)

View the ShardingSphere-Proxy log and see if the route node is the primary database ds_1:

[INFO ] 2022-02-28 15:40:26.784 [ShardingSphere-Command-6] ShardingSphere-SQL - Logic SQL: INSERT INTO t_user(id, mobile, idcard) value (10001, '13521207777', '110xxxxx')
[INFO ] 2022-02-28 15:40:26.784 [ShardingSphere-Command-6] ShardingSphere-SQL - SQLStatement: MySQLInsertStatement(setAssignment=Optional.empty, onDuplicateKeyColumns=Optional.empty)
[INFO ] 2022-02-28 15:40:26.784 [ShardingSphere-Command-6] ShardingSphere-SQL - Actual SQL: ds_1 ::: INSERT INTO t_user(id, mobile, idcard) value (10001, '13521207777', '110xxxxx')

Finally, test SELECT(repeat it twice):

mysql> SELECT id, mobile, idcard FROM t_user WHERE id = 10001;

View the ShardingSphere-Proxy log and see if the route node is ds_2:

[INFO ] 2022-02-28 15:42:00.651 [ShardingSphere-Command-7] ShardingSphere-SQL - Logic SQL: SELECT id, mobile, idcard FROM t_user WHERE id = 10001
[INFO ] 2022-02-28 15:42:00.651 [ShardingSphere-Command-7] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-02-28 15:42:00.651 [ShardingSphere-Command-7] ShardingSphere-SQL - Actual SQL: ds_2 ::: SELECT id, mobile, idcard FROM t_user WHERE id = 10001
[INFO ] 2022-02-28 15:42:02.148 [ShardingSphere-Command-7] ShardingSphere-SQL - Logic SQL: SELECT id, mobile, idcard FROM t_user WHERE id = 10001
[INFO ] 2022-02-28 15:42:02.149 [ShardingSphere-Command-7] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-02-28 15:42:02.149 [ShardingSphere-Command-7] ShardingSphere-SQL - Actual SQL: ds_2 ::: SELECT id, mobile, idcard FROM t_user WHERE id = 10001Release the secondary databases Image by:

(Zhao Jinchao, CC BY-SA 4.0)

View the latest primary-secondary relationship changes through DistSQL. The state of the ds_0 node is recovered as enabled, while ds_0 is integrated to read_data_source_names:

mysql> SHOW READWRITE_SPLITTING RULES;
+----------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
| name           | auto_aware_data_source_name | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
+----------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
| replication_ds | mgr_replication_ds          | ds_1                   | ds_0,ds_2              | NULL               |                     |
+----------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
1 ROW IN SET (0.01 sec)

mysql> SHOW READWRITE_SPLITTING READ RESOURCES;
+----------+---------+
| resource | STATUS  |
+----------+---------+
| ds_0     | enabled |
| ds_2     | enabled |
+----------+---------+
2 ROWS IN SET (0.00 sec)Wrap up

Database high availability is critical in today's business environments, and Apache ShardingSphere can help provide the necessary reliability. Based on the above example, you now know more about ShardingSphere's high availability and dynamic read/write splitting. Use this example as the basis for your own configurations. 

Follow this example of ShardingSphere's high availability and dynamic read/write splitting as the basis for your own configurations. 

Image by:

Jason Baker. CC BY-SA 4.0.

Databases What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Document with BookStack, an open source Confluence alternative

Tue, 01/03/2023 - 16:00
Document with BookStack, an open source Confluence alternative ssddanbrown Tue, 01/03/2023 - 03:00

BookStack is an open source, web-based documentation system, that allows you to create a structured knowledge store for personal, team, or company use. BookStack focuses on ease-of-use and design to provide an experience suitable for an audience with, potentially, mixed skills in technology. It's built upon the PHP framework Laravel, with MySQL or MariaDB used as a datastore.

I built BookStack after attempting to find a documentation or wiki system for my workplace. Confluence was the closest option to suit my requirements but the user-based pricing introduced a barrier. The closed nature of Confluence also raised questions to the longevity of the documentation I'd be building. In the end, I decided to build my own platform to suit my needs. I released it under the MIT license to give back to the open source community that I'd come to love and benefit from over the years.

Content hierarchy and organization options

To keep things familiar and intuitive, BookStack makes use of real-world book terms to describe its organization structure. Documentation content is created as a "Page":

  • Pages belong to a specific "Book".
  • Within a Book, Pages can optionally be grouped up into "Chapters".
  • As your documentation grows, you can then use "Shelves" to categorize Books, with Books being able to be part of multiple shelves if needed.

This structure sits at the heart of BookStack, and can often be the love-it-or-hate-it deciding aspect of whether BookStack is suitable for your use case.

Image by:

(Dan Brown, CC BY-SA 4.0)

More open source alternatives Open source project management tools Trello alternatives Linux video editors Open source alternatives to Photoshop List of open source alternatives Latest articles about open source alternatives

Upon this core hierarchy, BookStack also provides tagging, user favorites, and advanced search capabilities to ensure content remains discoverable.

Writing documentation

The primary method of writing documentation in BookStack is through the use of its what-you-see-is-what-you-get (WYSIWYG) editor, which makes use of the open source Tiny project. This editor provides a range of content formats including:

  • Various header levels
  • Code blocks
  • Collapsible blocks
  • Tables
  • Images
  • Links
  • iFrame embeds
  • Alert callouts
  • Bullet, numbered and tasks lists
  • Drawings (through intregration with the open source diagrams.net)
Image by:

(Dan Brown, CC BY-SA 4.0)

If you prefer Markdown, you can use the built-in Markdown editor, which provides a live preview and supports the same feature set as the WYSIWYG editor. If permission allows, you can even jump between these editor options depending on the page you're editing.

How your data is stored

Documentation is stored within a MySQL or MariaDB database in a relatively simple HTML format, in addition to the original Markdown content if Markdown was used. A lot of design and development decisions have been made to keep this HTML format simplistic. It uses plain standard HTML elements where possible, to ensure raw documentation content remains open and portable.

Uploaded images, attachments, and created drawings are saved on the local filesystem but can optionally be stored in an s3-compatible datastore like the open source MinIO.

To keep your content accessible, there are built-in options to export content as PDF, HTML, plain text, or Markdown. For external consumption, there's a HTTP REST API and a webhook system. In terms of extension, a "logical theme system" allows running of custom PHP code upon a wide range of system events.

Ready for business

BookStack comes with a range of features to support business environments. Support for a range of authentication options are built-in, including SAML2, OpenID Connect, and LDAP allowing easy single-sign-on usage with platforms such as KeyCloak. MFA options are available and can be mandated based upon role. An audit log provides full visibility of modification activities across an instance.

Image by:

(Dan Brown, CC BY-SA 4.0)

A full role-based permission system provides administrators full control over create, view, update, and delete actions of system content. This allows per-role system defaults, with options to set custom permissions on a per-hierarchy item basis.

A community of support

After being active for over 7 years, the community for BookStack has grown with various avenues for discussion and support. We now have:

If you want to play with BookStack, you can try it out on our demo site. To learn how to set up your own instance, visit the installation page of our documentation.

BookStack is an open source, web-based documentation system, that allows you to create a structured knowledge store for personal, team, or company use.

Image by:

Opensource.com

Alternatives Documentation Business What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

7 Git articles every open source practitioner should read

Mon, 01/02/2023 - 16:00
7 Git articles every open source practitioner should read AmyJune Mon, 01/02/2023 - 03:00

Understanding the Git version control system is foundational for many open source practitioners. Whether you are an advanced user or you want 2023 be the year to get started, Opensource.com has plenty of resources for you. Here are a few recent Git articles that I recommend:

The first in a series by Dwayne McDaniels, Git concepts in less than 10 minutes, assures us that, yes, Git can seem intimidating, but knowing and understanding the basic building blocks can break down the barriers. Six basic commands and concepts are explained so you can move on to more advanced Git tools and commands.

5 Git configurations I make on Linux by Alan Formy-Duval is a straightforward guide to getting started working with Git on Linux. There are so many configuration options, and Alan suggests starting with global configuration to help make set up easier every time.

How to rename a branch, delete a branch, and find the author of a branch in Git is a straightforward article about the most common commands around Git branching.

If you tend to misuse Git or write many Git hooks like author Seth Kenlon, bringing the Git subcommand rev-parse into your bag of tricks may be a good option. Peek inside your Git repo with rev-parse reminds you that if you do scripting with Git, you need information about the Git repository. Using the rev-parse subcommand is one way to find what you're looking for.

In Evan “Hippy” Slatis’s article, How I use the Git for-each-ref command for DevOps, Evan explains that Git can be used not only to capture history across files, but also to capture metadata. The article includes a pragmatic example of how the for-each-ref command is used to discover where a bug was introduced into the repository.

More on Git What is Git? Git cheat sheet Markdown cheat sheet New Git articles

This fun article was crowdsourced from Opensource.com's writer’s list. Happy anniversary, Git! Here are our favorite Git commands has some Git fan favorites along with some new ones that everyone is sure to appreciate and enjoy.

In Seth Kenlon’s article, Make your own Git subcommands, Seth demonstrates how to make your own Git command using custom scripts. It’s easier than it might at first seem, and it’s a great way for intermediate or advanced users of Git to extend Git’s capabilities based on their own requirements.

Get started with Git in 2023 with these helpful articles.

Image by:

Opensource.com

Best of Opensource.com Git What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How to read and write files in Rust

Mon, 01/02/2023 - 16:00
How to read and write files in Rust hANSIc99 Mon, 01/02/2023 - 03:00

Knowing how to read and write files can be useful for various purposes. In Rust, this task is done using the file system module (std::fs) in the standard library. In this article, I'll give you an overview on how to use this module.

To demonstrate this task, I prepared example code which is also available on GitHub.

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 An open source developer's guide to building applications Preparation

When using Rust, a function that fails returns the Result type. The file system module in particular returns the specialized type std::io::Result. With this knowledge, you can return the same type from the main() function:

fn  main() ->  std::io::Result<()> {
/* ...code comes here... */Writing Rust files

Performing file I/O-operations in Rust is relatively easy. Writing to a file can be simplified to one line:

use  std::fs;
fs::write("favorite_websites.txt", b"opensource.com")?;
Ok(())

Using the error propagation operator (?), the error information gets passed on to the calling function where the error can subsequently be handled. As main() is the only other function in the call stack, the error information gets passed on to the console output in case the write operation failed.

The syntax of the fs::write function is quite forward. The first argument is the file path, which must be the type std::path::Path. The second argument is the content, which is actually a slice of bytes ([u8]). Rust converts the arguments passed into the correct type. Luckily, these types are basically the only types dealt with in the following examples.

A more concise access of the write operation can be achieved using the file descriptor type std::fs::File:

let mut file = fs::File::create("favorite_websites.txt")?;
file.write_all(b"opensource.com\n")?;
Ok(())

As the file type implements the Write trait, it is possible to use the associated methods to write to the file. However, the create method can overwrite an already existing file.

To get even more control of the file descriptor, the type std::fs::OpenOptions must be used. This provides opening modes similar to the ones in other languages:

let mut file = fs::OpenOptions::new()
                            .append(true)
                            .open("favorite_websites.txt")?;
                           
file.write_all(b"sourceforge.net\n")?;Reading Rust files

What applies to writing also applies to reading. Reading can also be done with a simple one-line of code:

let websites = fs::read_to_string("favorite_websites.txt")?;

The above line reads the content of the file and returns a string. In addition to reading a string, there is also the std::fs::read function which reads the data into a vector of bytes if the file contains binary data.

The next example shows how to read the content of the file into memory and subsequently print it line by line to a console:

let file = fs::File::open("favorite_websites.txt")?;
let lines = io::BufReader::new(file).lines();

for line in lines {
    if let Ok(_line) = line {
        println!(">>> {}", _line);
    }
}Summary

If you are already familiar with other programming languages, you may have noticed that there is no close-function (or something similar) that releases the file handle. In Rust, the file handle is released as soon as the related variable goes out of scope. To define the closing behavior, a scope ({ }) around the file representation can be applied. I recommend that you get familiar with Read and Write trait as you can find this trait implemented in many other types.

Follow along with this demo to learn how to use the file system module in Rust.

Image by:

Opensource.com

Rust Programming What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

What to write about on Opensource.com in 2023

Sun, 01/01/2023 - 16:00
What to write about on Opensource.com in 2023 AmyJune Sun, 01/01/2023 - 03:00

As we start 2023, it’s the perfect time to reflect on what the last few years have brought to us. The pandemic has brought us closer together globally. Conferences and meetings moved to virtual platforms lowering the geographic barrier to participating and collaborating. Many of us moved to remote work and embraced asynchronous communication with our teams. We have met people across the globe whom we would have never had the privilege to meet.

Open source helped forge the way for inclusive platforms and really helped to create that world stage.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Sowing the seeds of open source

Much like our unofficial logo, the dandelion, we are looking to spread the seeds of open source. We can blow the seeds organically like the wind, but also intentionally by blowing the seeds in a deliberate direction. We welcome articles about open source, open culture, and open practice from all open source practitioners.

Popular writing topics for 2023

Our readers continue to be interested in stories about open source. They love to know about the hows, the whys, and what solutions open source can bring to their lives.

We foresee some of these as being popular topics for 2023:

Along with all of those brilliant topics, I’d also love to broaden the scope of topics to also include:

  • Open hardware
  • PHP
  • Accessibility in digital assets
  • What do you love the most about open source?
  • How are you addressing DEI?
  • And, of course, we’d love to hear about your favorite open source project.
End-of-year 2022 stats

2022 was a year of growth and change in many ways. Here are our year-end stats at a glance:

  • 1.5 million monthly readers
  • More than 500 articles published
  • 117 new authors
  • 17 correspondents
  • 18 authors inducted into the Contributor Club
Writing resources

Style guide

How to write about open source

Best of series

Happy New Year. Make 2023 the year to share your open source story.

Image by:

Original photo by jetheriot. Modified by Rikki Endsley. CC BY-SA 2.0.

Community management Opensource.com community What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

6 articles to get you excited about programming

Sun, 01/01/2023 - 16:00
6 articles to get you excited about programming Jim Hall Sun, 01/01/2023 - 03:00

Programming is at the heart of open source software. Learning programming is a great way to explore new ideas and create programs that are useful for you. This year, Opensource.com authors shared many excellent articles about programming, from how new programmers can get started, to how experts can learn more about the details. Here are six articles to get you excited about programming:

Write documentation like you develop code

For many programmers, writing documentation is almost an afterthought. We've written the code, but writing the documentation is a whole new challenge. Lorna Mitchell shares several tips to help you change your approach to writing documentation. If you focus on writing documentation like you would write code, you'll have an easier time. Think about text formats, source control, pull requests, review cycles, and continuous integration and deployment.

Guide to GCC

You write the code, click a button in your development environment to build it, and you're done. But there's a lot more happening behind the scenes. Jayashree Huttanagoudar wrote an excellent explanation of what it takes for the compiler to produce a binary file. The article walks through the steps to turn source code into an executable program using the GNU C Compiler, including pre-processing, compiling, assembling, and linking.

If you like that article and want to learn more about the internals of how programs get built, you should also read Jayashree's follow-up article about How dynamic linking for modular libraries works on Linux.

Parsing data with strtok in C

Some programs can process an entire file at once, but other programs need to examine the file line-by-line. In the latter case, you likely need to parse data in each line. Fortunately, the C programming language has a standard C library function to do just that. I write about how to use the strtok function in C to parse data out of strings. Use it in your next project to simplify how you read data into your program.

Learn Perl

Perl is a powerful programming language. Sometimes considered merely a scripting system, Perl also provides object oriented programming. It also comes backed by thousands of libraries and frameworks to help you build more complex applications. Seth Kenlon and Dave Morriss shared an overview to help you get started, and created a cheat sheet that serves as a handy programmer's reference.

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 An open source developer's guide to building applications Practical advice for new programmers

If you're getting started in learning how to write your own programs, Sachin Samal wrote an excellent article to help you get started. Don't be afraid to experiment with new ideas and to keep practicing by writing new programs. Being an efficient and curious problem-solver will help you succeed as a programmer.

10 universal steps for open source code review

Working in open source software projects means working with other developers from around the world. Open source work isn't all programming. Developers also review code from other contributors. Martin Kopec wrote about his perspective in how to perform a code review. He also includes a few useful tips about what to look for, and questions to ask yourself when doing the review.

Write code

Programming is hard work, but it's also a lot of fun. Read up on a new library, a new language, or a new technique, and then go and put it into practice. And of course, make it open source!

Whether you're just learning, returning from some time away, or a long-time expert, it's time to write some code.

Image by:

opensource.com

Programming Best of Opensource.com What to read next Learn JavaScript: 6 tutorials Learn the Lisp programming language in 2021 C++ std::cout cheat sheet This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

12 resources for open source community management in 2023

Sat, 12/31/2022 - 16:00
12 resources for open source community management in 2023 AmyJune Sat, 12/31/2022 - 03:00

Open source projects thrive because of their communities. It makes sense that community management is a big topic on Opensource.com. This year, we had several good articles looking at different aspects of communities and how they’re started, protected, and nurtured.

Why program management matters in open source

In this article by Ben Cotton, he reminds you that as community projects grow and become more complex with multiple product owners and contributors, so does the need for a program manager. Open communication about deliverables, expectations, and road maps is important to help keep the goal and intentions focused. There are always spaces for collaboration and discussion, and the program manager can help the community avoid surprises.

Create a more diverse and equitable open source project with open standards

In Paloma Oliveira's article, you are reminded that using the concept of open standards in projects will lead to better communication. Open standards help build communication between the creators and the end users. They can also serve as an accessible entry point for new contributors. The use of clear communication helps folks feel welcome, want to start contributing, and can attract more diverse contributors to your project.

Build an open source project using this essential advice

Bolaji Ayodeji's article outlines the lifecycle of an open source project and provides tips on how to structure the project for sustainability. A project can be broken into two main parts: people and their roles and documents to help set collaboration standards. The article concludes with Ayodeji's 13 phases of an open source project and how you can use the list as a starting point for creating your project.

Attract contributors to your open source project with authenticity

There are plenty of great open source projects, but how do you make people aware of your project and attract contributors? Rizel Scarlett's article outlines seven avenues to promote a project without feeling "marketing-y." There is also advice about ensuring the project is easy to find, use, and contribute to. Even if the project lacks momentum, remember to keep contributing because people are drawn to an active project.

Put Design Thinking into practice with the Open Practice Library

This article is a collaborative piece by Leigh Griffin, Stefan Mattejiet, and Aoife Moloney. It's the first in a series of articles that introduces the concept of Design Thinking and how you can achieve it through the Open Practice Library (OPL), a resource for open source practitioners. All humans learn in different ways. Design Thinking breaks down different learning styles and ensures that people's needs are met. It also demonstrates that they can be successful in a team.

Build community engagement by serving up Lean Coffee

This article by 2022 Aaron Winborn Award Winner Angie Byron outlines how folks can incorporate Lean Coffee into their organizations. This allows for more collaborative meetings through remote team building and asynchronous topic discussion. Lean Coffee allows co-workers or collaborators to get to know each other, engage, find common interests, and ultimately learn from each other.

5 levels of transparency for open source communities

This article by Georg Link, Anirudha Jadhav, and Emilio Galeano Gryciuk visits why you need transparency in open source communities. When maintainers, collaborators, and end users trust one another, it creates a space where people can message and have discussions in the open. Transparency helps avoid friction, allows metrics to be exchanged for product owner buy-in, and encourages trust when people know what exact metrics are shared.

A guide to productivity management in open source projects

Thabang Mashologu's article stresses the importance of openness, transparency, and putting them into practice. Thabang encourages collaboration and productivity on open source teams through the SPACE model: satisfaction and well-being, performance, activity, communication and collaboration, and efficiency and flow.

Balancing transparency as an open source community manager

This article uses a gardening metaphor to help explain open source cultivation. Rich Bowen says that a community manager is much like a community gardener. Sometimes community managers have upstream and insider information that cannot be disclosed to other contributors. But helping keep the "garden" tended, watered, and free of weeds can help cultivate a trusting community.

How we track the community health of our open source project

The use of CRM Savannah has helped some communities track different aspects of community metrics. Ruth Cheesley's article explains how the CRM allows the Mautic community to collect and store information in a central place. Not only can the CRM track where the contributions are happening, but it also tracks community contributions over time. Unlike many tools using Savannah, the Mautic community can highlight the folks who empower others before they contribute. This practice often encourages novices to make contributions in the future.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Open source events: 4 goals to set and how to measure them

In this collaborative piece by Shaun McCance, Neofytos Kolokotronis, Georg Link, Sri Ramkrishna, and Nuritzi Sanchez, you learn that while you can have successful events, it's essential to understand what makes an event successful. Several goals are identified so quantifiable metrics can be measured. There are four goals: Retain and attract contributors, have engaging events, understand company contributions, and address diversity and skill gaps.

How to make community recognition more inclusive

This article by Ray Paik is a good reminder of how you should look beyond metrics when giving recognition in communities. Metrics are great for code contributions and providing numbers for the product owner's buy-in. But they often leave out meaningful contributions beyond code (documentation, design, ideation, and so on), which can leave contributors feeling left behind. When communities make recognition more meaningful and impactful, it helps build community trust, leading to more community engagement.

Open communities

Open source is a community project. It never happens in a vacuum, and it grows because of the communities that form around it. Whether you interact with open source as a user, contributor or both, you're part of a community, and the community is better for it.

Seasoned open source community managers share their advice on how communities are started, protected, and nurtured.

Image by:

Opensource.com

Best of Opensource.com Community management What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

5 ways to bring open source to your job

Fri, 12/30/2022 - 16:00
5 ways to bring open source to your job Jim Hall Fri, 12/30/2022 - 03:00

Open source drives businesses and organizations around the world. This year, Opensource.com authors published several outstanding articles about open source at work. Topics ranged from contributing to open source, to mentoring, and productivity. Here are five of my favorite articles about how open source can help your career and organization.

7 strategies for success

I love reading stories about how people discovered open source software, and where that journey took them. I loved reading Trishna's article about discovering Linux, contributing to open source, and landing a job working with open source. Trishna describes seven key tips about working in open source, including building connections, collaborating, and maintaining transparency.

From user to contributor to CTO

Another great article that describes someone's experience with open source software is Jesse White's article. The possibilities are endless for anyone thinking about a career in open source. Jesse's article describes one example. From working as a network analyst, to contributing to OpenNMS and Google's Summer of Code Program, and eventually rising to Chief Technology Officer, this is an inspiring story. Simply put, it is about how working in and contributing to open source software helps us grow professionally, not just technically.

Productivity management

Open source is one of the most important technology trends of our time. Thabang Mashologu writes in his article about a productivity framework called SPACE that can help support collaboration and enhance participation among community members. SPACE stands for the five steps:

  1. Satisfaction and well-being
  2. Performance
  3. Activity
  4. Communication and collaboration
  5. Efficiency and flow

Thabang also shares some sample metrics to illustrate how the SPACE framework can be used for an open source project.

More open source career advice Open source cheat sheets Linux starter kit for developers 7 questions sysadmins should ask a potential employer before taking a job Resources for IT artchitects Cheat sheet: IT job interviews Mentoring as a power multiplier

Many enterprises leverage coaching and mentoring to help boost their teams. Mentoring helps staff to see the bigger picture, or to develop new skills. Mentoring is also a power multiplier in open source projects. Josh Salomon highlights in this article his experience mentoring students at a university. It also describes how they can apply to mentorship opportunities in open source software. A successful project with a positive experience for the mentees can lead to additional engagements in open source communities. New members who receive some kind of mentorship are more likely to stick with the open source project and make more meaningful contributions.

Secrets of making self-organized teams work

Managers and executives are in the business of managing people and resources. Managers usually carry an expectation that all organizations require hierarchy to remain productive. But that's not the way the open source world works. Open source communities are self-organizing teams. With a healthy community and a shared vision, self-organizing teams can outperform expectations. As Kelsea Zhang writes in his article, whether you work in open source or elsewhere, building self-organizing teams requires time and effort. But ultimately you can build stronger teams of individuals.

Don't leave open source at home or in the data centers. Bring it to work and change the course of your career.

Best of Opensource.com Business Work from home What to read next How innovative Open Organization charts work in practice 3 practical tips for agile transformation This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How open source provides accessibility for the neurodivergent community

Thu, 12/29/2022 - 16:00
How open source provides accessibility for the neurodivergent community AmyJune Thu, 12/29/2022 - 03:00

Not everyone uses the internet or digital assets in the same way. When some people think about accessibility, they only think of people with physical disabilities, which accounts for a portion of disabilities worldwide. According to the National Cancer Institute, 15-20% of people live with neurodivergence. This includes:

  • Autism
  • Attention-deficit hyperactivity disorder (ADHD).
  • Dyslexia
  • Dyscalculia
  • Dysgraphia
  • Mental health conditions like bipolar disorder, obsessive-compulsive disorder, and more

We published some great articles in 2022 about how to include folks who live with neurodiversity. Here are my top picks.

Light and dark modes

Light sensitivity is common in people who are autistic, as well as folks who just had their eyes dilated or have a migraine. There are two articles from 2022 that support the configurability of light and dark modes.

In Ayush Sharma's A practical guide to light and dark mode in Jekyll, you walk through how to tighten up HTML and then utilize CSS and Sass to create classes. Once you consolidate your styles, you can reuse them, define the new styles, and apply them to the HTML elements. Lastly, you can add a toggle so folks can easily switch modes.

A beginner's guide to making a dark theme for a website by Sachin Samal introduces a beginner-friendly way of programming a dark theme. Samal gives you practical code examples of how icons can be inserted and how to toggle between themes. It reminds you that you can utilize your browser inspector to play around with styling.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Learning difficulties

Amar Gandhi's 3 open source tools for people with learning difficulties outlines a few tools he uses to customize how he views and uses open source tools. NextCloud can be used on any device and can serve as a progressive web app (PWA). It also uses a dashboard so you can view everything at once. Photoprism can be used as a gallery and for storage. It is similar to NextCloud because you can use it as a PWA. This allows you to access any of your photos from any device. The last tool highlighted is the OpenDyslexic font which can help prevent confusion between letters (b and d, for example) through flipping and swapping.

My open source journey with C from a neurodiverse perspective is a memoir of Rikard Grossman-Nielsen's road to programming. As he moved from a student to a teacher, he realized that everyone learns to program differently. Addressing neurodivergent students, he recommends one way to learn C is to build games. But in the big scheme of how to learn, you should find what you're passionate about. You should also find what learning methods work for you. This will help you discover what works for you in the learning process.

Open source for neurodiversity

Open source software is an excellent resource for everyone including those on the neurodivergent spectrum. There are many programs available to help minimize the impact of symptoms that many people suffer from. If you're looking for a program that might help reduce your migraines or any other issue try looking into what open source software has to offer!

Here are four examples of how open source creates a more accessible environment for those on the neurodivergent spectrum.

Image by:

Opensource.com

Best of Opensource.com Accessibility Diversity and inclusion What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

11 tips for writing a good Git commit message

Wed, 12/28/2022 - 16:00
11 tips for writing a good Git commit message AmyJune Wed, 12/28/2022 - 03:00

Lately, I have been paying closer attention to the changelogs I get from products and services when updates are needed. Here are some examples:

  • Fixed some bugs. 
  • Made some accessibility improvements. 
  • We've made improvements and fixed bugs for a smoother ride.

When I think about some of the first commit messages I made as a junior developer I have to hang my head in dismay:

  • Pointed and clicked around a bit and now things seem to work.
  • Did what programmer X told me to do and now the banner is blue.

This can be frustrating! I asked our community of contributors the following questions:

  • What makes a good Git commit message?
  • What makes a bad one?
  • What rules do you think a project should have around what a commit message contains?

Here are their answers:

Great writing is key

As with anything you write, you should think about who is going to read it. Then adapt the amount and depth of information accordingly.

Improving your natural language and writing skills is essential for a healthy career in software development. It's not just code that counts.

Camilla Conte

Be descriptive and don't assume

I spend a lot of my time collaborating in the OpenStack community, and its code reviewers have some fairly exacting standards compared to what I see from other projects "in the wild."

I'll often spend far longer composing a solid commit message than I do writing the actual code implementation or fix. Sometimes commit messages can end up many times longer than the diffs they're explaining.

To summarize some of the contributor guidance:

  • Describe why a change is being made, not just what is changing
  • The first commit line is the most important (like the subject line of an email)
  • Don't assume reviewers understand the original problem you're fixing
  • Don't assume the reviewer has access to external web services or the site (summarize defect reports and other relevant discussions)
  • Don't assume the code is self-evident and self-documenting (though there is no need to repeat points you also make in your code comments)
  • Don't include information only relevant to earlier revisions of the change (we expect contributors to squash revisions together and edit their commit messages accordingly).

There's a brief section on the topic in the OpenStack Contributors Guide: https://docs.openstack.org/contributors/common/git.html#commit-messages

Jeremy Stanley

Your future self will thank you

I cannot agree more with Jeremy. +1000

Jeremy said, "describe why a change is being made, not just what's changing."

Imagine you're someone else, in a faraway future, trying to work out this commit.

Put yourself in other people's shoes, as the old saying goes.

Leigh Morresi

Use the bug ID

I recommend adding the bug ID at the start of the commit message so that it's easier to track the commits at a later stage using the grep command.

For example:

$ git commit -m "BZ#19xxxxx

To come up with thoughtful commits, consider the following:

  • Why have I made these changes?
  • What effect have my changes made?
  • Why was the change needed?
  • What are the changes in reference to?

Agil Antony

Tell the whole story

I like to imagine there is a hidden prefix to every commit message that reads "By applying this."

A good commit message includes exactly what will happen and why. It is insufficient to merely have the work ticket reference because that decentralizes the information; Git is decentralized. As a software developer, I want to know why the proposed changes are being considered. What specific problem is being addressed? What alternate solutions were considered (and discarded)? What unexpected things were discovered during the creation of the changeset that influenced the current content?

There's no prize for shortest commit message. Your future self and future colleagues will appreciate you going into depth to explain the problem and why this changeset is the answer. Harness those cooking blogs where there's a five-paragraph life story. Here, however, make the problem the subject of the life story.

Lisa Seelye

But don't be overly verbose

A good git commit message contains information about what was done, and nothing else. For instance, if you needed to update the .gitignore, just say "updated .gitignore." Folks can dive into the commit itself for more details. It doesn't need to be verbose.

A bad commit message is something like, "oh crap" or "try this". Granted, I've been guilty of this, but it doesn't help anyone if they need to look at commits at a glance.

Rules are very subjective. They can differ from lead to lead and team to team. But at the very least, give some contextual information about the commit. Especially if it's a large one. No one has time to skim through 1000+ files with a heavy change history.

Miriam Goldman

Use present tense

I like project manager-styled commit messages written in present and not future terms (for example, "add" instead of "added"). However, it's usually only possible if commits are frequent. There's only so much "how did I do it" you can remember when you're faced with a deadline. Yet, well-written commits not only help collaborators, but are also helpful to the committer in recollecting history.

Chris Okpada

Don't rely on links

One thing I like to remind colleagues of is that you're not just explaining to the people who are going to decide whether to approve your commit. You're also explaining to future developers and users who have found this commit in a bisect or blame operation and are trying to understand its relevance.

If the only context supplied is a link to some external system, and that far in the future the system it links to is no longer in use or has otherwise become inaccessible to that individual, your commit message has been rendered useless and may just as well be blank.

All too often, I go digging in the Git history of some open source project, and find commit messages which are nothing more than a bug ID or a link to some company's internal and private defect tracker.

Don't be that project!

Jeremy Stanley

Clear and concise changelogs

As a release communications manager, I often read the entire release board. I also met with developers to discuss any areas that weren't clear yet. Then I tested the release early. After that, I would write a release post by sourcing the changelogs and corresponding revised or new content.

The changelogs are personal reminders for developers, but also have corresponding issues and tickets for them. You should capitalize product names appropriately, use a spell checker, be consistent with punctuation, and sentence structure. The lead developer should proofread these as well. Your customers, that are developers, are reading these. What information should they know before running the update to better serve their customers?

Courtney Robertson

More on Git What is Git? Git cheat sheet Markdown cheat sheet New Git articles Be specific

As a frequent release manager, I like messages that name the component a commit touches, and a brief description of what was changed. Also having a reference back to where the request for this work came from helps to tie fixes together long after we forgot about your clever branch name.

  • "fix fatal error" is not ideal.
  • "ISS-304: Fix fatal error in Login Access Control function for users
    with the Partner role" is better.
  • "ISS-304: Login Access Control: fix fatal error in getPartnerId()" is
    better still.

I can look at the entire relationship between a Git commit, branch, merge commit, and inspect the individual lines and files that were changed. But I don't have that kind of time in the middle of a release. I want to be able to relate back to the source of this work in the project management tool, have some idea of which components are being changed, and in what way.

Ryan Price

Make it a habit

My favorite commit that I'm guilty of is, "commit before I switch branches" because I have to work on something else more urgent. Sometimes, I need to commit my current work to a totally different project. My manager's strategy is to have us work as we normally do. But then when we rebase, he wants us to squash commits where it makes sense and write better messages. I can't say we always do this, but his method does make sense.

I have a lot of "this is broken don't know why" type messages too (haha) where I try things but want to commit that attempt before I try something else in case method A was closer to fixing the issue than method B. Writing code is a hot mess. And I've been writing it for over 10 years.

RachieVee

What commit message advice or tips do you live by? Let us know in the comments.

I asked our community of open source practitioners to share their advice for writing helpful Git commit messages.

Image by:

CC BY 3.0 US Mapbox Uncharted ERG

Opensource.com community Git What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. 49 points Milan, Italy

I'm a Software Engineer at Red Hat, working on CI/CD and Automation with cloud-native open-source technologies.

Open Enthusiast Author 232 points Kill Devil Hills, NC, USA

A long-time computer hobbyist and technology generalist, Jeremy Stanley has worked as a Unix and GNU/Linux sysadmin for nearly three decades focusing on information security, Internet services, and data center automation. He’s a root administrator for the OpenDev Collaboratory, a maintainer of the Zuul project, and serves on the OpenStack vulnerability management team. Living on a small island in the Atlantic, in his spare time he writes free software, hacks on open hardware projects and embedded platforms, restores old video game systems, and enjoys articles on math theory and cosmology.

Open Minded People's Choice Award Author 149 points India

I have more than 5 years of experience as a technical writer that specialises in producing accurate, clear, and concise documentation for software products. I have the ability to communicate technical ideas to a variety of audiences, including developers, engineers, and end users. Skilled in using a range of authoring tools, project management applications, and content management systems to produce and maintain technical documentation.

In addition to my technical proficiency, I also possess good interpersonal and communication abilities, which enable me to effectively engage with subject matter experts as well as cross-functional teams. Exceptionally organised and detail-oriented, with a passion for writing excellent documentation that aids users in comprehending and utilising sophisticated software products.

Open Minded Author Contributor Club 77 points Ottawa, Ontario, Canada

Miriam is a technical lead on the WordPress team at Kanopi Studios. She is a full-stack developer, leaning more toward the back end. She loves problem-solving, diving deep into plugin development, and mentoring junior developers.

Miriam is also heavily involved in the WordPress community, speaking and organizing WordCamps and local Ottawa meetups.

Open Enthusiast Contributor Club 62 points

Leigh is a long time open-source enthusiast, started nerding out with Linux kernel 2.0 and dial-up bulletin boards, can often be found hacking on useful code as well as being a product owner and entrepreneur.

Enjoys creating software that is used by people to solve real problems.

Always time for interesting and inspiring projects, feel free to each out - dgtlmoon@gmail.com

| Connect leighmorresi Open Enthusiast Author 16 points Community Member 31 points Chambersburg, PA

Courtney is a Web Designer and Developer Advocate, WordPress Training Team co-rep, and sponsored by GoDaddy Pro. Courtney has instructed WordPress and web development in career-technical high-schools, front-end bootcamps, and adult education. She began using open source in 1999 and contributing to WordPress in 2009.

| Follow courtneyr_dev | Connect courtneyr-dev Open Enthusiast 46 points Portland, OR

Drupal, woodworking, podcasting, community building, photowalking, coworking, beer, hugs, gardening, eating local.

Solutions Consultant for FFW.

Podcast Co-host for DrupalEasy Podcast.

Serial mentor. Meetup organizer. Conference volunteer/organizer.

| Follow liberatr Open Enthusiast DevOps Drupal Maker PHP Web developer Community Manager 31 points

I’m a WordPress developer who has a keen interest in accessibility. #a11y I’m also a technical writer and I share my WordPress and coding experiences on my blog.

| Follow rachelrvasquez Open Enthusiast 115 points

Lisa is a long time Linux user, former Gentoo developer (2003-2007). She is a lifelong gamer, which lead her to spend time in the video game industry and write one of the early API libraries for Eve Online (a video game involving the serious business of Internet space ships). Melding her experience as a long-time Linux systems administrator with software development experience, she is a Senior Site Reliability Engineer at Red Hat, focusing her time on OpenShift Dedicated (a hosted Kubernetes offering).

When not playing video games or tending the needs of her tuxedo cat Clyde, Lisa might be found playing Magic: the Gathering or tinkering with her ARM64 pet Kubernetes cluster, more of which can be read at https://lisa.dev.

| Follow thedoh Open Minded DevOps Cloud Gamer Linux Maker SysAdmin Developer Docker Author Contributor Club Register or Login to post a comment.

5 open source ideas for being more inclusive through accessibility

Wed, 12/28/2022 - 16:00
5 open source ideas for being more inclusive through accessibility AmyJune Wed, 12/28/2022 - 03:00

As the internet opens the planet into a world stage, inclusion should be at the forefront of how we design, build, and implement our ideas. With 15% of people self-identifying as disabled worldwide, that is far too many people to leave behind due to lack of accessibility. This includes permanent, temporary, episodic, and situational disabilities.

In 2022, we published some great articles about making digital assets more accessible. Here are a few of the top picks.

Accessibility settings in open source tools

In How I use Linux accessibility settings, Don Watkins outlines a few ways different Linux distros support settings for vision, hearing, and typing. There are also links to Linux distributions that meet some specific needs of users.

Another article by Don Watkins, 5 ways LibreOffice supports accessibility, reviews a few accessibility features in LibreOffice that increase usability for everyone. Included in the article are common shortcuts you can learn and how to use the tools without a mouse. There is also a section that outlines more accessibility settings using the tool menu.

Open source screenreaders and voice to text

DeepSpeech is a voice-to-text command and library for developers who want to add voice input to their applications. It can also benefit people who live with low vision, limited mobility, and situational disabilities that keep their hands busy. Use Mozilla DeepSpeech to enable speech to text in your application by Seth Kenlon goes into how to download and install this tool. It also gives some pragmatic examples of how the tool can be used.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources

Use this open source screen reader on Windows really goes into detail about how to use the NVDA screen reader. Peter Cheer moves from why he likes this particular screen reader to how to install the software. Because NVDA is free and open source, it is an excellent tool for testing website accessibility once you have full command of how a native user might use it.

Vojtech Polasek is a blind software engineer focusing on computer security and accessibility for blind users. In his article, Remixing Linux for blind and visually impaired users, Vojtech writes about his challenges accessing digital assets and outlines his assistive technology stack. Since he is a Linux user, he set out with his team to develop the Vojtux project, a remix of Fedora that increases usability for visually impaired and blind users.

Accessibility for the future

It is amazing how far along technology has come over the years to provide software that allows for equal accessibility. One can only hope that tech will continue improving in this direction. Keep an eye out for more articles about this very topic on Opensource.com!

Open source tools and principles pave the way for improved accessibility in technology.

Image by:

Opensource.com

Best of Opensource.com Accessibility Diversity and inclusion What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

6 articles to inspire open source sustainability in 2023

Tue, 12/27/2022 - 16:00
6 articles to inspire open source sustainability in 2023 jehb Tue, 12/27/2022 - 03:00

The scientific community builds upon open access and open information. Recalling the famous quote in a 1675 letter by Isaac Newton: "if I have seen further [than others], it is by standing on the shoulders of giants." The scientific community has built our collective knowledge of the world around us on the information shared by those who came before us, and that is still the case today.

Looking back at the past year examining open source science and sustainability here on Opensource.com, many of the top articles on this topic touched on aspects of climate change. And that’s a good thing to see. We’re all in this together when solving this global problem. No one benefits when the solutions to climate change are locked up in proprietary solutions. In order to succeed, we need to spread the solutions far and wide to enable a truly global effort to fight back and save our planet.

Without further ado, here is a look back at some of the highlights from this year in science and sustainability.

Reuse old hardware with Linux

First, David Both discusses keeping old hardware alive in How Linux rescues slow computers (and the planet). In this article, David discusses how the use of Linux can extend the usable lifetime of a computer, keeping it out of landfills or recycling centers for longer. In addition, using non-proprietary hardware and avoiding non-standard parts can make it easier to find replacement parts and extend a computer's lifetime even further. These steps can help reduce the environmental impact of computers and prevent unnecessary waste.

Eco-friendly projects with open source

Next up, Lauren Pritchett takes readers through 11 open source ideas for being more eco-friendly in 2022. Here, Lauren rounds up a slew of interesting software and hardware tools. First, she shares several Raspberry Pi projects for monitoring and automating the physical environment around us, from smart thermostats to greenhouse gas trackers. Then, she explores various tools for exploring the world around us including plant identification, stargazing, and tackling litter, before finally showing how 3D printing and open source can assist in soil science.

Reduce waste in web design

So much of our days are spent in web browsers, but have you ever considered the impact of webpages themselves? Tom Greenwood shows us 5 open source tips to reduce waste in web design. From reducing unnecessary images to choosing better formats, removing autoplaying videos, and more, these tips don’t just make web pages more efficient, many times they also help keep pages faster-loading and a more pleasant overall experience for readers.

Open data for the planet

Next, straddling the dual goals of promoting a better understanding of the planet and working to keep it a liveable place, Tobias Augspurger shows 4 ways you can preserve the Earth's livability with open source. In this article, Tobias looks at various projects that can help people make use of open data and interpret it ourselves to observe our planet and the risks to its future.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Funding open source sustainability

Funding is always an important challenge for scientific research to overcome. Joshua Pearce takes a look at how The National Science Foundation bets big on open source. Through a program called Pathways to Enable Open-Source Ecosystems (PEOSE), the NSF granted $21 million this year to explore open source development. This program seeks to create new self-sustaining open source ecosystems, promoting future innovation in science and technology.

Sustainability with the Linux desktop

Can your desktop environment help promote sustainability? Seth Kenlon reports on how Linux KDE receives the first-ever eco-certification for Okular. Specifically, the Okular tool is a universal viewer that works with a slew of different file formats. By giving users control of the software they install on their computers, reducing bloat, and keeping old machines usable, KDE is putting sustainability into practice in software.

These aren’t the only articles covering sustainability and science this year. Be sure to also check out Tobias Augspurger’s How open source supports businesses' impact on climate change, Christopher Snider’s How radical transparency is transforming open source healthcare software, Hannah Smith’s How open source leads the way for sustainable technology, and Aleksandra Fedorova’s Upstream first or the path lifting property of a covering space for even more great reads.

And that’s it for the look back at the year in open source science and sustainability. Know of a great project you wish had been covered here? Let us know in the comments and consider submitting your own article.

Here are some examples of how the scientific community and open source community have worked together to improve sustainability.

Image by:

Ben Nuttall. CC BY-SA 4.0

Best of Opensource.com Sustainability Science What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

3 aspects of Rust you need to learn

Tue, 12/27/2022 - 16:00
3 aspects of Rust you need to learn Moshe Zadka Tue, 12/27/2022 - 03:00

Rust is consistently voted one of the languages people most want to learn. In 2022, Opensource.com had a few articles to help you get started.

Rust is a fairly new language, but it's grown quickly. The general excitement about it goes beyond interest in a new language to try. Rust has genuinely useful features, like the ability to allocate data to the heap (instead of the stack) using the Box data type. There's no separate garbage collection required, and you don't have to manually manage memory yourself. Additionally, the Crate.io infrastructure for library management and installation makes it easy to find and use functions contributed by the Rust community.

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 An open source developer's guide to building applications Install the toolchain

There's a lot to be excited about when looking into learning Rust, but it is a complex language and it can be intimidating. Programming is a practical discipline. To learn a language, it's not enough to read about it and ponder it. You have to use it eventually. If you're curious about Rust but haven't written any Rust code yet, then take the first step in learning Rust by installing the toolchain.

Debugging Rust

The best way to understand complicated systems is to understand how they break down. The Rust team has you covered with an example Rust application to debug.

Concurrency in Rust

Rust's "fearless concurrency" is sometimes interpreted to be about threads. This is not wrong: Rust's concurrency model does make threaded code easier to write and understand. But that's not all it can do! Another way to get concurrency is to use async code. Rust's async primitives are powerful, as Stephan Avenwedde's article Asynchronous programming in Rust makes clear.

Have you tried Rust?

Have you tried Rust yet? If not, take some time to review these articles and experiment. Let us know what you think in the comments.

Rust is a growing trend. Read these articles to keep up with one of the most exciting languages.

Image by:

Opensource.com

Rust Best of Opensource.com Programming What to read next Rust cheat sheet Introducing Rust calls to C library functions This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

10 resources for Python programmers

Mon, 12/26/2022 - 16:00
10 resources for Python programmers Moshe Zadka Mon, 12/26/2022 - 03:00

One of my favorite things about Python is that it's an actual language that's also useful as a teaching language. As in past years, Opensource.com had great articles demonstrating this in 2022.

More Python resources What is an IDE? Cheat sheet: Python 3.7 for beginners Top Python GUI frameworks Download: 7 essential PyPI libraries Red Hat Developers Latest Python articles Use Python

Python is a fun language, but it's also a powerful language. You can enjoy Python as a beginner and as a pro, so break out your favorite text editor and start exploring this dynamic and multifaceted language. And have a Pythonic 2023!

There's something for everyone in the world of Python this year.

Image by:

(David Clode, Unsplash License)

Python Best of Opensource.com Programming What to read next Using Python in VS Code and Codium Turn your Python script into a command-line application Learn Python by coding a simple game This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

5 Raspberry Pi tutorials to inspire DIY creativity

Sun, 12/25/2022 - 16:00
5 Raspberry Pi tutorials to inspire DIY creativity cherrybomb Sun, 12/25/2022 - 03:00

'Tis the season for holiday pies and tasty treats, so why not talk about every open source enthusiast's favorite hardware delight: the Raspberry Pi. This year, Opensource.com contributors put in work on how to use the Pi for all sorts of cool projects and use cases. (Did you see the one about creating your own holiday light display with ping pong balls?) From business solutions to just-for-fun projects, these articles will show you a brand new way to use the Raspberry Pi in your life.

Data logging on your Raspberry Pi

Stephan Avenwedde shows how he uses a Raspberry pi as a datalogger. In this deep dive on using your Pi with a little bit of Python, he gives some great insight on how to monitor temperatures within your Pi’s CPU. You’ll get a helpful on-demand spreadsheet on how your Pi is performing. This article also provides you with essential visuals and code to help get you started on this project and possibly help you expand further!

More on Raspberry Pi What is Raspberry Pi? eBook: Guide to Raspberry Pi Getting started with Raspberry Pi cheat sheet eBook: Running Kubernetes on your Raspberry Pi Whitepaper: Data-intensive intelligent applications in a hybrid cloud blueprint Understanding edge computing Our latest on Raspberry Pi Get students excited about math with the Raspberry Pi

Don Watkins decided to reimagine math with the Raspberry Pi to get more students interested and excited about math. He shares his story of talking to some students he is teaching in the local library. When asked about his success in math, he explains how he wasn't successful until he found the Turtle module in Python. From there, Don shows readers how to use Turtl and the mu-editor. Providing code snippets and visuals, he is able to give students an exciting entry into math with the Raspberry Pi.

Use the Raspberry Pi to power your business

Early in 2022, Giuseppe Cassibba ran this article with ideas on how to run your smart office. He dug into what it means to have a smart office and the benefits of using the Raspberry Pi to power it. Smart offices can be daunting if you are worried about the price, but the Raspberry Pi mitigates that concern. 

Run your blog on a Raspberry Pi

In this article, Martin Anderson-Clutz covers how to use Drupal and Raspberry Pi as a web server to host your personal blog. Martin writes about why he opts to host his own web server (spoiler alert: it's free), then dives into setting up the Pi, installing Drupal, and getting started with network security. 

Happy Raspberry Pi Day 2022

What better way to celebrate Pi Day than to recap all of the cool Raspberry Pi tutorials available? This article lists 22 things to do with your Raspberry Pi in 2022. Did you get to do all of them? If not, 2023 is your year! If you're looking for some home projects, check out how to make your own thermostat. Wanting to branch out to something more adventurous? Try tracking aircraft with your Pi. For the productivity chaser, try creating your own trading bot with Pythonic. Whatever it is you choose to do, these 22 project ideas will rev up your creative energy. 

Now that you have had a glimpse of all the project ideas for your Raspberry Pi, it's time to get started doing it yourself. Let 2023 be the year you contribute a tutorial to the list. 

Did you just receive a new Raspberry Pi as a gift? Or do you have a few that are collecting dust? Your search for DIY inspiration ends here with these delightful Raspberry Pi tutorials!

Image by:

Dwight Sipler on Flickr

Raspberry Pi Best of Opensource.com What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

9 resources about open source for educators and students

Sat, 12/24/2022 - 16:00
9 resources about open source for educators and students Don Watkins Sat, 12/24/2022 - 03:00

Open source provides fertile ground for innovation, not only in the cloud but in the classroom. Whether you are homeschooled, in a traditional K-12, university, someone looking to learn new skills, open source provides rich opportunities for personal and professional development. This year, Opensource.com writers provided readers with a considerable list of opportunities for continuing education regardless of where you are on the continuum.

Lack of computer science classes

Did you know that only 51% of the high schools in the United States offer courses in computer science? Only 4.7% of students are enrolled in the courses available. This statistic is telling at a time when the US News and World Report recently ranked software development as one of the best jobs in America in 2022. Candace Sheremeta provided us with a list of three open source efforts to reverse that trend in her article about open source tools to introduce students to computer science.

As computer science grows, it's important to have an understanding of what it means to be "cloud native." It's also necessary to understand the nuance of cloud native architecture. Anita Ihuman provides a beginner's guide to cloud native open source communities. This comprehensive article provides you with everything you need to know about cloud native and cloud native architecture.

Ada Lovelace day crowdsourcing

Managing editor Lauren Pritchett, invited us to celebrate Ada Lovelace day with a crowdsourced list of hands-on programming tutorials to fictional adventure novels. Opensource.com contributors shared their favorite books for programmers who are just starting out. You can start from Scratch and add to that a complete list of programming books available from NoStarch Press.  This includes my favorite book, Teach Your Kids to Code by Bryson Payne. There's also a list of three books for very young children to read about coding pioneer Ada Lovelace.

Security and interoperability

Concerns for security and interoperability have provided universities the impetus to move toward Rocket.chat for collaboration. Sara Cemazar has six compelling reasons why academia has adopted Rocket.chat. At the top of the list is how it improves hybrid and remote learning which have become mainstays of higher education. In addition it ensures complete data privacy and compliance with both FERPA in the United States, and GDPR in the EU.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Publishing in academia

Publishing is the life blood of academics and yet it's largely siloed and inordinately expensive to do. That's changing and Joshua Pearce has written about how the paradigm is changing and why open source is leading the way. Joshua writes, “Academics routinely give away their work to companies for free — and then they buy it back." Academics like Joshua have been trapped for decades in a scheme where they give away their work freely in exchange for job security. Then they pay millions of dollars a year to read our own writing. Now academics can read free, publish free, and stay on track for professional success.

Google

Google Summer of Code (GSoC) can benefit anyone at various stages of their career, including people changing careers, those who are self-taught, those returning to the workforce, and more. You might be one of those people! Stefan Miklosovic provides the details of how you can get involved in GSOC by contributing to Apache Cassandra. Start the new year by getting involved.

Open source hardware

The open source hardware field is growing exponentially with the growth of the internet of things that includes wearables, single board computers, cameras, and robotics. This year Joshua Pearce introduced readers to an amazing opportunity created by the confluence of open hardware in academia and the Sloan Foundation. Supported by fellowships worth up to $100,000 individuals will be able to tackle some of the latest issues for integrating open hardware deep into academia. If you are in the U.S. and interested in one of the eight Fellowships, check out the Request for Proposals here!

Education and open source

It is stunning how many opportunities open source projects give people to learn and improve themselves. Education can be costly but it does not have to be if one takes advantage of the myriad open source resources available on the web. You don't have to look too hard to find something free to learn! Try finding an open source learning resource now. You will not regret it.

Open source helps educators, scholars, students, and lifelong learners explore new horizons.

Image by:

(Seth Kenlon, CC0)

Best of Opensource.com Education What to read next Free and open source education materials for children and teens 6 Python interpreters to try in 2022 Learn Python: 7 of my favorite resources This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How to use your Linux terminal as a file manager

Sat, 12/24/2022 - 16:00
How to use your Linux terminal as a file manager sethkenlon Sat, 12/24/2022 - 03:00

A terminal is an application that provides access to the user shell of an operating system (OS). Traditionally, the shell is the place where the user and the OS could interface directly with one another. And historically, a terminal was a physical access point, consisting of a keyboard and a readout (a printer, long ago, and later a cathode ray tube), that provided convenient access to a mainframe. Don't be fooled by this "ancient" history. The terminal is as relevant today as it was half a century ago, and in this article, I provide five common file management tasks you can do with nothing but the shell.

1. Open a terminal and look around

Today, everyone's got a computer on their desk or in their bag. The mainframe-and-terminal model is now essentially emulated through an application. Your operating system might have a unique name for it, but generically it's usually known as a "terminal" or "console".

  • Linux: Look for Console, Konsole, or Terminal. Regardless of the name, you can usually launch it from your application menu using the key word "terminal."

  • macOS: The default terminal application isn't open source and is widely considered lacking in features. Download iTerm2 to get a feature-rich, GPLv2 replacement.

  • Windows: PowerShell is the open source terminal application, but it uses a language and syntax all its own. For this article to be useful on Windows, you can install Cygwin which provides a POSIX environment.

Once you have your terminal application open, you can get a view of your file system using the command ls.

ls

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles 2. Open a folder

In a graphical file manager, you open a folder by double-clicking on it. Once it's open, that folder usually dominates the window. It becomes your current location.

In a terminal, the thought process is slightly different. Instead of opening a folder, you change to a location. The end result is the same: once you change to a folder, you are "in" that folder. It becomes your current location.

For example, say you want open your Downloads folder. The command to use is cd plus the location you want to change to:

cd Downloads

To "close" a folder, you change out of that location. Taking a step out of a folder you've entered is represented by the cd command and two dots (..):

cd ..

You can practice entering a folder and then leaving again with the frequent use of ls to look around and confirm that you've changed locations:

$ cd Downloads
$ ls
cat-photo.jpg
$ cd ..
$ ls
Documents    Downloads    Music    Pictures    Videos
$ cd Documents
$ ls
zombie-apocalypse-plan-C.txt
zombie-apocalypse-plan-D.txt
$ cd ..
$ ls
Desktop  Documents   Downloads
Music    Pictures    Videos

Repeat it often until you get used to it!

The advanced level of this exercise is to navigate around your files using a mixture of dots and folder names.

Suppose you want to look in your Documents folder, and then at your Desktop. Here's the beginner-level method:

$ cd Documents
$ ls
zombie-apocalypse-plan-C.txt
zombie-apocalypse-plan-D.txt
$ cd ..
$ ls
Desktop  Documents   Downloads
Music    Pictures    Videos
$ cd Desktop
$ ls
zombie-apocalypse-plan-A.txt

There's nothing wrong with that method. It works, and if it's clear to you then use it! However, here's the intermediate method:

$ cd Documents
$ ls
zombie-apocalypse-plan-C.txt
zombie-apocalypse-plan-D.txt
$ cd ../Desktop
$ ls
zombie-apocalypse-plan-A.txt

You effectively teleported straight from your Documents folder to your Desktop folder.

There's an advanced method, of this, too, but because you know everything you need to know to deduce it, I leave it as an exercise for you. (Hint: It doesn't use cd at all.)

3. Find a file

Admit it, you sometimes misplace a file. There's a great Linux command to help you find it again, and that command is appropriately named find:

$ find $HOME -iname "*holiday*"
/home/tux/Pictures/holiday-photos
/home/tux/Pictures/holiday-photos/winter-holiday.jpeg

A few points:

  • The find command requires you to tell it where to look.

  • Casting a wide net is usually best (if you knew where to look, you probably wouldn't have to use find), so I use $HOME to tell find to look through my personal data as opposed to system files.

  • The -iname option tells find to search for a file by name, ignoring capitalization.

  • Finally, the "*holiday*" argument tells find that the word "holiday" appears somewhere in the filename. The * characters are wildcards, so find locates any filename containing "holiday", whether "holiday" appears at the beginning, middle, or end of the filename.

The output of the find command is the location of the file or folder you're looking for. You can change to a folder using the cd command:

$ cd /home/tux/Pictures/holiday-photos
$ ls
winter-holiday.jpeg

You can't cd to a file, though:

$ cd /home/tux/Pictures/holiday-photos/winter-holiday.jpeg
cd: Not a directory4. Open a file

If you've got a file you want to open from a terminal, use the xdg-open command:

$ xdg-open /home/tux/Pictures/holiday-photos/winter-holiday.jpeg

Alternatively, you can open a file in a specific application:

$ kate /home/tux/Desktop/zombie-apocalypse-plan-A.txt5. Copy or move a file or folder

The cp command copies and the mv file moves. You can copy or move a file by providing the current location of the file, followed by its intended destination.

For instance, here's how to move a file from your Documents folder to its parent directory:

$ cd Documents
$ ls
zombie-apocalypse-plan-C.txt
zombie-apocalypse-plan-D.txt
$ mv zombie-apocalypse-plan-C.txt ..
$ cd ..
$ ls
Documents  Downloads    Music    Pictures
Videos     zombie-apocalypse-plan-C.txt

While moving or copying, you can also rename it. Here's how to move a file called example.txt out of the directory with the new name old-example.txt:

$ mv example.txt ../old-example.txt

You don't actually have to move a file from one directory to another just to rename it:

$ mv example.txt old-example.txtLinux terminal for files

The Linux desktop has a lot of file managers available to it. There are simple ones, network-transparent ones, and dual-panel ones. There are ones written for GTK, Qt, ncurses, and Swing. Big ones, small ones, and so on. But you can't talk about Linux file managers without talking about the one that's been there from the beginning: the terminal.

The terminal is a powerful tool, and it takes practice to get good at it. When I was learning the terminal, I used it for what I could, and then I opened a graphical file manager for advanced operations that I hadn't learned for the terminal yet. If you're interested in learning the how to use a terminal, there's no time like the present, so get started today!

Here are five common file management tasks you can do with nothing but the shell.

Image by:

iradaturrahmat via Pixabay, CC0

Linux What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Experience the power of the Linux Krusader file manager

Fri, 12/23/2022 - 16:00
Experience the power of the Linux Krusader file manager sethkenlon Fri, 12/23/2022 - 03:00

Krusader is a simple, powerful, dual-panel file manager for the KDE Plasma Desktop and other Linux desktops. You can think of it as a power-user's alternative to Dolphin, and it follows the tradition of "commander" style file managers (such as Midnight Commander.) Krusader includes archive handling, mounted file system support, a file system search, directory synchronization, batch renaming, and much more.

Install Krusader

On Linux, your distribution may package Krusader in its software repository. If so, you can use your package manager to install. For example, on Debian and Debian-based systems:

$ sudo apt install krusader

If your distribution doesn't offer Krusader, you can download it from krusader.org.

Image by:

(Seth Kenlon, CC BY-SA 4.0)

Putting you in control

It sounds aspirational, but Krusader truly is whatever file manager you want it to be. Its default presentation is pretty specific: it's a dual-pane file manager in the style of Midnight Commander but with the powerful underpinnings of the KDE Framework. As great as that is for many users, it doesn't do the application justice. Krusader is extremely configurable, to the point that you can use it as a single-pane file manager if you prefer.

Krusader is designed with the theory that by providing all users all of the tools, any single user can hide unwanted features and just use what they want. With so much available to you, it can admittedly take time to find what you like. However, the more you use Krusader, the more you find the features that make your life easier.

Image by:

(Seth Kenlon, CC BY-SA 4.0)

Krusader desktop

There's more to Krusader than its configuration options, though. Krusader isn't really just a file manager. I think of it as a desktop in a window. If you're running a window manager instead of a full desktop, you know how much work it can be to assemble the features of a desktop.

For instance, a window manager doesn't have a device manager. When you attach a USB thumbdrive to your computer, a window manager doesn't alert you that a new device has been detected, and it doesn't offer to mount the file system.

Krusader has a device manager. You can mount and unmount file systems with the MountMan tool in the Tools window.

Krusader also has a disk usage monitor, so if you're wondering where all your hard drive space went, you can get a graphical report on what files are using up your space.

Image by:

(Seth Kenlon, CC BY-SA 4.0)

Krusader supports archive formats, too, so you don't need to install an archive utility. Krusader can interact natively with ace, arj, bzip2, deb, gzip, iso, lha, rar, rpm, tar, zip, 7-zip.

But wait, there's more. Because Krusader is built on top of the KDE Framework, it also understands all the KIO modules the Plasma Desktop can use. For instance, to quickly go to a Samba share, you can use the smb:// prefix in your URL, and you can log in to a remote system over SSH using fish:// prefix.

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles Custom actions

Krusader also features the Useractions menu, a place where you can define custom actions. An action can be an arbitrary command, or it can a hook into built-in Krusader functions.

To hook into Krusader, you use placeholders, which are keywords you can use in your commands.

A placeholder begins with a percent sign (%), then a panel indicator. There are five possible panel indicators:

  • a: active panel

  • o: other panel (the one that's not active)

  • l: left panel

  • r: right panel

  • _: panel not applicable

For instance, suppose you want to create an action to convert a selection of images to the webp format. The command you might use for this in a terminal is:

$ convert image_001.png image_001.webp

But in Krusader, the name of the image must be variable, because it won't always be image_001 that you want to convert. You need a placeholder.

Here's the command in Krusader:

convert %aList("Selected")% %aCurrent(0,0)%.webp

This action invokes the convert command from ImageMagick and executes it on the current selection (whether it's one file or multiple files). Its destination is the current panel (the 0,0 in parentheses disables some optional features) with the file extension of .webp. These are the placeholders I find myself using the most:

  • List: selected items or a list of the first parameter (for instance, a list of paths)

  • Current: the current item

  • Path: the panel's path

  • Count: the number of first parameter (for instance, the number of items selected in a List)

  • Filter: the panel's filter mask

  • Select: set what is selected

  • Goto: change the panel's path

  • Ask: get user input

  • Clipboard: manipulate the clipboard

  • Each: split a command into a list, and execute each command one after the other

There are about 20 placeholders to learn, and they're all listed in the Krusader handbook, available from the Help menu.

Krusader is powerful

Krusader has everything you need. It's configurable enough that you can emphasize the parts you want to use, or hide the parts you don't use often. Whether you use Krusader as a humble file manager or the all-encompassing interface to your Linux system, it's a satisfyingly powerful application, and you owe it to yourself to give it a try.

Whether you use Krusader as a humble file manager or the all-encompassing interface to your Linux system, it's a satisfyingly powerful application, and you owe it to yourself to give it a try.

Linux What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

My favorite open source alternatives this year

Fri, 12/23/2022 - 16:00
My favorite open source alternatives this year Don Watkins Fri, 12/23/2022 - 03:00

Not a day goes by when I'm not looking for an affordable and reliable open source application that makes my workflow easier and more efficient. This year, Opensource.com authors provided us with several open source alternatives to popular proprietary applications that can improve the quality of life for you and your team.

Twitter

When Twitter announced new ownership earlier this year, many people sought out alternatives to the proprietary social media platform. Mastodon, a decentralized open source platform, stepped into the spotlight of the mainstream. If you're looking to switch from Twitter to Mastodon, read Jessica Cherry's tutorial and check out my article about the key differences. For veteran Mastodon users, learn how to get the green checkmark with Seth Kenlon's guide using encrypted keys.

Notion

If you have notes to yourself scattered throughout your hard drive, you might need a notes application to collect and organize your personal reminders. Amar Gandhi shows that there are a couple of useful open source note-taking tools. He writes that Standard Notes and Trilium are designed with your data as the top priority.

Adobe Creative Suite and others

Editor Seth Kenlon gave us a list of 26 open source applications to build your own open source tools for every creative discipline. In this article, Seth provides thumbnail descriptions of applications like Kdenlive, Audacity, Ardour, Hydrogen, and more to make your artistic dreams come true.

Office 365 and Google Docs

Are you looking for an open source groupware solution that rivals Office 365? Then Heike Jurzik has what you are looking for. Egroupware is an open source groupware solution that runs in your browser. According to her article, "EGroupware integrates other well-known open source applications, including Collabora Online, Rocket.Chat, Guacamole, Jitsi, and BigBlueButton. The groupware also supports computer telephony integration (CTI) with Asterisk/Placetel."

In her second article, Heike describes how to take care of an existing installation and manage backups. Administration of an Egroupware installation isn't particularly difficult, but it needs to be done. As an administrator, you need to be familiar with the nuances of the software. Fortunately, the developers of the software adhered to the KISS (Keep it Sweet and Simple) paradigm.

Alternatively, Carbonio might be the collaboration suite you're looking for. It empowers teams to work efficiently and closely together, regardless of distance, timezone, or work preferences. Arman Khosravi provides a brief overview that can help you get started with Carbonio.

If you're just looking for collaborative word processing, spreadsheets, drawing, and presentation, then you might want to look at Collabora Online. Heiki Jurzik shows us how this is an open source alternative to Microsoft 365 or Google Workspace. The LibreOffice-based online office suite supports all major document, spreadsheet, presentation file formats, and collaborative editing.

Acrobat

How many times have you found yourself needing to create, edit, and annotate portable documents? Fortunately, there are a number of solutions to that problem that run on Linux. Michael Korotaev provides a list of five applications that can supply the tools you need to accomplish the task. LibreOffice Writer can create PDFs and LibreOffice Draw can edit them. But did you know that OnlyOffice can also create PDFs and edit them too? PDF Arranger can help you rearrange the order of your documents. Michael writes that, "Okular has full or partial support for most popular PDF features and use cases, such as adding annotations and inline notes or inserting text boxes, shapes, and stamps." Finally, Xournal++ is an open source application that can easily annotate portable documents.

More open source alternatives Open source project management tools Trello alternatives Linux video editors Open source alternatives to Photoshop List of open source alternatives Latest articles about open source alternatives Slack chat and Google chat

Who doesn't like to visit with the people in your learning network? You may remember IRC, and the joy of chatting with folks who could help you solve a problem. You could also learn something new without leaving your home or office. There is now a new option to do that by using Rocket.Chat. In this article, Manuela Massochin shows us how to install the application and configure it so that you can securely chat with people inside or outside your organization.

Privacy is getting more important these days and that's a good thing. Alan Smithee tells us about how he uses Delta Chat to keep his conversations private. Delta Chat uses standard email protocol as its back end. But it appears and acts exactly like a chat application and it also offers end to end encryption.

A third option is the chat application, called Zulip, used by the Backdrop CMS. Tim Erickson who is an active member of the Drupal and Backdrop CMS communities explains why the Backdrop community uses Zulip. One of the key advantages of this chat application is the ability to use tags. This supports threaded conversation that enables clear communication and easy collaboration.

Doodle polls

Have you ever needed to get the pulse of your workgroup or organization but did not have the resources to afford one of the proprietary polling solutions? Scheduling meetings can be a nearly insurmountable task. Finding a time that works for everyone in the same organization, let alone across different time zones, can feel nearly impossible. Here is a link about five open source alternatives to Doodle poll.

Music streaming

My musical tastes are eclectic and there are proprietary solutions that come with a price tag that make them unsustainable for some folks. DJ Billings lets us in on her solution which is a unique combination of the Raspberry Pi 4 and open source media server JellyFin. This solution fulfills everything on my media library wish list. This is an ideal open source alternative to Apple Music, Spotify, Amazon Music, and other proprietary software tools.

Workflow engine

Do you lead a development team looking for an open source workflow solution? Cadence might be that missing piece in the puzzle for you. Ben Slater provides a detailed overview of how Cadence offers transformative advantages for organizations and application development teams.

Backup

Heiki Jurzik gives a great overview and compelling reasons to choose Bareos as your backup solution. Bareos preserves, archives, and recovers data from all major operating systems. Best of all Bareos is open source with an AGPL 3.0 license.

Customer relations

Are you looking for an open source constituent relationship management solution? Look no further than CiviCRM. Laryn Kragt Bakker shares how this system is designed to help you manage information about your organization's contacts, members, donations, and events. It's built specifically for nonprofits.  Now you won't find yourself having to try to shoehorn your organizational workflow into a business-oriented model.

Google Analytics

What business with a web presence doesn't need to know how they are performing on the internet and how to fine tune their content without a web analytics engine. Most folks rely on Google but there is growing concern in the EU and elsewhere that those analytics come with a price that favors the ubiquitous search engine. Plausible offers an open source option that's effective and affordable. In this article, Tom Greenwood, talks about five benefits of switching to Plausible.

Content management system

Most non-profits are cash poor while at the same time requiring a web presence to get their mission and message out to potential investors. That's what led the Stuart Center to consider Backdrop CMS. The center wanted the power of Drupal without the cost and complexity of Drupal 9. In this article, Laryn Krajt Bakker explains their journey of six key points that led the community to adopt Backdrop CMS.

Make open source the default

The phrase "open source alternative" is common, but for many of us open source isn't really an alternative to anything. It's just what we use. If you're looking to increase how much open source you use in your own digital life, take it one application at a time. It can take time, and sometimes there's a learning curve, but it pays off in the end.

Default to open in 2023 by swapping out Adobe Creative Suite, Office 365, Slack, and many more proprietary tools for open source applications.

Image by:

Opensource.com

Alternatives Best of Opensource.com What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Pages