| #!/bin/bash | |
| sourcedir="$HOME/.local/src/" | |
| mkdir "$sourcedir" | |
| export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' | |
| export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' | |
| function install-dependencies() { | |
| # Install build tools and Mesa VDPAU support. | |
| sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \ | |
| libvdpau-va-gl1 |
| #!/usr/bin/env bash | |
| # gdrive_download | |
| # | |
| # script to download Google Drive files from command line | |
| # not guaranteed to work indefinitely | |
| # taken from Stack Overflow answer: | |
| # http://stackoverflow.com/a/38937732/7002068 | |
| gURL=$1 |
| # Check existing | |
| - name: Ansible check file exists. | |
| stat: | |
| path: /etc/filename | |
| register: file_status | |
| - debug: | |
| msg: "File exists..." | |
| when: file_status.stat.exists | |
| - debug: | |
| msg: "File not found" |
| --- | |
| # SSH server settings, in line with https://stribika.github.io/2015/01/04/secure-secure-shell.html | |
| # Before using, change myhosts to your hosts' nickname and myuser to your username (two instances! make sure you replace both or you'll be locked out of ssh!) | |
| - hosts: myhosts | |
| become: true | |
| remote_user: myuser | |
| tasks: | |
| # Key exchange, ciphers and MACs | |
| - lineinfile: dest=/etc/ssh/sshd_config regexp='^KexAlgorithms' line='KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256' | |
Generally, the Git proxy configuration depends on the Git Server Protocal you use. And there're two common protocals: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.
When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocal. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:
ProxyCommand nc -x localhost:1080 %h %p
When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.
Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.