Skip to content

Instantly share code, notes, and snippets.

View habibun's full-sized avatar

Habibun Noby habibun

  • Eon Infosys Technology
  • Dhaka, Bangladesh
View GitHub Profile
@habibun
habibun / mysqld.cnf
Created January 25, 2020 06:03
ubuntu 18.04 remote root login
To list open ports use the netstat command:
netstat -tulpn | grep LISTEN
change config:
/etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
login mysql and run:
Grant All Privileges ON *.* to 'user'@'%' Identified By 'pass';
FLUSH PRIVILEGES;
@habibun
habibun / config
Last active May 6, 2020 16:39
ssh alias ubuntu in .ssh/config
run cmd: ssh-copy-id -p port root@host
Host a
HostName x.x.x.x
User root
Port 22
Host b
HostName x.x.x.x
User root
Port 22
@habibun
habibun / virtual_host_nginx
Created December 27, 2019 15:08
Magento2 virtual host nginx php7.2 fpm
server {
server_name magento2.dev;
set $MAGE_ROOT /Users/yourusername/www/magento2dev;
set $MAGE_MODE developer;
# Default magento Nginx config starts below
root $MAGE_ROOT/pub;
index index.php;
@habibun
habibun / php-fpm-apache2
Created September 23, 2019 16:47
PHP-FPM with Apache 2.2
<VirtualHost *:80>
ServerName xxx.local
ServerAlias www.xxx.local
AddHandler php7-fcgi .php
Action php7-fcgi /php7-fcgi
Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi
# FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -host 127.0.0.1:9000 -pass-header Authorization
FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php7.2-fpm.sock -pass-header Authorization
@habibun
habibun / nginx_symfony4_virtualhost
Created September 12, 2019 11:24
nginx symfony 4 virtual host
server {
server_name xxx.local www.xxx.local;
root /var/www/project/public;
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
@habibun
habibun / nginx_symfony2_virtual_host
Created September 12, 2019 11:18
nginx symfony2 virtual host
server {
server_name xxx.local www.xxx.local;
root /home/xxx/xxx/domain/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app_dev|config)\.php(/|$) {
@habibun
habibun / backup-script.sh
Last active September 4, 2019 10:17
dump-mysql-script
#!/usr/bin/env bash
echo "clearing backup folder......................................................................................";
rm -vrf ~/Backup/*
echo "ending clearing backup folder................................................................................";
echo "............................................................................................................";
echo "starting dumping............................................................................................";
echo "............................................................................................................";
current_date_time="`date "+%d_%m_%Y_%H_%M_%S"`";
@habibun
habibun / s
Created March 20, 2019 11:46
s
<?php
namespace Eit\Bundle\UserBundle\Form;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
install and configure:
https://github.com/sanduhrs/phpstorm-url-handler
@habibun
habibun / 20-xdebug.ini
Created November 19, 2018 09:32
Xdebug configuration with phpstorm file linking symfony
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.max_nesting_level=300
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.profiler_enable=1