Skip to content

Instantly share code, notes, and snippets.

@Mrkisha
Mrkisha / gist:0fd2d252ba67061a949fbf0ce53b0d5c
Created June 16, 2016 11:38 — forked from Suave/gist:6127873
mysql: truncate all tables in one command line
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done
@Mrkisha
Mrkisha / dumpDbToFile.sh
Created June 22, 2016 11:25
Bash command to dump database into file with content and append timestamp to file
mysqldump -u <user> --password=<password> <database> > ~/somefolder/some-file-name-$(date -d "today" +"%Y%m%d%H%M").sql
@Mrkisha
Mrkisha / recreateDB.sh
Created June 22, 2016 11:27
Cli to recreate database without structure and content
#!/bin/bash
mysqladmin -u<user> -p<password> drop <database>
mysqladmin -u<user> -p<password> create <database>
@Mrkisha
Mrkisha / remove-docker.sh
Created November 17, 2016 16:14
Bash script to remove all docker images
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@Mrkisha
Mrkisha / dockerGetIP.sh
Created November 18, 2016 14:35
Get IP of docker container
docker inspect <container ID> | grep IPAddress | cut -d '"' -f 4
@Mrkisha
Mrkisha / BookController.php
Created December 10, 2016 21:36 — forked from silviuvoicu/BookController.php
Spec with phpspec a symfony2 controller. I know which is the normal work flow: write first the spec, and then the code, but in order to understand better how to spec a symfony2 controller, I first create a simple book entity with just id and name, and then with the help of generators I created a crud system, which I modified a little. Then havin…
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\DemoBundle\Entity\Book;
@Mrkisha
Mrkisha / switchphp.sh
Created March 16, 2017 22:49
Switch between php version on debian/ubuntu
sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
@Mrkisha
Mrkisha / deploy.yaml
Created March 17, 2017 22:58 — forked from mblarsen/deploy.yaml
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
# Problem:
#
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
#
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
#
- hosts: webserver
vars:
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@Mrkisha
Mrkisha / commands.sh
Created April 6, 2017 11:08
Usefull Linux commands
# To find all socket files on your system
sudo find / -type s