Skip to content

Instantly share code, notes, and snippets.

@tupywebteam
tupywebteam / gist:6c258fbc16307ab54d1fadff4d0ad64f
Created March 10, 2023 18:17
Enable NodeJS proxy in plesk
location ~ / {
#Change [SITE] by your site.com
proxy_pass http://[SITE]:3000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
@tupywebteam
tupywebteam / README.md
Created July 5, 2022 00:17 — forked from eiri/README.md
Installing Prometheus on Debian

Install Prometheus on Debian

install gosu

just to not wrestle with sudo and exec

$ sudo apt-get update
$ sudo apt-get install gosu

Create prometheus user

@tupywebteam
tupywebteam / Add-ESLint-to-Laravel-Mix.md
Created June 9, 2022 13:11 — forked from EmadAdly/Add-ESLint-to-Laravel-Mix.md
Adding eslint to your Laravel application

1. Add eslint and eslint-loader and eslint-plugin-vue to your projects package.json file

npm i eslint eslint-loader eslint-plugin-vue --save-dev

2. Create a base configuration by --init

@tupywebteam
tupywebteam / xmlsqlite.py
Created May 27, 2022 11:39 — forked from roder/xmlsqlite.py
Convert XML files into SQLite
#!/usr/bin/env python
from optparse import OptionParser
from xml.dom.minidom import parse
import os
import sqlite3
datatypeMap = {
'integer': 'INT',
'datetime': 'DATETIME',
@tupywebteam
tupywebteam / Envoy.blade.php
Created May 12, 2022 12:39 — forked from gvsrepins/Envoy.blade.php
A Laravel envoy script for deployment
@servers(['production' => 'productionserver', 'local'=> '[email protected] -p 2222'])
{{-- Configuration section --}}
@setup
/*
|--------------------------------------------------------------------------
| Git Config
|--------------------------------------------------------------------------
|
@tupywebteam
tupywebteam / laravel_conditional_index_migration.php
Created April 4, 2022 09:58 — forked from Razoxane/laravel_conditional_index_migration.php
Laravel - Create Index If Not Exists / Drop Index If Exists
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LaravelConditionalIndexMigration extends Migration
{
/**
* Run the migrations.
@tupywebteam
tupywebteam / nginx-tuning.md
Created March 31, 2022 11:25 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@tupywebteam
tupywebteam / supervisord.service
Created February 25, 2022 11:25 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
#server side:
#server live directory: /var/www/domain.com
#server repository: /var/repo/site.git
1. clone project from git/bitbucket into /var/www/domain.com or init the folder by "git init".
2. go to /var/repo/site.git and init the folder as git bare
$git init --bare
--bare means that our folder will have no source files, just the version control.