Skip to content

Instantly share code, notes, and snippets.

View jeanlouisferey's full-sized avatar

Jean-Louis FEREY jeanlouisferey

View GitHub Profile
@jeanlouisferey
jeanlouisferey / send.sh
Created July 12, 2023 13:16
Script shell to send notification to ntfy.sh from a Xigmanas NAS (FreeBSD without curl)
#!/bin/bash
HOST=ntfy.sh
TOPIC=$2
PORT=80
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin"
CONTENT=$1
@jeanlouisferey
jeanlouisferey / Change lynis report to Markdown
Created October 11, 2019 12:14
Change lynis report to Markdown
WIP:
yes | lynis audit system --no-colors | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | sed 's/\[+\]/##/g' > /tmp/test-lynis8.md 2>&1
TODO:
- create a TOC
- add some emphasis
- make first level title
@jeanlouisferey
jeanlouisferey / DevMachineInstallation.md
Last active December 4, 2018 15:38
How to install my dev machine ?

1- Install Ubuntu Mate VirtualBox machine

2- Give an access to Internet (proxy to /etc/environnment)

3- Install gcc and some other tools (sudo apt install build-essential software-properties-common)

4- Install VB add-on

5- add you user to vbosf group: sudo adduser $USER vboxsf (and reboot !)

@jeanlouisferey
jeanlouisferey / ansible-python.md
Last active July 12, 2018 13:52
Install Ansible python prerequisites on debian/ubuntu

Some ubuntu cloud images don't have python installed by default.

This is an Ansible task to install Ansible python prerequisites on debian/ubuntu

tasks:
  - name: install python 2
    raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
---
- name: Add ssh public key locally
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: List ssh public keys
find:
path: ./public-keys
@jeanlouisferey
jeanlouisferey / ssh-config.txt
Last active March 20, 2018 17:32
.ssh/config to connect a machine through a bastion
# .ssh/config file
# In this case, same user and same key on the two machines
Host bastion
Hostname bastion-ansible-01
User cloud
IdentityFile /home/admin/MaClefRsa
Host internetproxy-01
Hostname 192.168.1.89
---
- name: Create dynamic inventory for ssh connection by password
hosts: localhost
connection: local
gather_facts: no
vars:
server_list:
- {hostname: 'machine1', adresse_ip: '10.123.123.123', osadmin_password: 'azerty', root_password: 'ytreza'}
- {hostname: 'machine2', adresse_ip: '10.123.123.124', osadmin_password: 'azerty', root_password: 'ytreza'}
@jeanlouisferey
jeanlouisferey / jqwekan.md
Last active November 22, 2017 16:27
How to extract cards title from json Wekan export ?

When you export a wekan, you get a big bunch of json. If you want select a list of all cards title, you can use jq (https://stedolan.github.io/jq/) like that:

jq '.cards[].title' wekan-export-board-nZkj4ywiwFSYX5Xjt.json

Keybase proof

I hereby claim:

  • I am jeanlouisferey on github.
  • I am jeanlouisferey (https://keybase.io/jeanlouisferey) on keybase.
  • I have a public key ASCdCSGwmjd4srdPuaxPiFCeHS9Skr_5taau3bxkxokRpAo

To claim this, I am signing this object:

@jeanlouisferey
jeanlouisferey / easy_virtualenv_ansible.md
Last active April 15, 2021 12:45
How to use virtualenv to switch easily between multiple version of Ansible on Ubuntu

How to use virtualenv to switch easily between multiple version of Ansible

As root (sudo) get pip:

1- Install some dependencies:

   apt install build-essential libssl-dev libffi-dev python-dev

2- Install pip: