Tuesday 4 May 2021

How to solve composer's InvalidArgumentException Errror in Drupal 8?



When issuing a composer require drupal/csv_serialization command as per the documentation advice,


I'm getting back a report that there is no matching version...[InvalidArgumentException] Could not find a matching version of package drupal/csv_serialization. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).





Solution: composer config repositories.drupal composer https://packages.drupal.org/8



Friday 6 November 2020

How to update ntp server in CENTOS 7-8?

To Check the hardware clock
#hwclock

To check the system clock
#timedatectl


To set the ntp on
#timedatectl set-ntp yes
 

To set the time
#timedatectl set-time HH:MM:SS
 

To start and enable ntpd services
#sudo systemctl start ntpd
#sudo systemctl enable ntpd
 

To set time to ntp server
#ntpdate -u clock.ncbs.res.in && hwclock -w

Tuesday 30 June 2020

Update Drupal 8 using composer

How to update Drupal using composer.

** On Drupal 8


composer show drupal/core-recommended    --check
composer outdated "drupal/*"


drush sql:dump > /root/drush-backups/name+date.sql
drush archive-dump > /root/drush-backups/name+date.sql

drush state:set system.maintenance_mode 1
drush cache:rebuild
composer update drupal/core-recommended --with-dependencies
drush cache:rebuild
drush state:set system.maintenance_mode 0
drush cache:rebuild

*** Optional -> composer update drupal/core --with-dependencies
*** Optional -> composer require 'drupal/core-recommended:^8.9' --update-with-all-dependencies
*** Optional -> composer require drupal/core-recommended:8.9.x-dev --update-with-all-dependencies

Monday 15 June 2020

How to build an Android app for production using Native-script?

How to build an Android app using Native-script?


First of all you need to open native android studio and create a .jks file key. Please store your .jks file in safe location so that you can use for next update. For the every update you have to use .jks file. In case you lose , you need build an app with new package name and create a new .jks file.

Please refer to https://developer.android.com/studio/publish/app-signing for creating .jks file.


The below are the three options to release an Android App to production in Nativescript.


1) .apk


tns build android --release --key-store-path [your key path to .jks file] --key-store-password [your key password] --key-store-alias [your key alias] --key-store-alias-password [your key store password]


2) .abb file . It is good for app size reduction. 


tns run android  --release --key-store-path [your key path to .jks file] --key-store-password [your key password] --key-store-alias [your key alias] --key-store-alias-password [your key store password] --aab

3) .abb file with customisation

tns run android  --bundle --env.uglify --env.aot --env.snapshot  --release --key-store-path [your key path to .jks file] --key-store-password [your key password] --key-store-alias [your key alias] --key-store-alias-password [your key store password] --aab --copy-to app1.aab



Kindly note that Blank NativeScript projects for Android are ~12MB by default because they include three copies of the NativeScript runtime built for different Android CPU architectures.

Tuesday 5 May 2020

How to install Drush using CGR and Composer.

How to install Drush using CGR and Composer 

 

* Tested on Ubuntu 18.04


1. Install the composer Globally using the below commands 


php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 
'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24
ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } 
else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
 

2. Move the downloaded 


mv composer.phar /usr/local/bin/composer 
 
* If you like to install it only for your user and avoid requiring root permissions,
you can use ~/.local/bin instead which is available by default on some
Linux distributions.
 

3. Install CGR


Add the path in /etc/environment like 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/.config/composer:$HOME/.config/composer/vendor/bin"

Export the path in ~/.bashrc like 
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
export PATH="$(composer config -g home)/vendor/bin:$PATH"

cd ~
composer global require consolidation/cgr


4. Install Drush using CGR


cgr drush/drush [For the latest version]

cgr drush/drush:7.* [For drush 7]


5. Create symbolic link inside the /usr/bin to work on drush Globally

  

Saturday 4 March 2017

Sample Typescript Programs

//save it as TalkingHands.ts
//compile it in command prompt as - tsc talkinghandsts

function TalkingHands(Deaf) {
    return "Hello, " + Deaf;
}

var user = "I am a Deaf User";

document.body.innerHTML = TalkingHands(user);



Using Interfaces 

interface Deaf
{

    name: string; // varibale declaration

}

//paramter deaf -- Interface Deaf
function TalkingHands(deaf:Deaf) {
    return "Hello, " + deaf.name;
}
// variable user refers to the name String
//name property of the string
var user = {name:"I am a Deaf User"};

document.body.innerHTML = TalkingHands(user);


using classes 

class DeafBoys
{
    question: string;
    constructor(public name)
    {
        this.question = name;

    }

}
interface Deaf
{

    name: string; // varibale declaration

}

//paramter deaf -- Interface Deaf
function TalkingHands(deaf:Deaf) {
    return "Hello, " + deaf.name;
}
// variable user refers to the name String
//name property of the string
var user = new DeafBoys("Yes I am Deaf user");
document.body.innerHTML = TalkingHands(user);

How to write sample Typescript Program?