# 당신만의 스크립트를 보여주세요

> Clean Markdown view of GeekNews topic #7286. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=7286](https://news.hada.io/topic?id=7286)
- GeekNews Markdown: [https://news.hada.io/topic/7286.md](https://news.hada.io/topic/7286.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-08-30T09:42:06+09:00
- Updated: 2022-08-30T09:42:06+09:00
- Original source: [news.ycombinator.com](https://news.ycombinator.com/item?id=32467957)
- Points: 43
- Comments: 6

## Topic Body

혼자만 사용하는 스크립트를 알려달라는 HN의 질문에 대한 답변들  
- 접속하는 모든 서버에서 같은 환경을 구성하는 '.ssh/config'   
→ 서버에 처음 접속시 필요한 dotfile을 자동으로 rsync 하고, 그 다음 접속부터는 자동 업데이트   
- command help (ch) 스크립트   
→ 도움말 & man 페이지에서 명령행 부분만 추출해서 보여줌   
- MISC(Manually Installed or Source Compiled)   
→ 수동 설치 또는 소스 컴파일한 패키지들만 관리해주는 스크립트   
- git-co-commit   
→ 페어프로그래밍시 커밋 메시지 마지막에 "Co-authored-by: ..."를 추가  
→ git-co-commit 으로 path에 추가하면 git은 자동으로 git co-commit 서브코맨드로 인식함   
- 캡스락+마우스클릭 하면 초당 50번씩 클릭해주는 AutoHotkey 스크립트   
- rerun   
→ 디렉토리의 파일이 변경되면 명령을 자동 재실행 하는 스크립트   
- git recent   
→ 최근에 작업한 브랜치 보여주기  
- ccd   
→ 디렉토리 만들고 그 디렉토리로 이동  
- git-move   
→ Repo간 파일 이동. 히스토리 보존

## Comments



### Comment 12082

- Author: tribela
- Created: 2022-08-30T16:00:04+09:00
- Points: 1

alias df='df -h -x tmpfs -x devtmpfs -x squashfs'  
alias xc='xclip -sel clipboard'  
alias ttfb='curl -so /dev/null -w "HTTP %{http_version} %{http_code} Remote IP: %{remote_ip}\nConnect: %{time_connect}\nTTFB: %{time_starttransfer}\nTotal time: %{time_total}\nDownload speed: %{speed_download}bps\nBytes: %{size_download}\n"'  
  
ap() {  
    https $@ Accept:application/activity+json  
}  
  
shodan() {  
    xdg-open https://shodan.io/domain/$1  
    dig +short $1 | xargs -i xdg-open https://shodan.io/host/{}  
}  
  
check_mtu() {  
    local target=$1  
    shift  
    local lower=0  
    local upper=1500  
    until [[ $((lower + 1)) -eq $upper ]]; do  
        current=$(((lower + upper) / 2))  
        echo -n "lower: $lower, upper: $upper, testing: $current -- "  
        if ping -M do -s $current -c 2 -i 0.2 $target $@ &> /dev/null; then  
            echo "ok"  
            lower=$current  
        else  
            echo "fail"  
            upper=$current  
        fi  
    done  
  
    echo "max packet size: $lower, mtu: $((lower + 28))"  
}  
제가 쓰는 건 이 정도 되네요

### Comment 12080

- Author: alstjr7375
- Created: 2022-08-30T11:19:14+09:00
- Points: 2

- GIF -> Video  
  → ffmpeg -v warning -i "입력.gif" -y "출력.mp4" -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v "crop=floor(iw/2)*2:floor(ih/2)*2"  
- Video -> GIF  
  → ffmpeg -v warning -i "입력.mp4" -y "출력.gif" -filter_complex "[0:v] fps=15, split [1:v] [2:v]; [1:v] palettegen [p]; [2:v] fifo [3:v]; [3:v] [p] paletteuse" -loop 0

### Comment 12081

- Author: alstjr7375
- Created: 2022-08-30T11:43:08+09:00
- Points: 2
- Parent comment: 12080
- Depth: 1

참고로 gif의 일반적인 최대 FPS는 50정도로 생각하시면 됩니다.  
https://wunkolo.github.io/post/2020/02/buttery-smooth-10fps/  
  
에뮬가능하다는 말은 있던데 해보지를 않아서 잘 모르겠네요.  
https://superuser.com/questions/1449366/do-60-fps-gifs-actually-exist-or-is-the-maximum-50-fps

### Comment 12078

- Author: bbulbum
- Created: 2022-08-30T10:27:17+09:00
- Points: 1

tmux 세션을 열고 세가지 프로젝트 코드(api, front, admin)를 세개의 윈도우로 띄우는 스크립트를 쓰고있습니다.   
tmux new-session -d \; new-window \; send-key "nvim ~" C-m \; attach;  
이전 회사에서는 출퇴근이 직접 회사 사이트에 로그인해서 찍는거였는데, puppeteer로 자동화 해서 쓰기도...

### Comment 12075

- Author: cr543l
- Created: 2022-08-30T09:49:00+09:00
- Points: 1

git log --pretty="%ad [%ae] %s" --author E_MAIL_ADDRESS  
→ git 리비전에서 지정한 커미터만 필터링해서 보기

### Comment 12074

- Author: xguru
- Created: 2022-08-30T09:42:09+09:00
- Points: 1

- .ssh/config : https://news.ycombinator.com/item?id=32468605  
- ch : https://github.com/learnbyexample/command_help/blob/master/ch  
- MISC : https://github.com/tpapastylianou/misc-updater  
- git-co-commit : https://gist.github.com/sshine/d5a2986a6fc377b440bc8aa096037ef0  
- AutoHotkey : https://news.ycombinator.com/item?id=32468167  
- rerun : https://news.ycombinator.com/item?id=32469012  
- git-recent : https://news.ycombinator.com/item?id=32470619  
- ccd : `function ccd { mkdir -p "$1" && cd "$1" }`  
- git move : https://gist.github.com/mnemnion/87b51dc8f15af3242204472391f3bf59
