Skip to content

Instantly share code, notes, and snippets.

View papajoker's full-sized avatar

patrick papajoker

  • France
View GitHub Profile
@papajoker
papajoker / makelog.py
Last active October 24, 2021 22:59
create linux logs from yaml file
#!/usr/bin/env python
"""
framework for make logs infos from yaml config file
Rev7
"""
from io import FileIO
import sys
import os
from pathlib import Path
@papajoker
papajoker / paccache-manjaro.sh
Last active September 23, 2021 13:21
clear pacman cache except manjaro and aur packages
#!/usr/bin/env bash
#set -x
shopt -s nullglob
shopt -s extglob
#
# faire du ménage du cache pacman
# SAUF les paquets de manjaro !! (keep=3 par defaut)
#
# V1.00
@papajoker
papajoker / test.zsh
Created September 4, 2021 00:00
test speed command-not-found zsh pamac
#!/usr/bin/env zsh
#set -x
cmd=(${@:l})
echo "\"${cmd[@]:0:1}\" command not found !"
read_files_zsh() {
# very very very slow ???
for repo in $(pacman-conf -l); do
echo "find in $repo ..."
alias chrooty='rep=$(stat -c "%n" /run/media/$(whoami)/* 2>/dev/null | fzf --reverse --prompt="dossier à monter >"); [ -d "$rep" ] && sudo systemd-nspawn -D $rep || echo "Dossier ($rep) invalide"'
@papajoker
papajoker / http-server.sh
Last active September 21, 2017 14:55
start/stop http server
#!/usr/bin/env bash
#sans paramètre, il commute de on/off;
CR='\033[0m\033[31m' # red
CG='\033[0m\033[32m' # green
CB="\033[1m" # bold
CE='\033[0m' # end
unset APACHE NGINX
NGINX=1
@papajoker
papajoker / bash_ini.md
Created March 12, 2017 19:19
bash read write in ini file
@papajoker
papajoker / bash.model.sh
Created February 21, 2017 11:59
model for bash script
#!/usr/bin/env bash
# description
pkgname='name'
version=0.1.0-1
#set -x
# test in asset function
unset DEVELOPER PARAMS ADMIN CONFIG VERBOSE LOCAL DIR
PARAMS=1
DEVELOPER=1
@papajoker
papajoker / arch-save.sh
Created February 10, 2017 09:08
save config archlinux
#!/usr/bin/env bash
pkgname='arch-save'
version=0.1.0-1
# test in asset function
unset DEVELOPER PARAMS ADMIN CONFIG VERBOSE LOCAL DIR PACKAGES
#PARAMS=1
DEVELOPER=1
PACKAGES=1
DIR=1
@papajoker
papajoker / manjaro-logo.html
Created September 19, 2016 17:09
manjaro logo pure css
<style>
.manjaro-logo {
--main-color: #00bb44;
width:48px;
height: 48px;
overflow:hidden;
position:relative;
display: inline-block;
}
.logo-round {
@papajoker
papajoker / 0_reuse_code.js
Created September 2, 2016 22:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console