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 May 3, 2024 00:53
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 April 17, 2024 21:06
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.

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();