Skip to content

Instantly share code, notes, and snippets.

@zainengineer
zainengineer / valet-notes.md
Last active January 10, 2024 05:34
valet-plus

Installation

Switching not working

vi ~/.bash_profile
#to find the file
#grep -s valet  ~/.* | grep -v ".bash_history" 

#and probably not do the following

@zainengineer
zainengineer / forgotten.sh
Created September 13, 2019 04:20
msic linux
#part of selinux (security enhance linux)
#as root allows php or similar to download remote urls
setsebool -P httpd_can_network_connect 1
@zainengineer
zainengineer / quick_quick.md
Created September 13, 2019 00:17
git info

Reflg with relative date

git reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)

@zainengineer
zainengineer / set upstream not working
Last active November 3, 2022 08:00
git branch set upstream
#did not help but tried any ways
git config --global branch.autosetupmerge always
git config --global pusg.default current
#pull one might not be a real thing but putting it as makes sense
git config --global pull.default current
git config --global pull.default simple
git push -u origin HEAD
git config pull.default tracking
@zainengineer
zainengineer / mysql mariadb root password reset
Last active September 6, 2019 12:24
mysql mariadb root password reset
sudo mysql_secure_installation
#its sometimes enough
some time usual approach of passwords reset does not work
https://superuser.com/a/949768/366778
SELECT user, plugin FROM user;
UPDATE user SET plugin="";
@zainengineer
zainengineer / setup.sh
Last active July 3, 2019 06:29
drupal /magento digital ocean
#currently for drupal but can be easily be tested and improved for magento
apt-get install -y php-mbstring
apt-get install -y php-xmlwriter
apt-get install -y php-dom php-curl php-bz2
apt-get install -y zip unzip php7-zip
apt-get install -y zip unzip
apt-get install -y php-xml php-tidy
sudo service apache2 restart

Copy path name

  1. right click file
  2. Hold down options button (Alt button)
  3. copy "file_name.ext" will change to copy "file_name.ext" as Pathname

Port listen

lsof -nP -i4TCP:9000 | grep LISTEN

@zainengineer
zainengineer / composer
Created March 20, 2019 00:57
composer quickes
for private packages/magento modues consider using
"repositories": [
{"type":"artifact","url":"packages/"},
where packages/ has multiple zip files like vendor1_ext1.zip, vendor2_ext2.zip
and you just need to do composer require vendor1/ext1
composer will find in packages zipped files and get the required extensions
@zainengineer
zainengineer / magento 2 cheat sheet
Last active November 26, 2019 06:30
magento 2 cheat sheet
* 98-magerun2 db:dump --add-time prefix
//do not complain about setup scripts
// Use n98-magerun2.phar dev:console
\Magento\Framework\App\ObjectManager::getInstance()->get('\Magento\Framework\Config\CacheInterface')->save(serialize(true),'db_is_up_to_date');
https://marketplace.magento.com/customer/accessKeys/
Public Key: b...
Private Key: 0....
curl http://127.0.0.1 -H 'Host: example.com' -H 'X-Forwarded-Proto: https'
curl https://127.0.0.1/ -H 'Host: example.com' -H 'X-Forwarded-Proto: https' --insecure
curl http://httpbin.org/headers -H 'Host: httpbin.org' -H 'X-Forwarded-Proto: https'