action | sysvinit | systemd |
---|---|---|
start service | service foo start | systemctl start foo[.service] |
stop service | service foo stop | systemctl stop foo[.service] |
restart service | service foo restart | systemctl restart foo[.service] |
reload service | service foo reload | systemctl reload foo[.service] |
service status | service foo status | systemctl status foo[.service] |
restart if running | service foo condrestart | systemctl condrestart foo[.service] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have run an nginx container... | |
docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg | |
I want to use strace for debug: | |
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin --cap-add sys_ptrace bash | |
I can see the nginx process: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -r -nc -p --html-extension -k -D google.com -np https://landing.google.com/sre/book/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Follow instructions here to enable dev mode and start VM | |
# https://github.com/lstoll/cros-crostini/blob/master/README.md | |
sudo apt-get update | |
sudo apt-get install -y libasound2 libxss1 wget | |
wget -qO- https://go.microsoft.com/fwlink/?LinkID=620884 | tar xvz | |
# Launch code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###Deploy SSH key to ansible inventory### | |
for server in $(ansible --list-hosts all); do ssh-copy-id -i ~/.ssh/id_rsa.pub $server; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: "v1" | |
kind: Pod | |
metadata: | |
name: test | |
labels: | |
name: test | |
spec: | |
containers: | |
- name: nginx | |
image: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -f out | |
mkfifo out | |
trap "rm -f out" EXIT | |
while true | |
do | |
cat out | nc -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out". | |
export REQUEST= | |
while read line | |
do | |
line=$(echo "$line" | tr -d '[\r\n]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.7 nginx -V | |
nginx version: nginx/1.13.0 | |
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) | |
built with OpenSSL 1.0.2g 1 Mar 2016 | |
TLS SNI support enabled | |
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run | |
/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-p | |
ath=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_mod | |
ule --with-http_geoip_module --with-http_gzip_static_module --with-http_sub_module --with-http_v2_module --with-stream --with-stream_ssl_mo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PCRE_VERSION="8.38" | |
XZ_UTILS_VERSION="5.2.2" | |
AG_VERSION="0.31.0" | |
PCRE_URL="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PCRE_VERSION}.tar.gz" | |
XZ_URL="http://tukaani.org/xz/xz-${XZ_UTILS_VERSION}.tar.gz" | |
AG_URL="http://geoff.greer.fm/ag/releases/the_silver_searcher-${AG_VERSION}.tar.gz" | |
WORK_DIR="${TMPDIR:-/var/tmp/}" | |
pushd ${WORK_DIR} |