Skip to content

Instantly share code, notes, and snippets.

@stonehippo
stonehippo / inspect_https-tls-ssl_certs.md
Last active May 9, 2024 18:31
A couple of ways to look at web server HTTPS/TLS/SSL certificate data via the command line

Inspecting HTTPS (TLS, SSL) certificates from the command line

I needed to inspect an HTTPS site's current certs and wanted to do it from the command line. Here are a couple of commands that I used that worked quite well.

With nmap

nmap -p 443 --script ssl-cert [hostname]
import io
import zipfile
from textwrap import dedent
from time import sleep
from typing import Literal, TypeAlias
from xml.dom import minidom
from simple_salesforce import Salesforce
ApexType: TypeAlias = Literal["ApexClass", "ApexTrigger"]
@d7samurai
d7samurai / .readme.md
Last active May 9, 2024 18:27
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube

hollowcube

Also check out Minimal D3D11 pt2, reconfigured for instanced rendering and with a smaller, tighter, simplified overall code structure, or Minimal D3D11 pt3, with shadowmapping + showcasing a range of alternative setup and rendering techniques.

@ThinGuy
ThinGuy / add-music.rsc
Created May 4, 2019 18:43
add music to mikrotik switches
/system script
add name="Music: Super Mario Bros" owner=admin policy=read source=":beep frequency=660 length=100ms;\
\n:delay 150ms;\
\n:beep frequency=660 length=100ms;\
\n:delay 300ms;\
\n:beep frequency=660 length=100ms;\
\n:delay 300ms;\
\n:beep frequency=510 length=100ms;\
\n:delay 100ms;\
\n:beep frequency=660 length=100ms;\
@farhad0085
farhad0085 / Deploy Django and React APP in a production VPS.md
Last active May 9, 2024 18:21
Deploy Django and React APP in a production VPS (Django + Celery + React + PostgreSQL + NGINX + Ubuntu Server)

Deploy Django and React APP in a production VPS (Django + React + PostgreSQL + NGINX + Ubuntu Server)

Assuming You have backend and frontend codes in /home/backend and /home/frontend/ (Use git to upload)

Install required Packages from the Ubuntu Repositories

sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx
@Dev-Dipesh
Dev-Dipesh / image.md
Last active May 9, 2024 18:20
Javascript loops can be quite confusing. Knowing the write loop to use can make a big difference in performance.

A4 Image file if you would like to print it ♥ JS Loops Cheatsheet

@9klips
9klips / Install Ubuntu 18.04 subsystem on Windows 10 64-bit
Created August 18, 2019 08:21
Install Ubuntu 18.04 subsystem on Windows 10 64-bit
#This file contains commands and instructions for installing Linux distributions on Windows for through WSL
# 1. First we need to enable the WSL optional feature and restart the computer
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart
Restart-Computer
# 2. Create a folder where the Linux distribution will be placed and executed from
New-Item C:\Distros -ItemType Directory
Set-Location C:\Distros
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 9, 2024 18:17
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@subfuzion
subfuzion / curl.md
Last active May 9, 2024 18:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@chud0
chud0 / logging.md
Last active May 9, 2024 18:15
Python logging

Модуль logging для Python.

В Python есть отличная встроенная библиотека - logging. Часто ее противопоставляют print-ам, однако на мой взгляд это гораздо более весомый инструмент. Разобравшись с некотрыми приемами в работе, хочу поделиться с сообществом наиболее, на мой взгляд, интересными вещами. Данная заметка основана на официальной документации, и по сути является частичным вольным переводом.

Когда использовать logging

Для самого простого использования, модуль предоставляет функции debug(), info(), warning(), error() и critical(). Название функций соответствует названию уровней или серьезности логируемых событий. Рекомендации по использованию стандартных уровней сведены в таблицу (в порядке возрастания серьезности).

Уровень сообщений Когда использовать
CRITICAL Критическая ошибка, выполнение программы невозможно
ERROR Из-за серьезной ошибки программа не смогла выполнить какую-либо функ