Skip to content

Instantly share code, notes, and snippets.

View jorgehs91's full-sized avatar

Jorge Henrique jorgehs91

  • Brasil
View GitHub Profile
@jorgehs91
jorgehs91 / gist:b16af5daa2a384e02280fe9322478e09
Last active April 6, 2024 14:49
Adding php alternatives in Fedora
sudo alternatives --install /usr/bin/php php /usr/bin/82 1
# In case some error related to `/usr/bin/php` already exists, just remove it and run the above command again. It will recreate the file as a symlink.
# Then you can add the different versions:
sudo alternatives --install /usr/bin/php php /usr/bin/81 2
sudo alternatives --install /usr/bin/php php /usr/bin/74 3
# Finally, to change the current version:
sudo alternatives --config php
@jorgehs91
jorgehs91 / database.sh
Last active May 24, 2021 21:36 — forked from spalladino/mysql-docker.sh
Backup and restore database routines
# Get regular database gziped
mysqldump -h <database host> --user=<database username> --password=<password> --single-transaction <database name> | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | gzip > /tmp/database_no-definer.sql.gz
# Restore regular database gziped
zcat /tmp/database.sql.gz | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | mysql -h <database_host> -u <username> -p <password> <database_name>
# Get database from docker container
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore database to docker container
@jorgehs91
jorgehs91 / xdebug.ini
Last active September 30, 2021 18:24
Xdebug setup
## Xdebug 2.9.8
zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_autostart=true
xdebug.max_nesting_level=1024
## Xdebug 3
xdebug.mode=develop,debug
xdebug.client_host=172.17.0.1
@jorgehs91
jorgehs91 / magento2.dev-vhost.conf
Created April 15, 2021 20:55 — forked from Sorbog/magento2.dev-vhost.conf
Magento 2 Apache Virtual Host Configuration
<VirtualHost *:80>
ServerName magento2.dev
SetEnv MAGE_RUN_CODE "base"
SetEnv MAGE_RUN_TYPE "website"
DocumentRoot "/var/www/html/magento2.dev/pub"
<Directory "/var/www/html/magento2.dev/pub">
AllowOverride All
Order Allow,Deny
@jorgehs91
jorgehs91 / fedora-setup.py
Last active April 23, 2021 18:02
OS initial setup
#! /usr/bin/python3
import os
apps = ['wget','curl','git','google-chrome','zsh','snapd','htop']
snapsClassic = ['code','phpstorm','datagrip','gitkraken','slack']
snaps = ['spotify','inkscape']
# Linux dfn install
print('\nInstalling native Apps')
@jorgehs91
jorgehs91 / .stylelintrc.json
Last active October 27, 2020 12:15
Stylelint Magento 2 setup object
{
"rules": {
"indentation": 4,
"block-opening-brace-space-before": "always",
"block-opening-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"selector-list-comma-newline-after": "always",
"string-quotes": "single",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",