Wednesday 1 November 2023

Install Cypress on Mac M1

 Hemeshs-MacBook-Pro:~ hemepate$ brew install node

Running `brew update --auto-update`...

==> Homebrew collects anonymous analytics.

-----

Hemeshs-MacBook-Pro:~ hemepate$ node --version

v21.1.0

-------

Hemeshs-MacBook-Pro:~ hemepate$ npm install -D cypress

or 

Hemeshs-MacBook-Pro:~ hemepate$ npm install -D cypress@10.3.1


--------
Hemeshs-MacBook-Pro:~ hemepate$ npx cypress@10.3.1 open
It looks like this is your first time using Cypress: 13.4.0

✔  Verified Cypress! /Users/hemepate/Library/Caches/Cypress/13.4.0/Cypress.app

Opening Cypress...

DevTools listening on ws://127.0.0.1:57589/devtools/browser/0c5f9115-afc1-4b9d-9c87-efdae1f2757f
Hemeshs-MacBook-Pro:~ hemepate$

Wednesday 29 July 2020

Install python packages in pycharm without Project Interpreter

In Pycharm, Generally you can install python packages through interpreter by following steps..

In Pycharm

  • Press Ctr + Alt + s
  • On left, Project <your project here> > Project Interpreter
  • On right, click on +
  • At the top, search for boto3
  • At the bottom, click on Install Package

But if it doesn't help then , follow the steps:

1. run following command in new python file, and find the python current path.

import sys
print (sys.executable)


2. Install the package from that location using correct pip with --user option.

hem-mac:bin hemepate$ pwd
/Users/hem/Documents/Oracle/Docs/MachineL/Ex_Files_ML_EssT_Recommendations/Exercise Files/venv/bin

hemepate-mac:bin hemepate$ pip3 --user install boto3 Usage: pip3 <command> [options] no such option: --user hem-mac:bin hemepate$ pip3 install --user boto3 Collecting boto3 Using cached boto3-1.14.30-py2.py3-none-any.whl (129 kB) Collecting s3transfer<0.4.0,>=0.3.0 Using cached s3transfer-0.3.3-py2.py3-none-any.whl (69 kB) Collecting botocore<1.18.0,>=1.17.30 Using cached botocore-1.17.30-py2.py3-none-any.whl (6.4 MB) Collecting jmespath<1.0.0,>=0.7.1 Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB) Collecting python-dateutil<3.0.0,>=2.1 Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) Collecting urllib3<1.26,>=1.20; python_version != "3.4" Using cached urllib3-1.25.10-py2.py3-none-any.whl (127 kB) Requirement already satisfied: docutils<0.16,>=0.10 in /usr/local/lib/python3.8/site-packages (from botocore<1.18.0,>=1.17.30->boto3) (0.15.2) Collecting six>=1.5 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Installing collected packages: six, python-dateutil, jmespath, urllib3, botocore, s3transfer, boto3 Successfully installed boto3-1.14.30 botocore-1.17.30 jmespath-0.10.0 python-dateutil-2.8.1 s3transfer-0.3.3 six-1.15.0 urllib3-1.25.10

Thursday 9 July 2020

Install python packages in Anaconda Navigator


hemepate-mac:bin hemepate$ pwd
/Users/hemepate/anaconda3/bin

hemepate-mac:bin hemepate$ ls -lrt pip*
-rwxrwxr-x  1 hemepate  staff  236 23 Sep  2019 pip
hemepate-mac:bin hemepate$


hemepate-mac:bin hemepate$ ./pip install tabulate
Collecting tabulate
  Downloading https://files.pythonhosted.org/packages/c4/f4/770ae9385990f5a19a91431163d262182d3203662ea2b5739d0fcfc080f1/tabulate-0.8.7-py3-none-any.whl
Installing collected packages: tabulate
Successfully installed tabulate-0.8.7

Sunday 21 June 2020

ImportError: No module named 'twilio.rest'; 'twilio' is not a package


