Skip to content

Instantly share code, notes, and snippets.

@rovak73
rovak73 / ssh_new_server
Created February 12, 2021 16:53
Copy ssh key to new user as root
cat ~/.ssh/id_rsa.pub | \
ssh user@192.168.1.25 \
"sudo mkdir /root/.ssh; sudo tee -a /root/.ssh/authorized_keys"
cats my bublic key
pipes it to ssh
ssh connects to my raspberry as ssh user
on remote uses sudo to create /root/.ssh
then uses sudo with "tee -a" to append stdin (which holds the key from first cat) to /root/.ssh/authorized_keys
@rovak73
rovak73 / docker-api-port.md
Created February 8, 2021 21:46 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@rovak73
rovak73 / gist:14fa39fd5e0c5609ca95dee8b482df40
Created August 10, 2020 23:55 — forked from rodo/gist:8560557
Use model default in a Django CreateView
#
# views.py
#
class ResumeNew(ProtectedMixin, CreateView):
model = Resume
form_class = ResumeForm
success_url = '/accounts/profile/'
template_name = 'resume/new.html'
def get_initial(self):
@rovak73
rovak73 / magento-easyengine.conf
Created June 5, 2020 18:47 — forked from VirtuBox/magento-easyengine.conf
Nginx configuration for magento 2.1 with EasyEngine
## Example configuration:
# upstream fastcgi_backend {
# # use tcp connection
# # server 127.0.0.1:9000;
# # or socket
# server unix:/var/run/php5-fpm.sock;
# }
# server {
# listen 80;
# server_name mage.dev;