Skip to content

Instantly share code, notes, and snippets.

View listm's full-sized avatar

Michael List listm

View GitHub Profile
@listm
listm / wsl2_gui_shortcut_tutorial.md
Last active September 30, 2020 08:18
WSL2 GUI Startup Shortcut without Console Window

Start Phpstorm GUI inside WSL2 from Windows Shortcut (without console window)

I use a tool called Quiet.exe for this (found on Source [1]), have not managed to find a solution without it unfortunately

  • Install X410 or other Windows X servers, put startup code into /home/username/scripts/displayvar.sh (file content in my case for X410: export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0)
  • Install Phpstorm using Jetbrains toolbox, use option "Shell Scripts" -> "Generate shell scripts" ("Shell scripts location" in my case is /opt/shortcuts)
    • Starting phpstorm using /opt/shortcuts/phpstorm from inside WSL2 terminal will work now.. one could always start from here using the command /opt/shortcuts/phpstorm &
  • Allow starting from Windows shortcut:
  • Download Quiet.exe from here joeware.net ([virustotal check](https://www.virustotal.com/gui/file/c92904610319843578ada35fb483d219b0d07da69179d57c7e1223cab078492c/detectio
@listm
listm / ocsp_checker.py
Created August 19, 2019 08:22
Checks if tls request contains successful oscp response, needs sslyze installed. Can be used as a nagios plugin.
#!/bin/python3
import sys
def check_ocsp(servername, port=443):
from sslyze.plugins.certificate_info_plugin import CertificateInfoScanCommand, OcspResponseStatusEnum
from sslyze.synchronous_scanner import SynchronousScanner
from sslyze.server_connectivity_tester import ServerConnectivityTester
server_tester = ServerConnectivityTester(hostname=servername, port=port)
@listm
listm / map_openssl_ciphersuite_algos.py
Created July 26, 2017 22:34
Get ciphers from openssl and convert the seperate parts into a python dictionary
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import subprocess
import os
ciphersuite_mapping = {}
raw_output = subprocess.check_output(["openssl", "ciphers", "-v"])[:-1]
raw_lines = raw_output.split(os.linesep)
for line in raw_lines:
line_parts = line.split()