Skip to content

Instantly share code, notes, and snippets.

View demagu's full-sized avatar

Darek Magusiak demagu

View GitHub Profile
# Delete all Docker containers
# Must be run first because images are attached to containers
docker rm -f $(docker ps -a -q)
# Delete all Docker images
docker rmi -f $(docker images -q)
@demagu
demagu / Generate private and public keys.md
Created October 16, 2016 23:04
Generate private and public keys

Generate private and public keys

openssl genrsa -out jwt.private.pem -aes256 4096
openssl rsa -pubout -in jwt.private.pem -out jwt.public.pem
@demagu
demagu / git-submodule.md
Last active October 1, 2016 14:46
Creating & Managing GIT submodules

Creating GIT submodules

On an existing repo:

Step 1:

git submodule add <remote repository> <local path>

This should return something similar to:

@demagu
demagu / .htaccess
Last active December 6, 2015 01:29
.htaccess rules to improve your SEO
# Enable gzip
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</IfModule>
# Force caching
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
@demagu
demagu / Could-not-restore-untracked-files-from-stash.md
Last active September 8, 2022 17:28
Could not restore untracked files from stash

How to fix 'Could not restore untracked files from stash' issue

Convert a stash to a temporary branch

git stash branch STASHTEMPBRANCH

Apply your stash

git stash apply

sudo service ntp stop
sudo ntpdate -s time.nist.gov
sudo service ntp start
@demagu
demagu / How to edit virtual host settings in cPanel.md
Last active September 21, 2021 08:58
How to edit virtual host settings in cPanel

How to: How to edit virtual host settings in cPanel

Login to your server:

Then:

  • Step 1: mkdir -p /usr/local/apache/conf/userdata/std/2/{username}/{domain.com}

  • Step 2: cd /usr/local/apache/conf/userdata/std/2/{username}/{domain.com}

How to: Upgrade PHP on Vargant Ubuntu 12.04 LTS from 5.3 to 5.5

Login to your Vagrant:

vagrant ssh
sudo su

Then:

  • Step 1: sudo apt-get update &amp;&amp; sudo apt-get install python-software-properties
@demagu
demagu / How-To: Enable MySQL query log in Vagrant.md
Last active June 29, 2018 09:03
How-To: Enable MySQL query log in Vagrant

Enable MySQL query log in Vagrant

Since 5.1 query logging can be enabled at runtime.

Login to your MySQL server

mysql -uroot -p

See current setup

@demagu
demagu / gist:2d5a764280cfe3dd8992
Last active August 29, 2015 14:04
Vargant - xdebug config for puphet
class { 'xdebug':
service => 'apache',
}
puphpet::ini { 'xdebug':
value => [
'xdebug.default_enable=1',
'xdebug.idekey="PHPSTORM"',
'xdebug.remote_enable=1',
'xdebug.profiler_output_dir=/var/www/xdebug-profiler',
'xdebug.profiler_enable_trigger=1',