[root@guk python-telegram-bot-8.1.1]# python twilio.py
Traceback (most recent call last):
  File "twilio.py", line 5, in
    from twilio.rest import Client
  File "/root/python-telegram-bot-8.1.1/twilio.py", line 5, in
    from twilio.rest import Client
ImportError: No module named 'twilio.rest'; 'twilio' is not a package

[root@guk python-telegram-bot-8.1.1]# which python
alias python='/usr/local/bin/python3'
/usr/local/bin/python3
You have new mail in /var/spool/mail/root
[root@guk python-telegram-bot-8.1.1]#

[root@guk python-telegram-bot-8.1.1]# which python
alias python='/usr/local/bin/python3'
/usr/local/bin/python3
[root@guk python-telegram-bot-8.1.1]# ls -lrt /usr/local/bin/python*
-rwxr-xr-x 1 root root 6294745 Nov 25  2017 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root    1687 Nov 25  2017 /usr/local/bin/python2.7-config
-rwxr-xr-x 2 root root 9582890 Nov 25  2017 /usr/local/bin/python3.5m
-rwxr-xr-x 2 root root 9582890 Nov 25  2017 /usr/local/bin/python3.5
-rwxr-xr-x 1 root root    3057 Nov 25  2017 /usr/local/bin/python3.5m-config
lrwxrwxrwx 1 root root       9 Nov 25  2017 /usr/local/bin/python3 -> python3.5
lrwxrwxrwx 1 root root      17 Nov 25  2017 /usr/local/bin/python3.5-config -> python3.5m-config
lrwxrwxrwx 1 root root      16 Nov 25  2017 /usr/local/bin/python3-config -> python3.5-config

