- Tools I used for development
- Methods I used for create protobuf files
- Backup docker images for all service I used
- and more..
- Mysql 5.7 docker image
- Php 8.0.7 with asdf
- SQL Server docker image
- Stop nodes (pids) Script
- Compiling Protobuf Files
- Export MySQl tables to Go struct
- Git Credential Manager Core (create a secure way to store git username/passwords (ubuntu))
- Curl message and data validation to Bash
- PostgreSql (Latest) docker image
- XDebug PHP 8.0.7 in asdf install
-
Archive: mysql57.yaml
-
Image Description mysql57.yaml Create a mysql instance for version 5.7 (create a adminer image in localhost:9898 to connect into mysql database via php) -
Create the folder:
/home/[user]/dockers/mysql57/conf.d/- In
conf.ddirectory create a text file calledmy.confwith: -
[mysqld] max_connections=200
- In
-
Create the folder:
/home/[user]/dockers/mysql57/db
Requirments: [
- Install all necessary packages
sudo apt install -y pkg-config build-essential autoconf bison re2c \
libxml2-dev libsqlite3-dev libcurl4 libcurl4-openssl-dev \
libgd-dev libonig-dev libpq-dev libzip-dev- Then install php 8.0.7
asdf plugin-add php
asdf install php 8.0.7- Start server with:
docker run --name mssql -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=bfd972@!' -p 1433:1433 -d mcr microsoft.com/mssql/server:2017-latest- Create a stop_nodes.sh file with:
#!/bin/bash
# declare all ports are used
declare -a portsServices=("9000" "9001" "9002" "9003" "9004" "9005" "9006" "9007")
# get length of array
portArrayLength=${#portsServices[@]}
# Kill all ports if exists
for (( i=1; i<${portArrayLength}+1; i++ ));
do
echo "Killing port: - " $i " / " ${portArrayLength} " : " ${portsServices[$i-1]}
echo "Killing PID: " $(lsof -t -i:${portsServices[$i-1]})
lsof -n -i:${portsServices[$i-1]} | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
done- Make executable with
chmod +x stop_node.sh
- See protobuf folder
readme.mdfile
- Clone the repository:
https://github.com/xxjwxc/gormt - Compile
- Configure
config.xmlfile to your database - Execute
./gormt
- For remote repositories we don't have access to use ssh key
- Download the last
.debrelease of credential manager core: Here - Install package
sudo dpkg -i <path-to-package> - Configure the gui (if have (in ubuntu, will open in terminal only))
export GCM_CREDENTIAL_STORE=secretservice
or
git config --global credential.helper store secretservice
- Finish, after the next time you needed to use the username/password, they will store your data encrypted saffely.
- See curlToVariable.sh archive in this directory
-
Archive: postgresql.yaml
-
Image Description postgresql.yaml Create a PostgreSQL instance for version (latest) (create a adminer image in localhost:9797 to connect into PostgreSQL database via php) -
Create the folder:
/home/$(whoami)/dockers/postgresql -
Run docker-compose:
docker-compose -f postgresql.yaml up -
Backup volumes from postgree folder:
https://stackoverflow.com/a/57773315/9397637
1 - Download xdebug-3.0.4.tgz
2- Install the pre-requisites for compiling PHP extensions: apt-get install php-dev autoconf automake
3 - Unpack the downloaded file with tar -xvzf xdebug-3.0.4.tgz
4 - Run: cd xdebug-3.0.4
5 - Run: phpize (See the FAQ if you don't have phpize).
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20200930
Zend Extension Api No: 420200930
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
6 - Run: ./configure
7 - Run: make
8 - Run: cp modules/xdebug.so /home/$(whoami)/.asdf/installs/php/8.0.7/lib/php/extensions/no-debug-non-zts-20200930
9 - Create /home/$(whoami)/.asdf/installs/php/8.0.7/php.ini and add the line
[xdebug] zend_extension = /home/$(whoami)/.asdf/installs/php/8.0.7/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so xdebug.mode=debug xdebug.client_host=127.0.0.1 xdebug.client_port=9010
10 - Test php --version you need to see a return like this:
PHP 7.3.6 (cli) (built: Jul 8 2021 13:39:39) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
if any error like "Xdebug requires Zend Engine API version 420200930." use the tutorial in: https://xdebug.org/wizard
- Open Run -> Edit Configurations...
- Create new 'PHP Built-in Web Server'
- Set values:
Host: localhost
Port: 8000
- Document root: select Laravel's public catalog/directory
- Check Use route script and select server.php in Laravel projects root directory.
- Interpreter options:
- Xdebug ^2.*:
-dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1
- Xdebug ^3.*:
-dxdebug.mode=debug -dxdebug.start_with_request=trigger -dxdebug.client_port=9003 -dxdebug.client_host=127.0.0.1
- click OK and run.
- In chrome/firefox configure a
pagescript for start debug session for PHPStorm:- Start script:
javascript:(/** @version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()
- Stop script:
javascript:(/** @version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()
- Start script: