Skip to content

Instantly share code, notes, and snippets.

View airglow923's full-sized avatar
✒️
Studying

Hyundeok Park airglow923

✒️
Studying
  • South Korea
  • 21:49 (UTC +09:00)
View GitHub Profile
@airglow923
airglow923 / check-cipher-suites.sh
Created June 5, 2025 15:09
Check cipher suites used by a website
sudo apt install nmap
curl -sSf --tlsv1.2 --proto '=https' -LO https://nmap.org/svn/scripts/ssl-enum-ciphers.nse
nmap --script ./ssl-enum-ciphers.nse -p 443 ${DOMAIN}
@airglow923
airglow923 / configs.md
Last active February 28, 2023 12:26
Steam configs

Team Fortress 2

Launch options

-novid -nojoy -nosteamcontroller -nohltv -particles 1 -precachefontchars -noquicktime

$STEAM_LIBRARY\steamapps\common\Team Fortress 2\tf\custom\module.cfg:

@airglow923
airglow923 / Print.hpp
Created February 13, 2023 10:19
Print with fold expression separated by delimiter
#include <ostream>
#include <string>
#include <type_traits>
#include <utility>
template <typename CharT, typename Arg>
auto
Print(std::ostream &os, [[maybe_unused]] CharT delimiter, const Arg &arg)
-> std::ostream & {
static_assert(
@airglow923
airglow923 / Makefile
Last active December 9, 2021 04:06
Simple Makefile
CC = clang
CFLAGS = -std=c11 -O0 -g3 -Wall -Wextra
ASAN_FLAGS = -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-recover=address
CSRC = $(wildcard *.c)
COBJ = $(patsubst %.c, %.o, $(CSRC))
.PHONY: all
all: main
@airglow923
airglow923 / libcxx.sh
Last active November 28, 2021 08:24
Required packages for LLVM libc++ on Ubuntu
# Debian
sudo apt install clang libc++-dev libc++abi-dev libunwind-dev
# Red Hat
## yum
sudo yum install libcxx-devel libunwind-devel
## dnf
sudo dnf install libcxx-devel libunwind-devel
@airglow923
airglow923 / sfinae-concept.cpp
Last active November 23, 2021 02:34
SFINAE and concept comparison
#include <concepts>
#include <iostream>
#include <type_traits>
struct BothAssignable {
constexpr auto operator=(const BothAssignable&) noexcept -> BothAssignable& = default;
constexpr auto operator=(BothAssignable&&) noexcept -> BothAssignable& = default;
};
struct CopyAssignable {
@airglow923
airglow923 / bubble-sort.cpp
Created November 10, 2021 16:31
Bubble sort
#include <iterator> // bidirectional_iterator, iterator_traits
#include <utility> // move, swap
template <std::bidirectional_iterator BidirectionalIterator, typename Compare,
typename ValueType =
typename std::iterator_traits<BidirectionalIterator>::value_type>
constexpr auto bubble_sort1(BidirectionalIterator begin,
BidirectionalIterator end, Compare compare)
-> void {
if (begin == end) {
@airglow923
airglow923 / print-range.cpp
Created October 30, 2021 19:20
Print range in C++
#include <iostream> // cout
#include <ranges> // range, subrange, cbegin, cend
#include <vector>
namespace {
auto print_range(const std::ranges::range auto &range, bool newline = true)
-> void;
namespace detail {
@airglow923
airglow923 / custom-unordered-set.cpp
Created October 30, 2021 19:13
Custom hash for unordered_set
#include <concepts> // integral
#include <unordered_set>
#include <utility> // pair
template <std::integral First, std::integral Second>
struct std::hash<std::pair<First, Second>> {
using argument_type = std::pair<First, Second>;
using result_type = std::size_t;
auto
@airglow923
airglow923 / floating-point-binary-1.cpp
Last active October 30, 2021 19:23
Floating-point number to binary in C++
#include <concepts> // integral
#include <cstddef> // size_t
#include <iostream> // cout
#include <ranges> // iota, reverse
namespace {
constexpr auto
is_bit_set(long long i, std::size_t n) -> bool {
return (i & (1LL << n)) != 0;