Skip to content

Instantly share code, notes, and snippets.

View gipert's full-sized avatar

Luigi Pertoldi gipert

View GitHub Profile
@gipert
gipert / daemon.sh
Created April 29, 2019 15:12
Simple skeleton for auto-daemonizing bash script
#!/bin/bash
#
# simple bash daemon skeleton
#
# Author: Luigi Pertoldi - luigi.pertoldi@hotmail.it
# Created: Mon 29 Apr 2019
usage() {
echo >&2 "USAGE: `basename $0` [OPTIONS]"
echo >&2 ""
@gipert
gipert / ROOTmacro_cmdline_args.C
Last active August 18, 2020 12:14
Template ROOT macro that can be executed directly with command-line arguments
//usr/bin/env root -l ${0}\(\""${0}"\",\""${*}"\"\); exit $?
/* ROOTmacro_cmdline_args.C
*
* template ROOT macro that can be executed (do not forget to
* `chmod +x`) with command-line arguments
*
* Author: Luigi Pertoldi - pertoldi@pd.infn.it
* Created: Sun 24 Mar 2019
*/
@gipert
gipert / poisson_bands.hpp
Last active March 4, 2021 09:47
Poisson smallest interval computing and drawing utilities. Ref: https://doi.org/10.1140/epjp/i2012-12024-0
/* poisson_bands.hpp
*
* Copyright (c) 2019 Luigi Pertoldi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@gipert
gipert / itunes-on-arch-linux-guide.md
Created May 10, 2020 00:49
iTunes on (Arch) Linux: installation guide

Prerequisites

  1. Enable the multilib repository by editing /etc/pacman.conf
  2. Install WineHQ and some other optional dependencies:
    $ pacman -Syu wine
    $ pacman -S --asdeps lib32-mpg123 lib32-gnutls {lib32-,}gst-plugins-base-libs \
                         lib32-alsa-plugins lib32-libpulse lib32-openal
    $ yay -S lib32-unixodbc # or your favourite AUR helper
  3. We'll install a 64-bit version of iTunes, so no need to set WINEARCH
@gipert
gipert / jlcode.sty
Last active May 21, 2020 22:31
jlcode + lstfiracode MWE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% jlcode.sty
%%% Copyright 2018 GitHub user wg030
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any
%% later version.
%% The latest version of this license is in
@gipert
gipert / doit.sh
Created November 11, 2023 19:12
One liner download all Particle Data Group review PDF documents in parallel
wget -q -O- https://pdg.lbl.gov/2023/reviews/contents_sports.html \
| sed -nr 's/.+href="(rpp.+-rev-.+\.pdf)".+/\1/p' \
| parallel wget -nv https://pdg.lbl.gov/2023/reviews/{}