Skip to content

Instantly share code, notes, and snippets.

View goffinet's full-sized avatar

goffinet

View GitHub Profile
@goffinet
goffinet / Password_cracking_in_the_cloud.md
Created December 27, 2020 18:38 — forked from 7MinSec/Password_cracking_in_the_cloud.md
Password cracking in the cloud
@goffinet
goffinet / subnet.py
Created February 21, 2021 16:20 — forked from vndmtrx/subnet.py
Python 3 simple subnet calculator
#!/usr/bin/env python3
# Use: ./subnet.py <ip/cidr>
# Alt: ./subnet.py <ip> <mask>
import sys
if __name__=="__main__":
addr = [0, 0, 0, 0]
mask = [0, 0, 0, 0]
cidr = 0
@goffinet
goffinet / zabbix_migration.md
Created March 5, 2021 06:55 — forked from mwalczak/zabbix_migration.md
Migrating Zabbix with MySQL backend to a new machine

Today I've solved the problem of one server being to slow to handle the growth of my zabbix configuration. I'm using zabbix-server 2.2.2 with MySQL/Debian backend and around 20 zabbix-agents with Debian installed.

Let's say old Zabbix server IP is: A.B.C.D and new is: U.X.Y.Z. The domain name for the instalation will be: http://zbx.newmachine.com

Below you will find all steps to migrate your configuration:

Ensure all agents will accept connections from the new IP Modify each agent configuration file (in debian: /etc/zabbix/zabbix_agentd.conf) and add new IP

@goffinet
goffinet / pyscript.py
Created March 6, 2021 17:53 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python3
"""A simple python script template.
"""
import os
import sys
import argparse
@goffinet
goffinet / pyscript.py
Created March 6, 2021 17:53 — forked from n8henrie/pyscript.py
Python script template
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""pyscript.py
A simple python script template.
http://ajminich.com/2013/08/01/10-things-i-wish-every-python-script-did/
"""
import argparse
@goffinet
goffinet / tuto.sh
Last active March 22, 2021 20:18 — forked from Vincent-CIRCL/tuto.sh
For-Dummy tutorial for Sphinx documentation of a Python project
# Sources :
https://goldilocks.readthedocs.io/en/latest/source/goldilocks.html#module-goldilocks.strategies
https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/
https://gisellezeno.com/tutorials/sphinx-for-python-documentation.html
http://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html
https://stackoverflow.com/questions/2701998/sphinx-autodoc-is-not-automatic-enough
https://github.com/MISP/PyMISP/blob/master/docs/source/conf.py
https://raw.githubusercontent.com/MISP/PyMISP/master/docs/source/index.rst
https://raw.githubusercontent.com/MISP/PyMISP/master/docs/source/modules.rst
https://stackoverflow.com/questions/13516404/sphinx-error-unknown-directive-type-automodule-or-autoclass/17004855
@goffinet
goffinet / installOpenSSH.ps1
Last active November 8, 2021 22:31 — forked from Kalki5/installOpenSSH.ps1
OpenSSH on Windows server 2016 - Powershell script
Set-Location -Path 'C:\Program Files'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/V8.6.0.0p1-Beta/OpenSSH-Win64.zip' -OutFile openssh.zip
Expand-Archive 'openssh.zip' -DestinationPath 'C:\Program Files\'
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newpath = "$oldpath;C:\Program Files\OpenSSH-Win64"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
@goffinet
goffinet / SCAP-CentOS-NotApplicable.md
Created November 25, 2021 07:29 — forked from gregelin/SCAP-CentOS-NotApplicable.md
Explanation of SCAP, CentOS and tests Not Applicable

This note explains the common issue of "notapplicable" results when running openSCAP and SCAP-Security-Guide on CentOS.

SCAP seems like it should be easy because it is "just XML". Then you dig into looking for a test and it gets confusing fast. So it is good to have some background.

SCAP (Security Content Automation Protocol) is actually a set of multiple standards and specifications that are used together to enable automatically testing hundreds of nerd settings. Let me emphasize that: SCAP is not a single XML specification -- SCAP is multiple standards and specs. Whenever you give "SCAP Content" to a scanner to check a system configurations you are giving the scanner multiple XML files representing multiple standards.

@goffinet
goffinet / remote_crc.md
Created September 6, 2022 08:05 — forked from tmckayus/remote_crc.md
Running 'crc' on a remote server

Overview: running crc on a remote server

This document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The instructions here were tested with F

@goffinet
goffinet / crc-on-google-cloud.md
Created October 2, 2022 13:06 — forked from pottava/crc-on-google-cloud.md
CodeReady Containers (crc)

Setup a CRC instance on Google Cloud

1. Create a VM

vm_name=
gcloud compute instances create \
    "${vm_name}" --zone asia-northeast1-c \
    --image-project=ubuntu-os-cloud --image-family=ubuntu-2004-lts \
    --machine-type "n1-custom-14-36864" --boot-disk-size 300G --boot-disk-type pd-standard \