Best way to keep git changes without commiting.
1) git stash
To get back changes:
2) git stash pop
Best way to keep git changes without commiting.
1) git stash
To get back changes:
2) git stash pop
use command tmpreaper 24h to delete all unused files older than 24hours
sudo certbot certonly --manual -d domain name --preferred-challenges dns
create .well-known folder and create acme-server folder inside it
Use --preferred-challenges dns if dns validation are needed.
copy below cerificates
/etc/letsencrypt/live/domain/fullchain.pem
/etc/letsencrypt/live/domain/privkey.pem
pip install locust
create file locustfile.py
start with locust
open web using :
http://localhost:8089/
Sample user file:
from locust import HttpUser, task
class LoadUser(HttpUser):
@task
def load(self):
self.client.get("/sleep_30/")
Use below command:
pm2 --name=py-api start "cd ~/code/python_tasks && source venv/bin/activate && cd api && gunicorn -k gevent app:app -b 0.0.0.0:5050 -w 2 --error-logfile /var/log/gunicorn/error.log --access-logfile /var/log/gunicorn/access.log --capture-output --log-level debug"
use:
https://svg2jsx.com/
It will convert svg to JSX for react
How to edit SVG?
use: https://boxy-svg.com/
cd webapp
config="dev"
JVMMaxHeapSize="1512"
echo "Parameter passed to run the server for $config configuration"
echo "Max heap size defined $JVMMaxHeapSize MB "
mvn clean install "-Dhk.conf=$config" "-Dhk.jvm.memory=$JVMMaxHeapSize"
cd ..
cd sb-web
#mvn -e -X exec:exec "-Dhk.conf=$config" "-Dhk.jvm.memory=$JVMMaxHeapSize" -Dgpg.skip
./mvnw spring-boot:run
cd ..
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bn/*"
}
]
}
cors:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [
"ETag"
]
}
]
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bn/*",
"Condition": {
"StringLike": {
"aws:Referer": "https://*.x.com/*"
}
}
},
{
"Sid": "PublicReadGetObject2",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::7788:user/suser"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bn/*",
"Condition": {}
}
]
}
Use pip freeze > requirements.txt to save pip package list.
Use pip install -r requirements.txt to install packages from requirements.txt
Note: Alway run python scripts from venv (Virtual Environment)
import math
import sys
mgc=getMongoConnection()
mgd=mgc.DB
tcoll=mgd.testcoll
with mgc.start_session() as session:
with session.start_transaction():
test_obj = {'test1': True, 'date': datetime.now()}
tcoll.insert_one(test_obj,session=session)
test_obj = {'test2': True, 'date': datetime.now()}
y=1/0
tcoll.insert_one(test_obj,session=session)
session.commit_transaction()
How to fix Data label not showing issue in React recharts
Answer: Disable Animation