[root@guk twilio-twilio-python-5ce7ee7]# python3.5
Python 3.5.0 (default, Nov 25 2017, 14:56:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from twilio.rest import Client
>>


[root@guk twilio-twilio-python-5ce7ee7]# pwd
/root/twilio_manual/twilio-twilio-python-5ce7ee7
[root@guk twilio-twilio-python-5ce7ee7]#
[root@guk twilio-twilio-python-5ce7ee7]#
[root@guk twilio-twilio-python-5ce7ee7]# ls -lrt
total 164
-rw-r--r-- 1 root root  1740 Jun 11 02:47 VERSIONS.md
-rw-r--r-- 1 root root   749 Jun 11 02:47 UPGRADE.md
-rw-r--r-- 1 root root   161 Jun 11 02:47 tox.ini
drwxr-xr-x 4 root root  4096 Jun 11 02:47 tests
-rwxr-xr-x 1 root root  1943 Jun 11 02:47 setup.py
-rw-r--r-- 1 root root   138 Jun 11 02:47 setup.cfg
-rw-r--r-- 1 root root    55 Jun 11 02:47 requirements.txt
-rw-r--r-- 1 root root  7017 Jun 11 02:47 README.md
-rw-r--r-- 1 root root  1592 Jun 11 02:47 PULL_REQUEST_TEMPLATE.md
-rw-r--r-- 1 root root   120 Jun 11 02:47 MANIFEST.in
-rw-r--r-- 1 root root  2081 Jun 11 02:47 Makefile
-rw-r--r-- 1 root root  1088 Jun 11 02:47 LICENSE.md
-rw-r--r-- 1 root root   606 Jun 11 02:47 ISSUE_TEMPLATE.md
-rw-r--r-- 1 root root   731 Jun 11 02:47 index.rst
drwxr-xr-x 2 root root  4096 Jun 11 02:47 examples
drwxr-xr-x 3 root root  4096 Jun 11 02:47 docs
-rw-r--r-- 1 root root   173 Jun 11 02:47 Dockerfile
-rw-r--r-- 1 root root  6151 Jun 11 02:47 CONTRIBUTING.md
-rw-r--r-- 1 root root  3251 Jun 11 02:47 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root root 58296 Jun 11 02:47 CHANGES.md
-rw-r--r-- 1 root root  1387 Jun 11 02:47 AUTHORS.md
drwxr-xr-x 2 root root  4096 Jun 21 14:32 twilio.egg-info
drwxr-xr-x 4 root root  4096 Jun 21 14:32 build
drwxr-xr-x 2 root root  4096 Jun 21 14:32 dist
drwxr-xr-x 8 root root  4096 Jun 21 14:36 twilio

[root@guk twilio-twilio-python-5ce7ee7]# /usr/local/bin/python3.5 setup.py install

Using /usr/local/lib/python3.5/site-packages/chardet-3.0.4-py3.5.egg
Finished processing dependencies for twilio==6.42.0

Friday 19 June 2020

Add block volume to OCI instance and mount as /u01

First step add block volume through console with appropriate size as dev full path. 
Example in this case -  /dev/oracleoci/oraclevdb
















## Add volume as /dev/oracleoci/oraclevdb

[opc@oci-instance dev]$ cd oracleoci
[opc@oci-instance oracleoci]$ ls -lrt

total 0
lrwxrwxrwx. 1 root root 6 Jun  4 19:30 oraclevda -> ../sda
lrwxrwxrwx. 1 root root 7 Jun  4 19:30 oraclevda3 -> ../sda3
lrwxrwxrwx. 1 root root 7 Jun  4 19:30 oraclevda2 -> ../sda2
lrwxrwxrwx. 1 root root 7 Jun  4 19:30 oraclevda1 -> ../sda1


#### Run ICSCI command ####

[opc@oci-instance oracleoci]
sudo iscsiadm -m node -o new -T iqn.2015-12.com.oracleiaas:2c5b982e-acac-4c0c-a25a-5419ec4195ca -p 169.254.2.2:3260
sudo iscsiadm -m node -o update -T iqn.2015-12.com.oracleiaas:2c5b982e-acac-4c0c-a25a-5419ec4195ca -n node.startup -v automatic
sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:2c5b982e-acac-4c0c-a25a-5419ec4195ca -p 169.254.2.2:3260 -l



[opc@oci-instance oracleoci]$
[opc@oci-instance oracleoci]$ ls -lrt
total 0
lrwxrwxrwx. 1 root root 6 Jun  4 19:30 oraclevda -> ../sda
lrwxrwxrwx. 1 root root 7 Jun  4 19:30 oraclevda3 -> ../sda3
lrwxrwxrwx. 1 root root 7 Jun  4 19:30 oraclevda2 -> ../sda2
lrwxrwxrwx. 1 root root 7 Jun  4 19:30 oraclevda1 -> ../sda1
lrwxrwxrwx. 1 root root 6 Jun 18 16:31 oraclevdb -> ../sdb

#### Add entry in /etc/fstab to lost volume during reboot

[opc@oci-instance oracleoci]$ cat /etc/fstab
## More information:
## https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Tasks/connectingtoavolume.htm
/dev/oracleoci/oraclevdb /u01 ext4 defaults,_netdev,nofail 0 0

### Make ext4 filesystem

[opc@oci-instance dev]$ sudo mkfs -t ext4 /dev/sdb
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=256 blocks
49152000 inodes, 196608000 blocks
9830400 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2344615936
6000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[opc@oci-instance dev]$


###### mount /u01 

[opc@oci-instance dev]$ sudo mkdir /u01
[opc@oci-instance dev]$ sudo mount /dev/sdb /u01
[opc@oci-instance dev]$
[opc@oci-instance dev]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        158G     0  158G   0% /dev
tmpfs           158G     0  158G   0% /dev/shm
tmpfs           158G   49M  158G   1% /run
tmpfs           158G     0  158G   0% /sys/fs/cgroup
/dev/sda3        39G  2.9G   36G   8% /
/dev/sda1       200M  9.7M  191M   5% /boot/efi
tmpfs            32G     0   32G   0% /run/user/995
tmpfs            32G     0   32G   0% /run/user/1000
/dev/sdb        739G   73M  701G   1% /u01