Skip to content

Instantly share code, notes, and snippets.

View s-leroux's full-sized avatar

Sylvain Leroux s-leroux

View GitHub Profile
@s-leroux
s-leroux / file
Last active April 22, 2024 05:10
AWK one-liners support file
CREDITS,EXPDATE,USER,GROUPS
99,01 jun 2018,sylvain,team:::admin
52,01 dec 2018,sonia,team
52,01 dec 2018,sonia,team
25,01 jan 2019,sonia,team
10,01 jan 2019,sylvain,team:::admin
8,12 jun 2018,öle,team:support
@s-leroux
s-leroux / Makefile
Last active January 30, 2023 15:56
Running a nested xfce4-session in Xephyr
all: pts grantpt ptsname unlockpt
@s-leroux
s-leroux / resource.md
Last active May 26, 2022 21:14
A list of resources to practice "copywork" for technical writers

What is "copywork"?

Copywork is a technique to practice writing by copying parts of text from authors you admire. It is not plagiarisme since you only copy fragment of text, and you do not publish these copies. It's an exercise aiming at training your brain to see writing as a no-pressure practice. It makes you in position of thinking and writing like someone you like. It also force your mind to take attention and interiorize the small details of structure, style, vocabulary and text articulation that makes a great writing.

Read more about copywork here:

The resources below were choosen for the excellence of their writing, their style and vocabulary, regardless of the technical quality of the content. Since the goal here is to improve our writing skills, native English writers are

@s-leroux
s-leroux / aboutus.html
Created October 26, 2015 20:36
Front-End Web UI Frameworks and Tools -- week 3 exercice 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head
content must come *after* these tags -->
<title>Ristorante Con Fusion: About Us</title>
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
@s-leroux
s-leroux / Build.sh
Last active May 19, 2021 19:53
Build a CSV matrix showing versions of Asciidoctor that produce identical output
#!/bin/bash
#
# Usage:
# sudo Build [test-file.adoc] > result.csv
#
set -e
TESTFILE="${1:-test-file.adoc}" # the test file
@s-leroux
s-leroux / pgist.sh
Created June 24, 2016 09:46
Post GIST
# 0. Your file name
FNAME=some.file
# 1. Somehow sanitize the file content
# Remove \r (from Windows end-of-lines),
# Replace tabs by \t
# Replace " by \"
# Replace EOL by \n
CONTENT=$(sed -e 's/\r//' -e's/\t/\\t/g' -e 's/"/\\"/g' "${FNAME}" | awk '{ printf($0 "\\n") }')
@s-leroux
s-leroux / prename
Last active October 10, 2020 10:30
`prename` script from the Debian Perl Package by Robin Barker. Distributed under the terms of the Perl license (http://dev.perl.org/licenses/)
#!/usr/bin/perl -w
#
# This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
# from Larry Wall's original script eg/rename from the perl source.
#
# This script is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
@s-leroux
s-leroux / bin.sh
Created May 1, 2020 10:50
How to use recursion in Bash? Example: producing all {0..1} combinations of a given length.
#!/bin/bash
# Produces all {0..1} combinations of a given length
#
# This program is provided AS-IS with the sole purpose of
# demonstrating the use of functions and recursion in Bash
#
# Usage:
#
# sh$ ./bin.sh 3
# 000
#!/bin/sh
#
# Test several regex patterns against the characters in the ASCII printable range
# Related to https://twitter.com/freebsdfrau/status/1245253969447809024?s=20
#
seq 33 126 | awk '
BEGIN {
split("[-_[:alpha:]] [-[:alpha:]_] [_[:alpha:]-] [[:alpha:]_-]", tests, "[[:blank:]]+")