Skip to content

Instantly share code, notes, and snippets.

View lyovkin's full-sized avatar
🏠
Working from home

Anatoliy Lyovkin lyovkin

🏠
Working from home
View GitHub Profile
@lyovkin
lyovkin / sh
Last active February 1, 2018 11:27
Create a user and restrict him to his home dir (sftp)
sudo groupadd sftpusers
sudo adduser importer
sudo chown root:root /home/importer
sudo usermod importer -g sftpusers
sudo mkdir /home/importer/data
sudo chown -R importer:sftpusers /home/importer/data
-------------------------
sftp access configuration
-------------------------
/usr/local/kong/logs/error.log
@lyovkin
lyovkin / sh
Created February 1, 2018 11:35
sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up
ports:
- 127.0.0.1:ex_port:in_port
@lyovkin
lyovkin / text
Last active September 1, 2020 09:27
https://www.digicert.com/kb/csr-ssl-installation/nginx-openssl.htm#ssl_certificate_install
https://gist.github.com/jexchan/2351996
@lyovkin
lyovkin / gist:b4d19632a69f6fc78f527cfd31e4fdaf
Created December 18, 2018 11:47
Proxy docker registry
https://github.com/moby/moby/issues/22635#issuecomment-356842194
execute 'ps -ef | grep nginx'
get root nginx process
execute 'sudo kill 9 <process>'
execute 'sudo service nginx start'
Creating space by removing container logs
Similarly, the docker needs sufficient space in /var/lib/docker to write into it. So users get an error when the space is insufficient. Hence to create more space in the container, we remove large log files.
Our Support Engineers first list the log files. For this, we use the command,
du -d1 -h /var/lib/docker/containers | sort -h
The output of this command lists the container directories and log size. Hence, to clear the container log we use the command,
cat /dev/null > /var/lib/docker/containers/container_id/container_log_name
But, if there is no root access then we use the below command to prevent permission errors.
apt-get update
apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances ca-certificates | grep "^\w")
sed '/DST_Root_CA_X3.crt/d' /etc/ca-certificates.conf > /tmp/cacerts.conf && mv /tmp/cacerts.conf /etc/ca-certificates.conf
dpkg-reconfigure ca-certificates