Sunday, September 13, 2020

Ubuntu pip install error - __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'

 Pip install error in ubuntu

__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'

Solution :

You are missing one package in your Ubuntu, Install

sudo apt install libcurl4-openssl-dev libssl-dev

AWS S3 billing for 'Amazon Simple Storage Service APS3-TimedStorage-ByteHrs'

If you are getting some biils for S3 resource although there is no enough data in your bucket according to you. When you check the bill, it charges you for some GB data in your s3 bucket every month but you do not remember any GB data in your bucket.

I would suggest you to check bucketobjectsize metric in s3. Open your s3 bucket and go in Management > Metrices . here you can see all occupied size of your bucket. You can open this metric in cloud using 'View in cloud' option. In the graph you can see the graph bucketsize increment over the time. This is very helpful to analyze your bucket filling capacity over time.

If you are using your s3 bucket to keep back up data, please make sure you remove older data frequently. This may be the reason your bucket is occupying too much size.

If you have used cron to put data in the bucket and same cron is used to remove data after X days of time, I would sugest you to check 'Versioning' option in the properties. If 'Versioning' is on, even if you remove the data using cron, still it keeps one copy of it and this may be the reson your bucket is showing this much occupied space.

Open s3 bucket in aws management console and enable 'show' toggle button to see all hidden data, remove this data and your bucket will be back with the expected occupied size.


Saturday, August 8, 2020

Connect to Oracle database using command line on Ubuntu 16.04

1. Download Oracle client package (instantclient-basiclite-linux.x64-19.8.0.0.0dbru.zip) and sqlplus commandline client package (instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip) from here
Your may have latest versions, download them.

2. Now run commands
mkdir -p /opt/oracle
cd /opt/oracle

3. Unzip downloaded package instantclient-basiclite-linux.x64-19.8.0.0.0dbru.zip
unzip instantclient-basiclite-linux.x64-19.8.0.0.0dbru.zip
and move folder instantclient_19_8 in /opt/oracle

4. Install libaio package
sudo apt install libaio-dev
5. Run Commands
sudo sh -c "echo /opt/oracle/instantclient_19_8 > /etc/ld.so.conf.d/oracle-instantclient.conf"
  
sudo ldconfig

or
export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_8:$LD_LIBRARY_PATH
6. Unzip downloaded package instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip
unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip
Copy all .so files of these extracted zip into /opt/oracle/instantclient_19_8
mv *.so /opt/oracle/instantclient_19_8
7. Now connect to oracle db on command line.
./sqlplus username/password@domain:port/service_name
Example :
./sqlplus root/strongpassword@54.24.xxx.xxx:1532/ORCAD
8. After connect to sql prompt, list all databases using query
select * from v$database;
Query to view the schema name by
select * from dba_users;
To display the columns available in the Oracle view v$database, we can execute the below statement.
desc v$database;