Skip to content

Instantly share code, notes, and snippets.

View jdawsongit's full-sized avatar

John Dawson jdawsongit

View GitHub Profile
@drmalex07
drmalex07 / README-gnu-parallel-examples.md
Last active January 12, 2020 01:17
Some starter examples using GNU Parallel. #parallel #gnu-parallel #bash

README - Examples on using GNU Parallel

Suppose we want to compress (using bzip2) a number of log files.

Distrubute jobs to several threads on local machine. The commands (for each input file) are executed in current working directory.

ls *.log| parallel -j+0 bzip2 -9 '{}' 
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active May 15, 2024 10:52
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@sparsick
sparsick / java-pom-template.xml
Last active May 5, 2023 21:46
Maven POM Template for Java Projects
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId></groupId>
<artifactId></artifactId>
<version>1.0.0-SNAPSHOT</version>
@kdabir
kdabir / log4j.properties
Created March 14, 2012 14:17
a minimal log4j config file
log4j.rootLogger=INFO, CONSOLE
# CONSOLE is set to be a ConsoleAppender using a PatternLayout
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %m%n
# a more detailed PatternLayout: %d [%t] %-5p %c - %m%n
# adjust specific logger levels as per the need to control the verbosity of logs