Ubuntu Skype enable group chat

/msnp24

simply need to cope and past to someone that is not online
in the chat then restart the skype and you are done

Swiftmailer sending email via gmail.com

 
<?php
 
    $transport = \Swift_SmtpTransport::newInstance('smtp.gmail.com',465)
        ->setUsername('yourusername@yourdomain.com')
        ->setPassword('yourpassword')
        ->setEncryption('ssl')
        ->setAuthMode('login');
 
    $mailer = \Swift_Mailer::newInstance($transport);
 
    $message = \Swift_Message::newInstance()
        ->setSubject('Welcome')
        ->setFrom(array('yourusername@yourdomain.com'))
        ->setTo(array('to@to.com'))
        ->setBody('hello world')
        ->setContentType("text/plain");
 
    $mailer->send($message);

Git restore local branch deleted by mistake

 
1. git reflog | grep pp-auth-r1.1 
response: 592b75b
2. git branch 2.7.4-69179 592b75b

Silex Microframework structure points

1. A bootstrap (app/bootstrap.php) and application file (app/app.php) which could be used by my frontend controller, as well as by PHPUnit/Codeception

2. A web directory that is accessible for the world, containing only index.php and possibly some resources web/index.php

Ubuntu using Lxrandr to position second monitor

lxrandr

saves configuration to: /home/imran/.config/autostart/lxrandr.desktop
sample:

[Desktop Entry]
Type=Application
Exec=xrandr --output HDMI1 --mode 1920x1080 --rate 60.00 --output eDP1 --mode 1920x1080 --rate 60.00 --left-of HDMI1
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_GB]=LXRandR
Name=LXRandR
Comment[en_GB]=To keep laptop on the left handside with monitor in the center
Comment=To keep laptop on the left handside with monitor in the center
imran@imran-Lenovo-Z51-70:~/.config/autostart$

PSR-2 Conding standard checker

vendor/bin/php-cs-fixer fix path/to/folder --level="psr2" -v

The –dry-run option displays the files that need to be fixed but without actually modifying them

vendor/bin/php-cs-fixer fix path/to/file --level="psr2" --dry-run --diff -v

MySQL Profiling

set profiling=1;
call functionname(@functionparam);
show profiles;

Ssh tunnel

Random port tunnelling using a private key:

#!/bin/sh
 
ssh -L 5446:hostname:5446  -i /home/imran/Servers/iaghayev iaghayev@192.168.1.10 -p 2222

Mysql port tunnelling using a private key:

#!/bin/sh
 
ssh -L 3309:127.0.0.1:3306  -i /home/imran/Servers/iaghayev iaghayev@192.168.1.10 -p 2222

Configuring Exim4 on Ubuntu

Use the following utility:

dpkg-reconfigure exim4-config

Rsync examples

cd /home/imran/Projects/pp-frontend
rsync -azP --exclude .git/ --exclude .idea/ --exclude user_guide . imran@192.168.56.101:/var/www/vhosts/httpdocs

Rsync local to remote

cd /home/imran
rsync -avz --exclude default-soapui-workspace.xml --exclude Desktop --exclude Dropbox --exclude "Google Drive" --exclude --exclude NetBeansProjects --exclude PhpstormProjects --exclude Public --exclude Software --exclude "Software Archive" --exclude "Soap UI Configuration" /home/imran/* /home/imran/Google\ Drive

Rsync remote to local

rsync -chavzP kaspi-emlak.com@ssh.kaspi-emlak.com:/www/* /home/imran/Projects/kaspi-emlak-live/www