Skip to content

Instantly share code, notes, and snippets.

@zuhairkareem
Last active December 26, 2018 15:53
Show Gist options
  • Select an option

  • Save zuhairkareem/d13d24c40ee74d9d1e604df2c99f55d9 to your computer and use it in GitHub Desktop.

Select an option

Save zuhairkareem/d13d24c40ee74d9d1e604df2c99f55d9 to your computer and use it in GitHub Desktop.
Ubuntu 18.04 Installation

To fix dependency errors

If you get following error while installing php7.1-bcmath extension

The following packages have unmet dependencies:
 php7.1-bcmath : Depends: php7.1-common (= 7.1.17-0ubuntu0.17.10.1) but 7.1.17-1+ubuntu17.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages

Try installing aptitude which will help in fixing dependency tree

 sudo apt-get install aptitude
 sudo aptitude install php7.1-bcmath

Fish Shell

Add directives to config

sudo vim ~/.config/fish/config.fish

phpcs for Drupal

  1. First check if composer is installed which composer

  2. Install PHP 7.2 XML extension if not installed sudo apt install php7.2-xml

To make the phpcs and phpcbf commands available globally, add those to your $PATH variable in ~/.profile, ~/.bash_profile, ~/.bashrc or ~/.zshrc:

export PATH="$PATH:$HOME/.composer/vendor/bin"

In fish shell, use:

set PATH $PATH $HOME/.composer/vendor/bin

  1. Install Drupal Coder composer global require drupal/coder:^8.2.12

4)To register Composer required PHPCS Standards, during Composer install and update, you can use a Composer Installer Plugin for packages of "type": "phpcodesniffer-standard". The dealerdirect/phpcodesniffer-composer-installer package is one such Composer Installer Plugin for PHPCS Standards. composer global require dealerdirect/phpcodesniffer-composer-installer

  1. To get all the installed coding standards - phpcs -i

  2. Goto sudo vim ~/.config/fish/config.fish

And add the following aliases to access the commands faster

alias drupalcs="phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'"
alias drupalcsp="phpcs --standard=DrupalPractice --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'"
alias drupalcbf="phpcbf --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'"

Reload the fish config

source ~/.config/fish/config.fish

Coding standard : – drupalcs file_name/folder

Coding standards :- drupalcsp filename/folder

Automatic coder fix :- drupalcbf filename/folder

Official Doc Reference –

Installing Coder Sniffer :- https://www.drupal.org/node/1419988

PHP CodeSniffer – Command Line Usage :- https://www.drupal.org/node/1587138

Bluetooth Not working in 18.04

sudo apt install git build-essential dkms
git clone https://github.com/jeremyb31/newbtfix-4.15.git
sudo dkms add ./newbtfix-4.15
sudo dkms install btusb/4.0

Ref:- https://askubuntu.com/questions/1032417/ubuntu-18-04-lts-bluetooth-0cf33004-discovery-not-working

Install Nodejs , Yarn

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
## To install Node.js 8.x LTS Carbon and npm
sudo apt-get install -y nodejs


## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

#To solve permission issues during 
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/lib/node_modules

# insall react native cli
npm install -g react-native-cli

Install Android Studio

https://askubuntu.com/questions/634082/how-to-install-android-studio-on-ubuntu#answer-941222

Install netbeans

https://websiteforstudents.com/how-to-install-netbeans-on-ubuntu-16-04-17-10-18-04/

NVM in fish

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
omf install nvm

Android Fish commands

set -x ANDROID_HOME $HOME/Android/Sdk
set -x PATH $PATH $ANDROID_HOME/tools
set -x PATH $PATH $ANDROID_HOME/tools/bin
set -x PATH $PATH $ANDROID_HOME/platform-tools
# Configure android emulator to run directly in terminal.
function emulator
  cd (dirname (whence -p emulator) and ./emulator $argv)
end

# Set alias to shorten command and also fix the side-effect
alias emu="$ANDROID_HOME/tools/emulator"

Setup React Native

https://medium.com/@dooboolab/running-react-native-app-in-ubuntu-18-04-7d1db4ac7518

cd /home/specbee/Android/Sdk/tools/bin
./sdkmanager "system-images;android-27;google_apis_playstore;x86"
./sdkmanager --licenses
touch ~/.android/repositories.cfg
avdmanager create avd -n doo1 -k "system-images;android-27;google_apis_playstore;x86" --device 'Nexus 5X'

User permission issue with emulator

sudo apt install qemu-kvm
sudo adduser <user> kvm

Fish Shell Commands

source ~/.config/fish/config.fish

Install Lando

  1. Install the Docker Community Edition for your Linux version. Visit https://get.docker.com for the "quick & easy install" script.(17.06.1-ce or higher)

  2. Download the latest .deb, .pacman or .rpm package from GitHub

  3. Double-click on the package to launch Software Center

  4. Click the "Install" button and enter your password when prompted

If you have permission denied error for docker start

sudo usermod -a -G docker $USER Logout and Login OR restart the system to affect this change

PHP Fatal error: Uncaught Error: Call to undefined function Drush\UpdateService\simplexml_load_file()

sudo apt install php7.2-xml

Install Visual Studio Code

1)Install it from Ubuntu Software center

2)Setup Xdebug with Lando and VSCode - https://docs.devwithlando.io/tutorials/lando-with-vscode.html

PHP 7.2 extensions

sudo apt-get install php7.2 php7.2-cli php7.2-common libapache2-mod-php7.2 php7.2-mysql php7.2-fpm php7.2-curl php7.2-gd php7.2-bz2 php7.2-json php7.2-tidy php7.2-mbstring php-redis php-memcached php7.2-xml

Add arrow script to GIMP

1) Goto Edit->Preferences->Folders->Scripts, copy the script to that location.
  1. Arrow script - https://web.archive.org/web/20180118203613/http://registry.gimp.org/node/20269

  2. Reload GIMP, goto Tools->Arrow

Password protected SSH key in lando

sudo vim /home/username/.lando/config.yml

Add

containerGlobalEnv:
  LANDO_LOAD_PP_KEYS: "true"

Update Repository error for chrome in 18.04

sudo apt update and add Y

https://askubuntu.com/questions/1090676/how-to-update-google-chrome-70-after-change-in-origin-value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment