Skip to content

Instantly share code, notes, and snippets.

View drakakisgeo's full-sized avatar

Drakakis George drakakisgeo

View GitHub Profile
@drakakisgeo
drakakisgeo / gist:0f50d1cf485d92b75570
Last active August 29, 2015 14:05
Web Development Conferences / Meetups in Greece
@drakakisgeo
drakakisgeo / gist:b28ec96dab47bff8844a
Created September 9, 2014 09:42
Install phantomjs in Ubuntu
Taken from = https://coderwall.com/p/rs63ea
For 32-bit system use phantomjs-1.9.0-linux-i686.tar.bz2
For 64-bit system use phantomjs-1.9.0-linux-x86_64.tar.bz2
Go to the SHARE directory cd /usr/local/share
@drakakisgeo
drakakisgeo / gist:12cebcd516ffee65a746
Created September 28, 2014 16:05
Fix for SSL CURL problem ( not validated self-signed certificates)
1. Get the file cacert.pem from http://curl.haxx.se/docs/caextract.html
2. store it somewhere like /etc/php5/apache2
3. Put this line in your php.ini (/etc/php5/apache/php.ini)
curl.cainfo=/etc/php5/apache2/cacert.pem
4. All set!
@drakakisgeo
drakakisgeo / gist:2c756f2e6c1d0c3720e5
Created October 26, 2014 16:47
Preventing Cron Job Collision (File system lock file - Laravel indatus/dispatcher)
public function fire()
{
//// Preventing Cron Job Collision
$file = "/var/www/tick/cronlock";
$fp = fopen($file, 'r+');
if(!flock($fp, LOCK_EX | LOCK_NB)) {
$this->error('Cron is already running another task...');
exit(-1);
}
@drakakisgeo
drakakisgeo / gist:a6bacfaf1b15b49bc4ff
Created October 28, 2014 08:40
PhpStorm Font Rendering Ubuntu (note)
> Removed
-Dawt.useSystemAAFontSettings=lcd
> Added
-Dswing.aatext=true
-Dawt.useSystemAAFontSettings=gasp
-Dsun.java2d.xrender=true
@drakakisgeo
drakakisgeo / gist:591649190564fe57a4cd
Last active August 29, 2015 14:17
Mailcatcher Codeception Nth($num)
<?php
/**
* See In nth Email
*
@drakakisgeo
drakakisgeo / gist:3bba2a2600b4c554f836
Created May 7, 2015 13:51
Auto trim all input [Laravel 5]
// Step 1. Create this class in the middleware folder.
<?php namespace App\Http\Middleware;
use Closure;
class BeforeAutoTrimmer {
/**
* Handle an incoming request.
clip < ~/.ssh/id_rsa.pub
@drakakisgeo
drakakisgeo / gist:a8bfd7a3f1dddde2cff9
Created July 20, 2015 14:19
RestWs in Drupal Installation ~ Drush
drush dl restws
drush en restws
drush role-add-perm 'anonymous user' 'access resource node'
@drakakisgeo
drakakisgeo / gist:393b7bdff9e1074679ff
Created September 21, 2015 12:24
My deployphp/deployer notes
1. Make sure the ssh public key of your development is added to the live server. This way you won't need a passowrd. Test this by connecting to it directly ssh user@liveserver
2. Login to live server by `ssh user@liveserver` and create a new ssh key by `ssh-keygen`. MAKE SURE NOT TO INSERT A PASSWORD.
3. Add this public key to your bitbucket or github account that your repository is stored.
4. Make sure that the deploy.php script connects to git without https, for example = set('repository', 'git@bitbucket.org:gdrakakis/checkout.git');
5. Run dep deploy production -vvv to see exacty the running comands.
CPANEL users
---------------
If you can't connect to your live server with ssh, make sure that the user can connect to the server with SSH.
To do this go to "Manage Shell Access" of WHM, select the user and assign him "Normal Shell*"