Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥

CHANN channprj

🔥
View GitHub Profile
@channprj
channprj / django-admin-toggle-filter-panel.js
Created Nov 10, 2020
Toggle Django Admin Filter Panel
View django-admin-toggle-filter-panel.js
(function($) {
$(document).ready(function($) {
$("tr input.action-select").actions();
$('<div id="show-filters" style="float: right;"><a href="#">&larr; 필터 보기</a></p>').prependTo('div.actions');
$('#show-filters').hide();
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">필터 &rarr;</a>');
$('#show-filters').click(function() {
$('#changelist-filter').show('fast');
$('#changelist').addClass('filtered');
@channprj
channprj / pyppeteer.py
Created Nov 5, 2020
Read html file and make pdf with pyppeteer
View pyppeteer.py
import asyncio
from pyppeteer import launch
async def main():
browser = await launch(
options={
'headless': True,
'args': [
'--no-sandbox',
@channprj
channprj / remove-dangling-images-safely.sh
Last active Sep 29, 2020
Remove dangling container images safely
View remove-dangling-images-safely.sh
#!/bin/bash
# simple way
if [ $(echo -n $(docker images -f "dangling=true" -q) | wc -m) -gt 0 ]; then docker rmi -f $(docker images -f "dangling=true" -q); else echo "No Dangling container images"; fi
# ... or
# Remove exited containers
EXITED_CONTAINERS=$(docker ps -a -f status=exited -q)
if [ ! -z "${EXITED_CONTAINERS}" ]
@channprj
channprj / npm-proxy.sh
Created Sep 24, 2020
NPM Proxy Setting
View npm-proxy.sh
# Required
npm config set proxy http://<HOSTNAME>:<PORT>
npm config set https-proxy http://<HOSTNAME>:<PORT>
# Optional
npm config set strict-ssl false
@channprj
channprj / AWSSecurityContents.md
Created Aug 12, 2020 — forked from serithemage/AWSSecurityContents.md
AWS 보안 관련 자료 모음집
View AWSSecurityContents.md

AWS 학습 링크집 시리즈

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

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

@channprj
channprj / README.md
Last active Aug 5, 2020
실행중인 파이썬 프로세스 모니터링하기
View README.md

실행중인 파이썬 프로세스 모니터링하기

사전준비

pip install pyrasite urwid meliae

사용방법

View keybase-github.md

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

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

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

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

keybase login
@channprj
channprj / remove_danglings.sh
Last active Jul 9, 2020
Remove dangling images and volumes silently
View remove_danglings.sh
#!/bin/bash
# Remove exited containers
EXITED_CONTAINERS=$(docker ps -a -f status=exited -q)
if [ ! -z "${EXITED_CONTAINERS}" ]
then
docker rm ${EXITED_CONTAINERS} &2>1
echo "Remove exited containers."
else
echo "...No exited containers."
@channprj
channprj / docker-compose.yml
Created Jul 6, 2020 — forked from barnybug/docker-compose.yml
Docker compose for a Docker-in-docker gitlab runners setup
View docker-compose.yml
# 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 / config
Created Jun 7, 2020
~/.ssh/config
View config
ServerAliveInterval 120
Host *
UseKeychain yes
# Company Server
# ------------------------------------
Host company-sample-server
HostName sample.company.com
User sample_user
IdentityFile ~/.ssh/sample/id_rsa
You can’t perform that action at this time.