Skip to content

Instantly share code, notes, and snippets.

@ayazzali
ayazzali / fast code in Vanilla.Js
Last active October 19, 2018 11:40
только начало
var d = document;
var l=console.log;
/** foreach with adding event to each element **/
var fe=(arr,func=(e)=>console.log(e),eventName='onclick')=>{
for(var z = 0; z < arr.length; z++) {
var elem = arr[z];
elem[eventName]=()=>func(elem)
}
};
@ayazzali
ayazzali / run after reboot (linux).md
Last active November 3, 2018 17:05
or restart after killing

sudo nano /etc/rc.local

/home/ubuntu/afterRestart /usr/bin/dotnet /home/ubuntu/path_to_dll

supervisord

  • nano /etc/supervisor/supervisord.conf
  • and type at the end this:
[program:kai_worker]
@ayazzali
ayazzali / install docker and runner FOR-DEBIAN-IMAGE.md
Last active February 2, 2024 21:32
You can use it right after building new server. Or just for install docker and runner. See if it doesnt work https://docs.gitlab.com/runner/install/linux-repository.html

skip it (if you have firewall)

[spoiler]

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Instruction docker nginx-certbot

  1. open https://github.com/wmnnd/nginx-certbot
git clone https://github.com/wmnnd/nginx-certbot.git
cd nginx-certbot/
ll
nano init-letsencrypt.sh
nano data/nginx/app.conf