tag:blogger.com,1999:blog-1745494433303165972024-03-06T05:24:05.074+02:00SpiralOutUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-174549443330316597.post-44250685281785646562016-10-10T19:05:00.000+03:002016-10-10T20:30:30.051+03:00Docker WordPress MySQL phpMyAdmin stack<h1>
</h1>
<br />
<h3>
<a class="anchor" href="https://github.com/SpiralOutDotEu/docker-wordpress#start-wordpress-in-docker-with-only-2-commands" id="user-content-start-wordpress-in-docker-with-only-2-commands"><svg class="octicon octicon-link" height="16" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Start WordPress in docker with only 2 commands</h3>
<h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5r-F_6P5CjeKIoK0PNmF1vPX6adjHzclCiQtNuAxW7EJQCjoOzaDhuH2unRRm3wPKheOujzSS7jeg0BZqDiBNeoN8jk0nukzZRgAy2b9f925nohjF4m7gbCBuePRyveXGd3tsqpL0iAI/s1600/docker-wordpress-logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="261" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5r-F_6P5CjeKIoK0PNmF1vPX6adjHzclCiQtNuAxW7EJQCjoOzaDhuH2unRRm3wPKheOujzSS7jeg0BZqDiBNeoN8jk0nukzZRgAy2b9f925nohjF4m7gbCBuePRyveXGd3tsqpL0iAI/s400/docker-wordpress-logo.jpg" width="400" /></a></div>
</h3>
<br />
<a name='more'></a>You need to have docker and docker compose installed.<br />
If you don't have them, see <a href="http://www.spiralout.eu/2015/12/docker-installation-in-linux-mint-and.html">here</a> first.<br />
<br />
<blockquote class="tr_bq">
<pre><span style="background-color: #eeeeee;"><code>$ git clone git@github.com:SpiralOutDotEu/docker-wordpress.git
$ cd docker-wordpress && docker-compose up </code></span></pre>
</blockquote>
<pre><code> </code></pre>
You are ready!<br />
Go to <a href="http://0.0.0.0:8000/">0.0.0.0:8000</a> and start building your WordPress site.<br />
Go to <a href="http://0.0.0.0:8081/">0.0.0.0:8081</a> and play with PhpMyAdmin.<br />
You credentials for phpMyAdmin is what you declared in <span style="background-color: #eeeeee;"><code>docker-compose.yml</code></span> <br />
<blockquote class="tr_bq">
<pre><span style="background-color: #eeeeee;"><code>MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress</code></span></pre>
</blockquote>
If you want to manually edit your files, first you have to change the permisions to <span style="background-color: #eeeeee;">html</span> folder:<br />
<blockquote class="tr_bq">
<span style="background-color: #eeeeee;">$ sudo chmod -R 777 html</span></blockquote>
<br />
You want to move or share your project?<br />
Just share the entire folder. It has the source code in <span style="background-color: #eeeeee;">html</span> folder and the full database with it in <span style="background-color: #eeeeee;">mysql</span> folder.<br />
<br />
<br />
Have fun!Anonymoushttp://www.blogger.com/profile/11407179740533730918noreply@blogger.comtag:blogger.com,1999:blog-174549443330316597.post-14842809112696191312016-06-20T20:18:00.000+03:002017-09-22T02:33:04.967+03:00Upgrade to JHipster 3.4.2 in Ubuntu 16JHipster introduced a nice upgrade utility since version 3.4 but it seems it has some issue when you work in Ubuntu.<br />
This is a workaround to get it working<br />
<br />
<a name='more'></a><br /><br />
First you have to upgrade your NodeJS and npm version to {"node":">=4.4.0","npm":">=2.14.2"}<br />
To do this in Ubuntu you have first to remove the previous version with:<br />
<br />
<script src="https://gist.github.com/SpiralOutDotEu/763f97dbc09b83eb4320d289a83e141c.js"></script>
Then install the newest version with
<br />
<script src="https://gist.github.com/SpiralOutDotEu/a1cf79d00dc31aaadbc5bb3a33d25cf9.js"></script>
Ok i know `curl to sudo bash is bad in many ways` but this one works.
<br />
<br />
If you try `yo jhipster:upgrade` and you end up with errors in write access, here comes something also `bad` but it works.
<br />
<script src="https://gist.github.com/SpiralOutDotEu/ad74c90a0672a2ea845c4ee4924eec81.js"></script>
Now go to your project folder and run `yo jhipster:upgrade` and you are ready.
If you have a better solution please let me know.Anonymoushttp://www.blogger.com/profile/11407179740533730918noreply@blogger.comtag:blogger.com,1999:blog-174549443330316597.post-16966469800039243622016-06-08T21:56:00.001+03:002016-10-10T19:09:22.134+03:00Install JHipster in Ubuntu 16<h3>
JHipster</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://jhipster.github.io/img/logo-jhipster2x.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://jhipster.github.io/img/logo-jhipster2x.png" /></a></div>
<h3>
</h3>
JHipster is a Yeoman generator that will kick start your AngularJS -Java Spring project. It can create all your user administration services (including facebook, twitter and google user types). It can create a bunch of files to handle your entities with a single command (Spring controllers, repositories, REST controller, Angular controllers, forms, views, dialogs and tests)<br />
<br />
<a name='more'></a><br /><br />
<h3>
Install it in Ubuntu 16</h3>
<blockquote class="tr_bq">
<h4>
<i><u><b><span style="background-color: red;"></span> Update for JHipster 3.4.2 version: You'll need to install latest version of NodeJS & npm from source. See how to do it <a href="http://goo.gl/eAQYpQ" target="_blank">here</a></b></u></i></h4>
</blockquote>
You can install all dependencies in Ubuntu 16 by following this instructions:<br />
<br />
<script src="https://gist.github.com/SpiralOutDotEu/370cd1ea588827bad9254d95139f167e.js"></script>
<br />
<h3>
</h3>
<h3>
</h3>
Anonymoushttp://www.blogger.com/profile/11407179740533730918noreply@blogger.comtag:blogger.com,1999:blog-174549443330316597.post-88691829487483050692015-12-29T04:06:00.002+02:002015-12-29T04:22:52.505+02:00Dockervel: A Laravel development environment in Docker<style scoped="" type="text/css">
code
{
background-color: #e7e7e7;
color: black;
font-weight: 450px;
}
</style>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0Gk-i84k_Sks-RyYvyAUVn_ledvS3wiTSiW1_NYyyfY7ueZEbuBWCRH6O-Z2asGQ6NnYeDnjEf52mZAaftNreLMv379OkXxpFPngD5R4cM7D9xilM1hMIXy_eB8M66SL4ImK6oFK_R_J5/s1600/dockervel.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0Gk-i84k_Sks-RyYvyAUVn_ledvS3wiTSiW1_NYyyfY7ueZEbuBWCRH6O-Z2asGQ6NnYeDnjEf52mZAaftNreLMv379OkXxpFPngD5R4cM7D9xilM1hMIXy_eB8M66SL4ImK6oFK_R_J5/s400/dockervel.jpg" width="400" /></a></div>
<h3>
<br /><span id="goog_1202066385"></span><span id="goog_1202066386"></span></h3>
<br />
<h2>
</h2>
<h2>
A complete Laravel development environment in Docker Containers:</h2>
<ul>
<li>Bring Up a Laravel development environment with a single command easy as <code>dup</code></li>
<li>Execute Artisan commands easy as <code>dartisan make:auth</code></li>
<li>Run Composer command easy as <code>dcomposer update</code></li>
<li>Run NodeJS script easy as <code>dnodejs npm install</code></li>
<li>Run gulp watch easy as <code>dgulp-watch</code></li>
<li>Containers managed with docker-compose</li>
<li>Lightweight as it is mostly based in Linux Alpine base image of 5MB.</li>
</ul>
<br />
<a name='more'></a><br />
<h3>
Containers included</h3>
<ul>
<li>Nginx 1.8.0 & PHP 5.6 running in Alpine</li>
<li>MariaDB 5.5 running in Alpine</li>
<li>Redis running in Alpine</li>
<li>Composer PHP running in Alpine.</li>
<li>Artisan running in Debian (alpine is missing some PHP packages) </li>
<li>NodeJS with gulp, grunt and bower -g installed in official node:4.2.2-slim base image</li>
<li>Volumes mounted as containers </li>
</ul>
<h2>
Usage</h2>
Make sure you have <code>docker</code> and <code>docker-compose</code> installed. See <a href="http://www.spiralout.eu/2015/12/docker-installation-in-linux-mint-and.html">here for installing them</a><br />
<ul>
<li>clone this repo: <code>git clone https://github.com/SpiralOutDotEu/dockervel.git</code></li>
<li>cd in: <code>cd dockervel</code></li>
<li>run as su: <code>su</code></li>
<li>add aliases: <code>. ./aliases.sh</code></li>
<li>run: <code>dup</code>
and you have a server running! Hit <code>localhost</code> in your browser and you will see nginx fault message becasuse there is no <code>www/public/index.php</code>.</li>
<li>create new Laravel project: <code>dcomposer-create</code></li>
<li>fix permissions: <code>dpermit</code></li>
<li>change .env: <a href="https://github.com/SpiralOutDotEu/dockervel/blob/master/README.md#configure-laravel-for-mysql">see below for options</a></li>
<li>run artisan commands: <code>dartisan make:auth</code></li>
<li>fix permissions: <code>dpermit</code>
Now you have a registration system active. Go to <code>localhost</code> and register a new user to see that db's are running ok.</li>
<li>npm install: <code>dnodejs npm install</code></li>
<li>gulp install: <code>dnodejs gulp install</code></li>
<li>gulp watch: <code>dulp-watch</code>
Now there is one container running <code>gulp watch</code> and monitors changes on files according your <code>gulpfile.js</code></li>
</ul>
<h2>
aliases</h2>
aliases.sh contains shortcuts to common commands.
run dot space dot /aliashes.sh to activate aliases for this terminal session.<br />
<pre><code>$ . ./aliases.sh
</code></pre>
and now for this terminal session you have aliases like <code>dartisan</code>, <code>dcomposer</code>, <code>dnodejs</code>, <code>dup</code>, <code>dstop</code>. <br />
If you don't want to work with aliases, open the script and see the coressponding commands next to each alias.
In the following document it is supposed that you have executed <code>aliashes.sh</code> as <code>su</code> and you have the aliases active. <br />
<h3>
Create new Laravel Project</h3>
<ul>
<li>create new laravel project: <code>dcomposer-create</code></li>
<li>type <code>localhost</code> in your browser and you see the Laravel welcome screen</li>
</ul>
<h3>
Fix permitions</h3>
since containers have different user in them, you have to change the permisions in www/ folder to be able to write. type:<br />
<pre><code>$ dpermit
</code></pre>
it will simply <code>chmod -R 777 www</code>
Remember to run <code>dpermit</code> after each time the <code>www</code> folder has a new file.<br />
<h3>
Configure Laravel for mysql</h3>
change <code>DB_HOST</code> in <code>.env</code> to point to <code>mysql</code>. This is the name that it is used in docker-compose.yml (<code>link: -mysql:mysql</code>)<br />
<pre><code>DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
</code></pre>
<h3>
Configure Laravel for redis</h3>
change <code>REDIS_HOST</code> in <code>.env</code> to point to <code>predis</code>. This is the name that it is used in docker-compose.yml (<code>link: -redis:predis</code>).<br />
<pre><code>REDIS_HOST=predis
REDIS_PASSWORD=null
REDIS_PORT=6379
</code></pre>
in Laravel 5.2 there are some issues with <code>redis</code> namespace, so to avoid conflicts <code>predis</code> is used.
Also you have to change /config/app.php, and replace:<br />
<pre><code>'Redis' => Illuminate\Support\Facades\Redis::class,
</code></pre>
with<br />
<pre><code>'LaravelRedis' => Illuminate\Support\Facades\Redis::class,
</code></pre>
Use it like:<br />
<pre><code>$redis= LaravelRedis::connection();
$redis->set('name', 'myname');
$redis->get('name');
</code></pre>
<h3>
Running Artisan commands</h3>
type <code>dartisan</code> followed by an artisan command<br />
<pre><code>example:
$ dartisan make:auth
$ dartisan migrate
$ dartisan tinker
</code></pre>
<h3>
Running composer commands</h3>
type <code>dcomposer</code> followed by a composer command<br />
<pre><code>example:
$ dcomposer update
$ dcomposer require predis/predis
</code></pre>
<h3>
Nodejs</h3>
to install node modules in your project run<br />
<pre><code>$ dnodejs npm install
</code></pre>
<h3>
Gulp</h3>
install gulp with:<br />
<pre><code>dnodejs gulp install:
</code></pre>
run gulp once:<br />
<pre><code>dgulp
</code></pre>
add gulp watch:<br />
<pre><code>dgulp-watch
</code></pre>
<h2>
Size</h2>
The size of images is about 750 MB:<br />
<pre><code>* front: 70.05 MB
* mysql: 199.50 MB
* redis: 8.50 MB
* composer: 236.80 MB
* nodejs: 36.09 MB
* artisan 208.80 MB
</code></pre>
The base memory usage for the containers of the server running is about 110 MB.<br />
<pre><code>* front: 18 MB
* mysql: 97 MB
* redis: 1 MB
</code></pre>
<h2>
Credits</h2>
Thanx to:<br />
<ul>
<li><a href="https://github.com/dydx">Josh Sandlin</a></li>
<li><a href="https://github.com/dylanlindgren">Dylan Lindgren</a></li>
<li><a href="https://github.com/tenstartups">10Startups</a></li>
<li><a href="https://medium.com/@tomsowerby">Tom Sowerby</a></li>
</ul>
<span id="goog_1202066385"></span><span id="goog_1202066386"></span>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-174549443330316597.post-587895471231978632015-12-28T19:49:00.000+02:002015-12-29T01:10:00.007+02:00Docker installation in Linux Mint and Ubuntu<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOexQ7Gd1pEeoz0F7AXwObSwSlhvaJxhno_sYbK_UPhSyfFGR4wC7DnyqwFedKze6i_EO8wGgjUiYDiM6sKQRw-N1FSy2r_gbpQ8M0jSUrvhB6vD7ZWpqAUfQc0KduVJpPt1tYwg_ZURhs/s1600/docker-mint.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOexQ7Gd1pEeoz0F7AXwObSwSlhvaJxhno_sYbK_UPhSyfFGR4wC7DnyqwFedKze6i_EO8wGgjUiYDiM6sKQRw-N1FSy2r_gbpQ8M0jSUrvhB6vD7ZWpqAUfQc0KduVJpPt1tYwg_ZURhs/s320/docker-mint.jpg" width="320" /></a></div>
<br />
Docker is an amazing technology that can bring your entire server infrastacture, at your desktop.<br />
And this is how you install Docker and start playing with containers.<br />
<br />
<script src="https://gist.github.com/SpiralOutDotEu/5b5d16129d099016fdb9.js"></script>
Unknownnoreply@blogger.comtag:blogger.com,1999:blog-174549443330316597.post-47034644920873192802015-03-27T09:05:00.002+02:002015-12-28T19:44:06.150+02:00Add floating header to your Blogger blog with simple CSS<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAIYAgVK-ByTVRG9IHKIm9gnsYAnqGRhBomQ62zozIebq65Ew1LzEuZaowr3F1AgRbAEfxBFeZu7kZqsKpCeJopvVvX0i0Jm9jBig9_1z5C84rC17i4x-tygczNDHkeeoS06COX7GyZBFs/s1600/floating_header_to_blogspot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAIYAgVK-ByTVRG9IHKIm9gnsYAnqGRhBomQ62zozIebq65Ew1LzEuZaowr3F1AgRbAEfxBFeZu7kZqsKpCeJopvVvX0i0Jm9jBig9_1z5C84rC17i4x-tygczNDHkeeoS06COX7GyZBFs/s1600/floating_header_to_blogspot.jpg" width="640" /></a>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
There is a simple way to make your blog title to be visible while scrolling. All you have to do is go to 'Template->Customize->Advanced->Add CSS' and override the #header CSS with this:<br />
<a name='more'></a><br />
<script src="https://gist.github.com/SpiralOutDotEu/85b888dac7829025e014.js"></script>
<br />
The first line declares that the position is static at 0 pixels from the top, the z-index with a very high value declares that is in front and the width covers the whole page.
<br />
The second line gives some space for the following section so that it doesn't hide the rest of the contents.
Unknownnoreply@blogger.com