Skip to content

Instantly share code, notes, and snippets.

View dbwodlf3's full-sized avatar
๐Ÿข
I may be slow to respond.

Cogi dbwodlf3

๐Ÿข
I may be slow to respond.
  • SWLAB
  • Republic of Korea
View GitHub Profile
@johnstanfield
johnstanfield / fail2ban_amznlnx2.sh
Created May 13, 2021 17:59
install fail2ban on amazon linux 2
# run as root or sudo everything below
# install epel
amazon-linux-extras install epel -y
# install fail2ban
yum -y install fail2ban
# configure fail2ban (just adding enabled=true in the sshd section)
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
@luncliff
luncliff / cmake-tutorial.md
Last active April 19, 2025 04:49
CMake ํ• ๋•Œ ์ชผ์˜ค์˜ค๊ธˆ ๋„์›€์ด ๋˜๋Š” ๋ฌธ์„œ

CMake๋ฅผ ์™œ ์“ฐ๋Š”๊ฑฐ์ฃ ?
์ข‹์€ ํˆด์€ Visual Studio ๋ฟ์ž…๋‹ˆ๋‹ค. ๊ทธ ์ด์™ธ์—๋Š” ์ „๋ถ€ ์‚ฌ๋„(้‚ช้“)์ž…๋‹ˆ๋‹ค ์‚ฌ๋„! - ์ž‘์„ฑ์ž

์ฃผ์˜

  • ์ด ๋ฌธ์„œ๋Š” CMake๋ฅผ ์ฃผ๊ด€์ ์œผ๋กœ ์„œ์ˆ ํ•ฉ๋‹ˆ๋‹ค
  • ์ด ๋ฌธ์„œ๋ฅผ ํ†ตํ•ด CMake๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์—” ์ ํ•ฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค
    https://cgold.readthedocs.io/en/latest/ 3.1 ์ฑ•ํ„ฐ๊นŒ์ง€ ๋”ฐ๋ผํ•ด๋ณธ ์ดํ›„ ๊ธฐ๋ณธ์‚ฌํ•ญ๋“ค์„ ์†์„ฑ์œผ๋กœ ์ตํžˆ๋Š” ๊ฒƒ์„ ๋•๊ธฐ์œ„ํ•œ ๋ณด์กฐ์ž๋ฃŒ๋กœ์จ ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค
@nuxodin
nuxodin / HTMLFormElement-HTMLInputElement.reportValidity.js
Last active January 7, 2023 19:52
Polyfill for reportValidity()
/* Copyright (c) 2016 Tobias Buschor https://goo.gl/gl0mbf | MIT License https://goo.gl/HgajeK */
if (!HTMLFormElement.prototype.reportValidity) {
HTMLFormElement.prototype.reportValidity = function() {
if (this.checkValidity()) return true;
var btn = document.createElement('button');
this.appendChild(btn);
btn.click();
this.removeChild(btn);
return false;
@EtienneR
EtienneR / user.js
Created January 7, 2016 23:39
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@emiller
emiller / git-mv-with-history
Last active December 1, 2024 18:57
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 10, 2025 20:01
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@benjchristensen
benjchristensen / TestRandom.java
Created January 5, 2012 17:33
Simple performance test of Math.random() for comparing machines
public class TestRandom {
public static void main(String args[]) {
long start = System.currentTimeMillis();
for (int i = 0; i < 100000000; i++) {
Math.random();
}
System.out.println("Math.random() Time: " + (System.currentTimeMillis() - start) + "ms");
start = System.currentTimeMillis();