where is php.ini?

How to find where php.ini is being from the command line. $ php -i | grep 'grep 'Configuration File' Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.ini

October 5, 2021 · 1 min · ulysses

apt locked files

If you tried to run apt update and you get this error, try the following. $ apt update E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) [duplicate] Kill the process. $ sudo killall apt apt-get If that doesn’t work, remove the locked files. $ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock* Run apt update again.

October 2, 2021 · 1 min · ulysses

aws request domain renewal

Occassionally, AWS requires validation of your domain via email message. Here’s the command to send a request. aws acm resend-validation-email \ --certificate-arn arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \ --domain yourdomain.com \ --validation-domain yourdomain.com aws acm resend-validation-email \ --certificate-arn arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \ --domain www.yourdomain.com \ --validation-domain yourdomain.com You will need acm:ResendValidationEmail permission to run the command.

September 17, 2021 · 1 min · ulysses

awscli permission denied

When running awscli as a user, I’m getting a permissioned denied. [user@servername ~]$ aws s3 ls Traceback (most recent call last): File "/home/db2inst1/.local/bin/aws", line 19, in <module> import awscli.clidriver File "/home/db2inst1/.local/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module> import botocore.session File "/home/db2inst1/.local/lib/python2.7/site-packages/botocore/session.py", line 26, in <module> import botocore.configloader File "/home/db2inst1/.local/lib/python2.7/site-packages/botocore/configloader.py", line 19, in <module> from botocore.compat import six File "/home/db2inst1/.local/lib/python2.7/site-packages/botocore/compat.py", line 172, in <module> import xml.etree.cElementTree File "/usr/lib64/python2.7/xml/etree/cElementTree.py", line 3, in <module> from _elementtree import * ImportError: PyCapsule_Import could not import module "pyexpat" </module></module></module></module></module></module> This is a permission error with the directory where the awscli is installed. ...

September 15, 2021 · 1 min · ulysses

nmap scan top 1000 ports

Use this option if you want to scan the top 1000 ports. $ nmap -F 10.10.10.10 If you want a single specific port, then use -p option. $ nmap -p 80 10.10.10.10

September 13, 2021 · 1 min · ulysses

gcp list firewall rules

Here’s how to list GCP firewall rules while filtering a service account. Output is exported as a CSV file. gcloud compute firewall-rules list \ --project host-project \ --filter=service-account-name \ --format="csv( name, network, direction, priority, sourceRanges.list():label=SRC_RANGES, destinationRanges.list():label=DEST_RANGES, allowed[].map().firewall_rule().list():label=ALLOW, denied[].map().firewall_rule().list():label=DENY, sourceTags.list():label=SRC_TAGS, sourceServiceAccounts.list():label=SRC_SVC_ACCT, targetTags.list():label=TARGET_TAGS, targetServiceAccounts.list():label=TARGET_SVC_ACCT, disabled)" \ > export.csv

September 10, 2021 · 1 min · ulysses

rpm hung

Check if there’s a runaway rpm process. This returns number of processes that are running. ps -ef | grep rpm | wc -l Kill it. killall -9 rpm You should be able to run yum updates from this point on.

September 10, 2021 · 1 min · ulysses

awscli cli_pager

In AWSCLI Version 2, it’s using “less” by default to send output to the screen. Less displays output one page at a time. If less interferes with your script, then you can set “cli_pager” in ~/.aws/config to use nothing. [default] region = us-east-2 output = json cli_pager = If you have other profiles, add them as well. [lightsail] region = us-east-2 output = json cli_pager =

September 5, 2021 · 1 min · ulysses

convert ppk to pem

Convert PPK to PEM format. Open Puttygen. Click Load in the Actions section. Select the PPK file you wish to convert. Go to the Conversions menu and select Export OpenSSH key. Click Yes to convert key without a password. Name your private key and save it with a .pem extension. Click Save. Your pem file should begin with “—–BEGIN RSA PRIVATE KEY—–” and ends with “—–END RSA PRIVATE KEY—–.” You can also use puttygen in Linux. Install it first. ...

September 2, 2021 · 1 min · ulysses

uninstall awscli v2 on linux

How to uninstall AWSCLI version 2 on Linux Locate aws. $ which aws /usr/local/bin/aws Delete the symlinks. $ ls -l /usr/local/bin/aws $ sudo rm /usr/local/bin/aws $ sudo rm /usr/local/bin/aws_completer Delete the install directory. $ sudo rm -rf /usr/local/aws-cli Once deleted, you can reinstall awscli.

September 1, 2021 · 1 min · ulysses