Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Heechan Park channprj

View GitHub Profile
@channprj
channprj / README.md
Created January 9, 2024 07:38 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@channprj
channprj / cheatsheet-elasticsearch.md
Last active August 25, 2023 07:45 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@channprj
channprj / simulate.js
Created October 11, 2022 11:27 — forked from cs09g/simulate.js
Mouse/Touch Event Simulation
/**
* @desc It triggers mouse event.
* @param {HTMLElement} element target DOM element
* @param {string} type type of event
* @param {number} x clientX of event
* @param {number} y clientY of event
*/
export function simulateEvent(element, type, x, y) {
const mouseEvent = new MouseEvent(type, {
screenX: 0,
@channprj
channprj / deep-link-from-browser.js
Created November 24, 2021 13:36 — forked from diachedelic/deep-link-from-browser.js
Deep link to a native app from a browser, with a fallback
@channprj
channprj / log-all-zsh-bash-commands-syslog.md
Last active August 3, 2021 16:24 — forked from dayreiner/log-all-zsh-bash-commands-syslog.md
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

# Local
curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash
curl -L https://iterm2.com/utilities/imgcat > ${HOME}/.iterm2/imgcat
# Remote server
sudo curl -o /usr/local/bin/imgcat -O https://iterm2.com/utilities/imgcat && sudo chmod +x /usr/local/bin/imgcat
# sudo wget https://iterm2.com/utilities/imgcat /usr/local/bin && sudo chmod +x /usr/local/bin/imgcat
# Enjoy it now! :-)
imgcat /tmp/sample.png
@channprj
channprj / AWSSecurityContents.md
Created August 12, 2020 04:04 — forked from serithemage/AWSSecurityContents.md
AWS 보안 관련 자료 모음집

AWS 학습 링크집 시리즈

AWS 보안 관련 컨텐츠 모음집(http://bit.ly/secontents)

AWS 공식문서 중 보안에 관련된 자료들을 한글 자료 중심으로 정리한 페이지 입니다.

키베이스로 깃 커밋 서명하는법

A. PGP 공개키-비공개키 키쌍 등록

갖고있는 PGP 키쌍이 없을경우 새로 만들어야한다. 이미 키 쌍이 keybase에 업로드되어있는 경우, 기존의 키를 컴퓨터에 다운로드하기만 하면 된다.

A.1. 새 키 만들어서 하는법

keybase login
@channprj
channprj / docker-compose.yml
Created July 6, 2020 09:13 — forked from barnybug/docker-compose.yml
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
@channprj
channprj / audit_mixin.py
Created March 5, 2020 12:03 — forked from techniq/audit_mixin.py
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)