Skip to content

Instantly share code, notes, and snippets.

View nsagot's full-sized avatar
🎯
Focusing

Nicolas Sagot nsagot

🎯
Focusing
View GitHub Profile
@nsagot
nsagot / audit.log
Created April 13, 2024 09:55
Sample of audit.log (Debian 11)
type=DAEMON_START msg=audit(1713001228.814:9691): op=start ver=3.0 format=enriched kernel=5.10.0-18-arm64 auid=4294967295 pid=1392 uid=0 ses=4294967295 subj=unconfined res=successAUID="unset" UID="root"
type=CONFIG_CHANGE msg=audit(1713001228.818:17): op=set audit_backlog_limit=8192 old=64 auid=4294967295 ses=4294967295 subj=unconfined res=1AUID="unset"
type=CONFIG_CHANGE msg=audit(1713001228.818:18): op=set audit_failure=1 old=1 auid=4294967295 ses=4294967295 subj=unconfined res=1AUID="unset"
type=CONFIG_CHANGE msg=audit(1713001228.818:19): op=set audit_backlog_wait_time=60000 old=15000 auid=4294967295 ses=4294967295 subj=unconfined res=1AUID="unset"
type=SERVICE_START msg=audit(1713001228.822:20): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=auditd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset"
type=USER_END msg=audit(1713001228.998:21): pid=1260 uid=1000 auid=1000 ses=2 subj=unconfined msg='op=PAM:session_close gr
@nsagot
nsagot / app.js
Created January 9, 2019 15:04
Extract info from CPE
/**
* Convert CPE URI to Understandable object
*
* @param {string} uri
* @returns {{part: (*|string), vendor: (*|string), product: (*|string), version: (*|string), update: (*|string), edition: (*|string), language: (*|string), sw_edition: (*|string), target_sw: (*|string), target_hw: (*|string), other: (*|string)}}
*/
function cpeUriToObject(uri){
let CPE23 = new Array(13);
let cpeDetails = uri.split(`:`);
cpeDetails.forEach((item) => CPE23.push(item));
@nsagot
nsagot / script.sh
Created August 7, 2018 13:08
Extract diff from Hacked! for Drupal Modules
#!/usr/bin/env bash
DRUSH="vendor/bin/drush"
$DRUSH hlp > /tmp/hlp.list
MODULE_LIST=$(cat /tmp/hlp.list | sed 's/ \+ /\t/g' | cut -f 2)
for f in $MODULE_LIST ; do \
$DRUSH hacked-diff $f > /tmp/$f.patch ; \
done
@nsagot
nsagot / Global gitignore.md
Last active May 28, 2018 09:23
Global Gitignore

Global Gitignore

Pour ne pas polluer les .gitignore des projets, on va configurer notre propre gitignore global qui sera appliqué dans chaque projet local.

Mac/Linux

Commencez par créer et éditer votre fichier

vi ~/.gitignore