Skip to content

Instantly share code, notes, and snippets.

View SansGuidon's full-sized avatar
Curious mind reading about everything

SansGuidon SansGuidon

Curious mind reading about everything
  • Zoemp
View GitHub Profile
@SansGuidon
SansGuidon / openssl-encrypt-file
Last active June 9, 2017 17:33 — forked from mingfang/convert id_rsa to pem
OpenSSL for files encryption
# create a PEM pub key (will be useful later)
openssl rsa -in .ssh/id_rsa -pubout -out id_rsa.pub.pem
# check it
chmod 700 id_rsa.pub.pem
openssl rsa -in id_rsa.pub.pem -pubin -text -noout
# 1) encrypt small file, using only RSA private and pub key
# create a secret
echo "my secret" > secret.txt
# encrypt the file using your public key
@SansGuidon
SansGuidon / gpg-encrypt-file
Last active June 9, 2017 16:00
Using GPG for file encryption
# file encryption using private and public key : the recipent public key is used in this case
alice$ gpg --output secret.bin --encrypt --recipient bob.public.key secret.txt
bob$ gpg --output secret.txt --decrypt secret.txt
# file encryption without using priv/pub key
gpg --output secret.bin --symmetric --cipher-algo AES256 secret.txt
gpg --output secret.txt --decrypt secret.bin
@SansGuidon
SansGuidon / jenkins-notify-stash
Last active June 9, 2017 17:32
Stash : Update Build status for a particular commit
{
"state": "SUCCESSFUL",
"key": "jobname/20",
"name": "jobname/20",
"url": "https://<JENKINS URL>/jenkins/job/jobname/20",
"description": "Changes by MorganGeek"
}
@SansGuidon
SansGuidon / gpg cheat sheet.md
Last active November 5, 2023 09:28
GPG Cheat Sheet

Basics

generate key in batch mode using a custom profile

gpg --gen-key --batch gpgspecs

create a file with your fingerprint info and display the related information. A fingerprint is used as a robust key identifier

gpg --fingerprint

Best practices

@SansGuidon
SansGuidon / splunk-extract-fields-by-delimiter
Created June 12, 2017 14:50
Splunk : use a separator/delimiter for field extraction
host=cbsysstash31 invalid username | eval fields=split(_raw,"|") | eval userid=mvindex(fields,2) |
@SansGuidon
SansGuidon / inbox-by-google-tricks.md
Created June 20, 2017 19:51
Search tricks for Inbox by Google

Mails I need to answer in:inbox and !from:yourmailaccount@gmail.com and !from:yoursecondemailaccount@gmail.com and !in:saved

Mails I need to answer for a while in:inbox and !from:yourmailaccount@gmail.com and !from:yoursecondemailaccount@gmail.com and before:2017/04/01

Saved links yet to read for a while in:saved and in:inbox and before:2017/01/01

Saved links yet to read

@SansGuidon
SansGuidon / home-bandwidth-monitoring.md
Last active September 6, 2020 19:05
Home network bandwidth monitoring
Tool Pros Cons Test result
BitMeterOS KISS, works on linux/mac/windows way too simple and abandonned dbsync corrupted the db with the latest version (non stable). Works well on windows, linux and mac at home
PRTG free version (up to 100 sensors) only windows ? need to check
Zabbix
PandoraFMS
Cacti depends on mysql, php
Nagios
Icinga mac not supported but there are solutions
@SansGuidon
SansGuidon / compare-download-sites.md
Last active May 31, 2021 11:43
compare download sites
search [ED] [ZT] [ID] [T9] [TZ] [TP] [2D] [ZE] [OM] [NT] [EZ] [YT] [TM] [TPB] [1X] [CP] [LT] [T4] [TL] [YG]
thx 1138 x x x x x x x x x
french hunger games x x x x . x x x x . x x x x
easy french s01 x x . x x . x . . x
vostfr lion x x x x x x x x x x x x
french lion x x x x x x x x . x x x x
silicon valley vostfr x x x x . . . . . . . . x . x
rock roll french x x x x x x x x x x x x x
battlestar galactica french x . . . . x x . . x
  • storage: iostat
  • memory : meminfo (details), free (overview)
  • multiple cpu activity : mpstat
  • network related : netstat
  • performance : nmon
  • memory process usage : pmap
  • memory and cpu time process usage : ps, pstree
  • long term system monitoring : sar
  • process system call debugging : strace
  • network utility : tcpdump

Execute in powershell

add chocolatey provider & install firefox

Set-ExecutionPolicy Unrestricted -Force
Install-PackageProvider -Name NuGet -Force
Install-PackageProvider ChocolateyGet -verbose -Force
Import-PackageProvider ChocolateyGet

Get-PackageSource | select *