Skip to content

Instantly share code, notes, and snippets.

@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active April 16, 2024 21:48
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@thesamesam
thesamesam / xz-backdoor.md
Last active April 16, 2024 21:47
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is still a new situation. There is a lot we don't know. We don't know if there are more possible exploit paths. We only know about this one path. Please update your systems regardless.

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

@HoShiMin
HoShiMin / SymParser.cpp
Created September 24, 2018 21:03
PDB symbols downloader and parser
#include <windows.h>
#include <vector>
#include <string>
#include "SymParser.h"
// Using Wide-versions of DbgHelp functions:
#define DBGHELP_TRANSLATE_TCHAR
// Expose additional declarations from DbgHelp.h:
#define _NO_CVCONST_H
@PROGrand
PROGrand / ExampleController.cs
Last active April 16, 2024 21:45
SwaggerResponse and ProducesResponseType attributes checking
[ApiController]
[Route("[controller]")]
public class ExampleController : ControllerBase
{
// SwaggerResponse supported, i prefer old one.
[HttpGet]
[SwaggerOperation("LoginUser")]
[SwaggerResponse(statusCode: StatusCodes.Status200OK, type: null, description: "signed user email account")]
[SwaggerResponse(statusCode: StatusCodes.Status400BadRequest, type: null, description: "wrong email or password")]
[Route("/users/login")]
@median-man
median-man / .gitmessage
Last active April 16, 2024 21:45 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write **useful** commit messages.
# <type>: <subject> (Max 50 char, Why is this change necessary?)
# |<---- Using a Maximum Of 50 Characters ---->|
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Explain how the commit addresses the issue
# IMPORTANT!! Describe any side effects of the change.
# Provide links or keys to any relevant tickets, articles or other resources
# Examples: "Jira issue [ABC-123]" or "Closes Github issue #123"
@raphlinus
raphlinus / subpixel_antialias.py
Created May 1, 2019 13:59
Research code to do RGB subpixel antialiasing using angle info in signed distance fields
import math
# http://vcl.itn.liu.se/publications/2011/GS11/edtaa_preprint.pdf
def tex(df, cos_th):
cos_th = abs(cos_th)
sin_th = math.sqrt(1 - cos_th ** 2)
if cos_th < sin_th:
cos_th, sin_th = sin_th, cos_th
a1 = 0.5 * sin_th / cos_th # note: paper is missing the 0.5!
@dixneuf19
dixneuf19 / zsh-virtualenv-setup.md
Last active April 16, 2024 21:41 — forked from hminnovation/zsh-virtualenv-setup.md
Setup python, pip, virtualenv and virtualwrapper, with zsh on a new machine
@MoonTahoe
MoonTahoe / upload.yaml
Last active April 16, 2024 21:40
Github Action to build iOS app with expo and upload to testflight
# Just place this file in your repo under the .github/workflows folder.
# You set all of the secrets in the setting of the repo
name: Deploy to Testflight
# When a pull request is closed...
# This is because this action commits back to the repository
# so setting this on a push would cause an infinite loop of commits
# unless you pragmatically check the contents of the repo or something
@sgillies
sgillies / advanced_rasterio_features.ipynb
Last active April 16, 2024 21:39
Advanced Rasterio features notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
%scala
import java.io
import org.apache.spark.sql.streaming._
import org.apache.spark.sql.streaming.StreamingQueryListener._
def writeToFile(file: File, str: String): Unit = {
val writer = new FileWriter(file)
try { writer.append(str).append("\n") }
finally { writer.close }
println("saving progress file successful")