opensource.com

Subscribe to opensource.com feed
Updated: 2 hours 34 min ago

Short option parsing using getopt in C

Thu, 08/19/2021 - 15:01

Writing a C program to process files is easy when you already know what files you'll operate on and what actions to take. If you "hard code" the filename into your program, or if your program is coded to do things only one way, then your program will always know what to do.

But you can make your program much more flexible if it can respond to the user every time the program runs. Let your user tell your program what files to use or how to do things differently. And for that, you need to read the command line.


read more

A guide to understanding your team's implicit values and needs

Thu, 08/19/2021 - 15:00

Culture matters in open organizations. But "culture" seems like such a large, complicated concept to address. How can we help open organization teams better understand it?


read more

A guide to database replication with open source

Wed, 08/18/2021 - 15:00

In the world of constantly evolving data, one question often pops up: How is it possible to seamlessly replicate data that is growing exponentially and coming from an increasing number of sources? This article explains some of the foundational open source technologies that may help commoditize database replication tasks into data warehouses, lakes, or other databases.


read more

Build a JAR file with fastjar and gjar

Wed, 08/18/2021 - 15:00

One of the many advantages of Java, in my experience, is its ability to deliver applications in a neat and tidy package (called a JAR, or Java archive.) JAR files make it easy for users to download and launch an application they want to try, easy to transfer that application from one computer to another (and Java is cross-platform, so sharing liberally can be encouraged), and easy to understand for new programmers to look inside a JAR to find out what makes a Java app run.


read more

Setting new expectations for open source maintainers

Wed, 08/18/2021 - 15:00

For a long time, there were two basic tests for releasing open source: "Does it do what I need it to do?" and "Does it compile?"

Sure, it was nice if it did things for others, but more than anything else, it at least needed to be fun for the developer and run at all for others. Then with the rise of package management, things leveled up a bit: "Is it packaged?" Shortly after that, the increasing popularity of test-driven development added another requirement: "Do the tests pass?"


read more

4 alternatives to cron in Linux

Tue, 08/17/2021 - 15:01

The Linux cron system is a time-tested and proven technology. However, it's not always the right tool for system automation. There are a few other open source projects out there that can be used either in conjunction with cron or instead of cron.


read more

What was your first programming language?

Mon, 08/16/2021 - 15:01

We asked our contributors What was your first programming language? but the question goes much deeper than that. There are stories to tell about who suggested it or what prompted you to learn it. If you were paid to do so, and what happened next. Then there's a lot it says about your age and what was going on in the world.

Let's hear a little bit about these 24 technologists' stories.

What was your first programming language? BASIC

Were you paid to learn it? Nope.

Did you choose it? Not really.


read more

Parse command-line arguments with argparse in Python

Mon, 08/16/2021 - 15:00

There are several third-party libraries for command-line argument parsing, but the standard library module argparse is no slouch either.

Without adding any more dependencies, you can write a nifty command-line tool with useful argument parsing.

Argument parsing in Python

When parsing command-line arguments with argparse, the first step is to configure an ArgumentParser object. This is often done at the global module scope since merely configuring the parser has no side effects.


read more

Schedule a task with the Linux at command

Sun, 08/15/2021 - 15:00

Computers are good at automation, but not everyone knows how to make automation work. It's a real luxury, though, to be able to schedule a task for a computer at a specific time and then forget about it. Maybe you have a file to upload or download at a specific time, or you need to process a batch of files that don't yet exist but are guaranteed to exist by a certain time or a setting that needs monitoring, or maybe you just need a friendly reminder to pick up bread and butter on the way home from work.


read more

Install Linux with LVM

Fri, 08/13/2021 - 15:01

A couple of weeks ago, the good folks at Linux Mint released version 20.2 of their open source operating system. The installer built into the live ISO is excellent and only requires a few clicks to install the OS. You even have a built-in partitioner if you want to customize your partitions.


read more

Code memory safety and efficiency by example

Fri, 08/13/2021 - 15:00

C is a high-level language with close-to-the-metal features that make it seem, at times, more like a portable assembly language than a sibling of Java or Python. Among these features is memory management, which covers an executing program's safe and efficient use of memory. This article goes into the details of memory safety and efficiency through code examples in C and a code segment from the assembly language that a modern C compiler generates.


read more

Parse command options in Java with commons-cli

Fri, 08/13/2021 - 15:00

When you enter a command into your terminal, whether it's to launch a GUI app or just a terminal app, there are often options (sometimes called switches or flags) you can use to modify how the application runs. This is a standard set by the POSIX specification, so it's useful for a Java programmer to know how to detect and parse options.


read more

A beginner's guide to the Linux terminal

Thu, 08/12/2021 - 15:02

There's a café a few streets away from where I live, and I go there every Sunday for a regularly scheduled game of D&D. They have a menu, and the first few times I ordered, I looked over the menu for several minutes to see what my choices were. Being a creature of habit, I eventually stopped referring to the menu because I knew exactly what they have for sale, and I know exactly what I want.


read more

Automatically create multiple applications in Argo CD

Thu, 08/12/2021 - 15:01

In a previous article, I demonstrated how Argo CD makes pull-based GitOps deployments simple. In this tutorial, I’ll show you how to automatically create multiple applications in Argo CD using Argo CD itself.


read more

Monitor your Linux system in your terminal with procps-ng

Wed, 08/11/2021 - 15:02

A process, in POSIX terminology, is an ongoing event being managed by an operating system’s kernel. A process is spawned when you launch an application, although there are many other processes running in the background of your computer, including programs to keep your system time accurate, to monitor for new filesystems, to index files, and so on.


read more

My first programming language and early adventures

Wed, 08/11/2021 - 15:01

A few days ago, contributors to Opensource.com were asked to share our personal stories about how we got into programming. Many entertaining and fascinating responses were submitted. It would be interesting to quantify these data in time. Intriguing patterns emerged. The 70s generation was nostalgic about Fortran, punch cards, and dial-up access to shared mainframes. 80s kids (amongst which I qualify) shared stories of C, BASIC, or Pascal and their beloved Atari and Commodore computers. Surprisingly few stories from the 90s arrived. Almost like there's a generation gap.


read more

My top 5 tips for setting up Terraform

Wed, 08/11/2021 - 15:00

Working with Terraform for over five years has taught me some key lessons. Five practices have been critical to having a logical and usable Terraform setup regardless of the size of the team or the nature of the project.


read more

How I use Terraform and Helm to deploy the Kubernetes Dashboard

Tue, 08/10/2021 - 15:01

When I'm working on projects that require provisioning cloud infrastructure, my workflow has two disparate components: one is infrastructure orchestration, which includes Terraform to bring up the infrastructure (for instance, new EKS clusters), and the second is the provisioning component, which includes Ansible or Bash scripts to instantiate and initialize that infrastructure to accept new deployments (for instance, installing Cluster Autoscaler, kube-state-metrics, and so on.)


read more

How to get the most out of GitOps right now

Tue, 08/10/2021 - 15:00

You may have encountered this brief introduction to GitOps shared by prevalent cloud software engineer, Kelsey Hightower:

GitOps: versioned CI/CD on top of declarative infrastructure. Stop scripting and start shipping. https://t.co/SgUlHgNrnY


read more

Pages