프로그램 사용/docker2019. 2. 27. 22:20

container의 내용을 저장하고 복구하는 방법


commit 으로 저장하고

save로 파일로 저장하고

load로 파일에서 불러와 복원한다


라는데 db도 되려나?


[링크 : https://blog.naver.com/chandong83/221006388637]

'프로그램 사용 > docker' 카테고리의 다른 글

centos docker compose iptable error  (2) 2019.03.20
docker inspect  (0) 2019.02.28
docker 개념 다시 조사..  (0) 2019.02.01
docker 설명..  (0) 2019.02.01
docker run = create + start  (0) 2019.02.01
Posted by 구차니
프로그램 사용/squid2019. 2. 27. 20:36

퇴근길에 검색하다가 우연히 발견한 문서

squid에서 HIER/NONE 이라고 뜨는 녀석은 캐싱이 안되는데

기본값으로 원래 서버로 요청을 돌려주도록 되어 있다고 한다.


parent가 누굴 지칭하는지 모르겠지만 global hit rate에는 영향을 못 미치면서 latency만 늘어난다라...


#  TAG: nonhierarchical_direct

# By default, Squid will send any non-hierarchical requests

# (matching hierarchy_stoplist or not cachable request type) direct

# to origin servers.

#

# If you set this to off, then Squid will prefer to send these

# requests to parents.

#

# Note that in most configurations, by turning this off you will only

# add latency to these request without any improvement in global hit

# ratio.

#

# If you are inside an firewall then see never_direct instead of

# this directive.

#

#Default:

# nonhierarchical_direct on 

[링크 : http://www.squid-cache.org/mail-archive/squid-users/200203/att-0514/squid.conf]


+

캐시 hierarchy 라는게 있어서 찾아보기..

[링크 : https://wiki.squid-cache.org/Features/CacheHierarchy]


+

헐?

[링크 : http://www.squid-cache.org/Doc/config/offline_mode/]

[링크 : https://stackoverflow.com/.../how-can-squid-be-configured-to-cache-all-downloaded-files]

'프로그램 사용 > squid' 카테고리의 다른 글

squid url_rewrite_program  (0) 2019.03.14
squid log code  (0) 2019.03.01
squid용 인증서 관련 (인증서 변환하기)  (0) 2019.02.25
HSTS-HTTP Strict Transport Security / squid  (0) 2019.02.25
squid as transparent proxy  (0) 2019.02.19
Posted by 구차니
프로그램 사용/apache2019. 2. 27. 12:54

virtualhost 라는 기능으로 구현이 가능한데..

웹 서버에서 하는건가? haproxy나 squid로 안되는걸려나? ㅠㅠ


[링크 : https://mynewparadigm.tistory.com/entry/1개의-ip로-2개의-도메인을-연결하는-방법]

[링크 : https://blog.readiz.com/29]

[링크 : https://hudi.kr/node-js-node-js-에서-vhost-사용/]


+

기본적으로 이 기능은 L4 에서 작동하는 것으로

apache / nginx / node.js 등에서 설정이 가능하다.

[링크 : https://stackoverflow.com/...-host-multiple-node-js-sites-on-the-same-ip-server-with-different-domain]

[링크 : https://www.joinc.co.kr/w/man/12/Nginx/virtualhost]

[링크 : https://gist.github.com/jakebellacera/590803]

[링크 : https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/]

'프로그램 사용 > apache' 카테고리의 다른 글

lets enceypt apache  (0) 2024.04.22
apache2 HSTS 활성화 하기  (0) 2024.04.18
mod_rewrite 테스트..  (4) 2017.04.12
mod_rewrite 로그설정  (0) 2017.04.12
라즈베리 파이 mod_rewrite 활성화  (0) 2017.04.11
Posted by 구차니

reverse proxy 돌리면..

공유기 안에서도 정상적으로 로그를 받을 수 있을려나?


[링크 : https://serverfault.com/questions/326837/iptables-nat-port-fowarding-and-apache-log-ips]

Posted by 구차니
프로그램 사용/squid2019. 2. 25. 12:25

생각해보니 뻘짓 한 듯..

그나마 도움이 된건 각종 인증서를 변환하는 방법을 찾은 것?

[링크 : https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-apache-for-centos-7]

[링크 : https://www.securesign.kr/guides/SSL-Certificate-Convert-Format]




pem to crt

해보니까 이전에 생성하던 der 이랑 동일한 내용

$ openssl x509 -outform der -in your-cert.pem -out your-cert.crt

[링크 : https://stackoverflow.com/questions/13732826/convert-pem-to-crt-and-key]


pem to key

$ openssl rsa -outform der -in private.pem -out private.key

[링크 : https://stackoverflow.com/questions/19979171/how-to-convert-pem-into-key]


[링크 : https://www.lesstif.com/pages/viewpage.action?pageId=6979614]

[링크 : https://www.lesstif.com/pages/viewpage.action?pageId=19365977]

Posted by 구차니
프로그램 사용/squid2019. 2. 25. 09:37

+

2019.02.28

HSTS는 HTTP Strict Transport Security 약자로

간단하게 요약하면 HTTP로 접속하면 강제로 HTTPS로 전환하는 그런류의 기술 인 듯?


+

2019.02.28

youtube 캐시하는걸 해보려는데 HSTS 오류 어쩌구 떠서(크롬에서) 찾아보는데

역시 뻘짓 한 듯... HTTP -> HTTPS 하면서 보안 강화한 상황이라

그 이전의 유튜브 캐싱에 대한 내용들로 열심히 삽질하는 듯..


[링크 : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security]

[링크 : https://blog.geun.kr/158]

[링크 : https://blog.lael.be/post/6670]

[링크 : chrome://net-internals/#hsts]


[링크 : https://www.thesslstore.com/blog/clear-hsts-settings-chrome-firefox/]

[링크 : https://support.opendns.com/...-Chrome-for-Windows-only-HSTS-Certificate-Exception-Instructions]

[링크 : https://rsec.kr/?p=315]

[링크 : https://blog.lael.be/post/6670]

Posted by 구차니

다음 인코더 등에서 2PASS , 1PASS 설정하는게 있었는데

특별한게 아니라(?) H.264 인코더에서 제공하는 기본적인 기능이었네?


아무튼 2PASS의 경우 1PASS에서는 비트레이트를 어떻게 할지 분석하고(아마도 화면 바뀌는 순간 등을 확인하는 듯)

2PASS에서 실질적인 인코딩을 진행한다고 한다.


ffmpeg -y -i input -c:v libx264 -b:v 2600k -pass 1 -an -f mp4 /dev/null && \

ffmpeg -i input -c:v libx264 -b:v 2600k -pass 2 -c:a aac -b:a 128k output.mp4

[링크 : https://trac.ffmpeg.org/wiki/Encode/H.264]

Posted by 구차니

-c:a copy를 통해 오디오는 손대지 않고(AAC 같은건 못 건드리네.)

비디오만 비트레이트 변경할 수 있다.


$ ffmpeg -i viedeo.mp4 -b:v 2M -maxrate 2M -bufsize 1M  -c:a copy video_low.mp4 

[링크 : https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate]

[링크 : https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats]

'프로그램 사용 > ffmpeg & ffserver' 카테고리의 다른 글

webm을 mp3로 변환하기  (0) 2020.04.01
ffmpeg h264 encoding 옵션  (0) 2019.02.22
ffmpeg 레이턴시 관련 옵션 조사  (0) 2018.12.16
ffmpeg / ffplay cli interactive interface  (0) 2018.11.30
ffmpeg concat  (0) 2018.11.05
Posted by 구차니
프로그램 사용/nfs2019. 2. 22. 08:17

nfs 에서도 sparse file을 지원은 하는데 NFS v4.2 이후부터라고

NFS V4.2 ? Feature

● Sparse File Support ? Sparse files are ones which

have allocated or uninitialized blocks in the file.

(1.4.3)

● SEEK - Find the Next Data or Hole

● NFS: Implement SEEK (Sep 2014)

● READ_PLUS - READ Data or Holes from a File

● No published upstream patches yet

● Prototype patches improve performance with reading holes

(See Anna’s keynote graph).  

[링크 : https://events.static.linuxfound.org/sites/events/files/slides/Vault2017.pdf]


특정 버전으로 제한하는 법은 아래와 같은데 소수점 버전은 없네?

To specify NFS version, use -o option


# mount -t nfs -o vers=4 192.168.1.10:/mnt/data /data

or

# mount -t nfs -o vers=3 192.168.1.10:/mnt/data /data 

[링크 : https://computingforgeeks.com/configure-nfsv3-and-nfsv4-on-centos-7/]


버전 확인하기

근데 여전히 소수점 버전은 확인이 불가능 하다.

 nfsstat

[링크 : https://unix.stackexchange.com/questions/115918/how-to-determine-if-nfs-mount-is-mounted-as-v3-or-v4]

'프로그램 사용 > nfs' 카테고리의 다른 글

rootfs 와 nfs-server  (0) 2019.07.17
svc: failed to register lockdv1 RPC service (errno 111)  (0) 2015.02.10
nfs mount 시 옵션들  (0) 2012.12.11
mount.nfs: access denied by server while mounting  (0) 2012.06.08
showmount  (0) 2012.06.08
Posted by 구차니
프로그램 사용/squid2019. 2. 19. 23:56

프록시 설정하려면 귀찮은데

그걸 해소하기 위한 방법으로 게이트웨이 아이피에다가 proxy 까는 것 처럼

클라이언트 측의 설정 없이 프록시 하는 법을 찾는 중


[링크 : https://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html]

[링크 : https://linuxtechlab.com/squid-transparent-proxy-server-complete-configuration/]


+

방화벽에서 걸러서 프록시로 던져주는 것이 컨셉인듯

[링크 : https://blog.naver.com/kazami20/56490157]


이제 웹브라우저의 도구 -> 인터넷 옵션 -> 연결 -> 랜설정 -> 사용자랜에 프록시 사용을 체크한뒤

자신의 리눅스 프락시로 ip주소를 적고 포트를 3128로 지정해주고 인터넷을 하면

이제부터 보이는 웹 사이트 화면은 먼저 프락시에서 페이지를 읽어온뒤에 윈도우 웹브라우저로

보여지는것이다.

이와 같은 브라우저에서의 프락시 설정을 하지 않고 사용하고 싶을때 패킷필터 방화벽설정을

하여서 80포트로 가는 패킷을 3128번 포트로 리다이렉트하는 방법이 있다.

이것을 Transparent Proxy(투명 프락시)라고 하는데 이것을 설정하는 것은 쉬우며

젤 아래에 설정을 추가할 부분을 추가한다.


------------ Proxy mode 로 사용시 설정 끝 -----------------------------


squid데몬 스타트

/etc/rc.d/init.d/squid start



--------------------- 투명 프락시 사용할시 ---------------------------


투명 프락시를 사용할 경우에는 내부 네트워크(192.168.0.0)가 필요하고

공인 아피를 가진 리눅스가 한대 있다고 가정하고 이 리눅스에는 랜카드가 두개 있어야한다.

즉 리눅스 gateway서버로 돌아가는 리눅스가 한대 필요하다. gateway설정은 kldp를 참조하라.

gateway설정은 잘 되어있다고 보고

아래와 같은 설정을 게이트웨이의 iptables룰에 추가한다.


혹시 모르므로 아래같은 마스크레이드 룰이 적용 안되었다면 적용해라


iptables -t nat -A POSTROUTING -p TCP -s 0/0 --dport 21 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP -d 0/0 --dport 20 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 25 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 110 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 22 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 23 -j MASQUERADE


echo "###################################################################################"

echo "###                Transparent Proxy with Squid                  ###"

echo "### iptables -t nat -A PREROUTING -p TCP --dport 80 -j REDIRECT --to-port 3128  ###"

echo "###################################################################################"



그리고 squid.conf에 다음의 설정을 추가한다.


httpd_accel_host virtual

httpd_accel_port 80

httpd_accel_with_proxy on

httpd_accel_uses_host_header on 

[링크 : http://coffeenix.net/board_view.php?cata_code=0&bd_code=129&bpage=]

Posted by 구차니