Skip to content

Instantly share code, notes, and snippets.

#include <openssl/ssl.h>
#include <openssl/err.h>
#include <string.h>
#include <iostream>
using namespace std;
void handleOpenSSLErrors(void)
{
ERR_print_errors_fp(stderr);
abort();
@qqq-tech
qqq-tech / stack_traces.c
Created January 9, 2020 03:14 — forked from jvranish/stack_traces.c
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@qqq-tech
qqq-tech / docker_cheat.md
Created January 9, 2020 03:16 — forked from GSByeon/docker_cheat.md
도커(Docker) 치트 시트

Docker 치트 시트

한국어 번역(초벌) : nacyot

왜 Docker를 사용해야하는가?

Why Should I Care (For Developers)

"나에게 Docker의 매력은 간단히 격리된 환경을 만들 수 있다는 것과, 그러한 환경을 재사용할 수 있다는 점이다."런타임 환경을 한 번 만들어 패키지로 만들면, 이 패키지를 다른 어떤 머신에서도 다시 사용할 수 있다. 또한 여기서 실행되는 모든 것은 마치 가상머신과 같이 호스트로부터 격리되어있다. 무엇보다도 이런 모든 일들이 빠르고 간단히 가능하다.

@qqq-tech
qqq-tech / nginx.conf
Created January 9, 2020 03:16 — forked from GSByeon/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Adventures in Python Core Dumping

After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.

@qqq-tech
qqq-tech / proc_net_tcp_decode
Created January 9, 2020 03:16 — forked from GSByeon/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@qqq-tech
qqq-tech / srt.py
Last active January 13, 2020 11:56 — forked from glenn-kim/srt.py
SRT 예매 시도 스크립트.py
# srt.py
# 코드 표
# 공주:0514
# 광주송정:0036
# 구미):0507
# 나주:0037
# 대전:0010
# 동대구:0015
# 동탄:0552
@qqq-tech
qqq-tech / s3-upload-aws4.sh
Created March 4, 2020 02:44 — forked from vszakats/s3-upload-aws4.sh
AWS S3 Upload using signature v4
#!/bin/sh -u
# To the extent possible under law, Viktor Szakats (vszakats.net)
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# Upload a file to Amazon AWS S3 using Signature Version 4
#
# docs:
@qqq-tech
qqq-tech / docker2wsl.cmd
Created October 27, 2020 12:35 — forked from rkttu/docker2wsl.cmd
Docker container to WSL convert
@echo off
pushd "%~dp0"
rem Example: docker2wsl ubuntu:latest myubuntu
docker pull %1
docker run -d --name %2 %1 /bin/sh > %TEMP%\ctrid.txt
set /p CTRID= < %TEMP%\ctrid.txt
if exist %TEMP%\ctrid.txt del /f /q %TEMP%\ctrid.txt
////////////////////////////////////////////////////////////////////////////////
// General definitions.
////////////////////////////////////////////////////////////////////////////////
//
// Context flags.
// winnt.h (Windows SDK)
//