The presentation format of
git log output can be customized using the
--pretty flag with a format string. For example:
> git log --pretty=format:"[%H] %an on %ad - %s"
More can be fou...
The data directory is where docker saves images, containers and some other stuffs. Sometimes its beneficial to configure the data directory outside of the default location. For example, when you wa...
AWS CLI can be used to retrieve the console output from an EC2 instance. This can be of great help in debugging and troubleshooting.
aws ec2 get-console-output --instance-id <my-instance-id>
docker create IMAGE
Creates a docker container based off of
IMAGE, but does not run
docker rename CONTAINER NEW_NAME
Renames a docker container
docker start CONTAINER
Starts a docker container
docker restart CONTAINER
Restarts a docker container
Send a POST request to the
_delete_by_query endpoint of target index and doctype, make sure the request body has query for matching and deleting the target objects.
Start by opening the Django shell from your terminal
> python manage.py shell
Then inside the Django shell, first get hold of that user object, then change the password and save.
date command is mostly used to get the current date. But there are some underappreciated gems of feature in this command.
Get a date in the past
> date -d "3 days ago" > date -...
Sometimes one has to copy a file from one branch to another. The
git checkout command comes in handy in this situation. Let's say we need to copy a file named
source-branch to `d...
tree command list contents of directories in a tree-like format. I often use this to document directory structures of my projects. The output of
tree is of course, the directory structure drawn in an ASCII art style tree. See example below. A few lines of comment are added to inform team ...