December 3rd, 2022 by ayad
1-
uapi --user=alsalamaco Mysql create_user name=alsalamaco_aabbcc password=1qa2ws3ed
2-
uapi --user=alsalamaco Mysql create_user name=alsalamaco_aabbcc password=1qa2ws3password=1qa2ws3eded
3-
uapi --user=alsalamaco Mysql set_privileges_on_database user=alsalamaco_aabbcc database=alsalamaco_aabbcc privileges=ALL%20PRIVILEGES
note: alsalamaco is cpanel domain username
Posted in Linux |
November 30th, 2022 by ayad
sed -i” -e ‘s/alayan\.co/al\-ayan\.com/g’ alayan_wp.sql
Posted in Linux |
November 17th, 2022 by ayad
Time Ranges
To see messages logged within a specific time window, we can use the --since
and --until
options. The following command shows journal messages logged within the last hour.
$ journalctl --since "1 hour ago"
To see messages logged in the last two days, the following command can be used.
$ journalctl --since "2 days ago"
The command below will show messages between two dates and times. All messages logged on or after the since parameter and logged on or before the until parameter will be shown.
$ journalctl --since "2015-06-26 23:15:00" --until "2015-06-26 23:20:00"
For greater accuracy, format the date and time as “YYYY-MM-DD HH:MM:SS”. You can also use any format that follows the systemd.time specification
.
Posted in Linux |
November 7th, 2022 by ayad
docker rm $(docker ps -a -q -f status=exited)
or
docker container prune
the two commands are same, the latest one is the newest one. in the new version of Docker
This command deletes all containers that have a status of exited
. In case you’re wondering, the -q
flag, only returns the numeric IDs and -f
filters output based on conditions provided. One last thing that’ll be useful is the --rm
flag that can be passed to docker run
which automatically deletes the container once it’s exited from. For one off docker runs, --rm
flag is very useful.
Posted in Containers |
October 15th, 2022 by ayad
Posted in Uncategorized |
October 15th, 2022 by ayad
$kubectl run httpd –image=httpd:alpine –port=80 –expose
Posted in Kubernetes |
October 15th, 2022 by ayad
$kubectl run custom-nginx –image=nginx –port=8080
Posted in Kubernetes |
October 15th, 2022 by ayad
$kubectl expose pod redis –port=6379 –name redis-service
Posted in Kubernetes |
October 15th, 2022 by ayad
Run the command to generate the definition file:
$kubectl run redis --image=redis:alpine --dry-run=client -oyaml > redis-pod.yaml
---
apiVersion: v1
kind: Pod
metadata:
labels:
tier: db
name: redis
spec:
containers:
- image: redis:alpine
name: redis
dnsPolicy: ClusterFirst
restartPolicy: Always
Then run the command: kubectl create -f redis-pod.yaml
to create the pod from the definition file.
OR Use the imperative command: –
$kubectl run redis -l tier=db --image=redis:alpine
Posted in Kubernetes |
October 15th, 2022 by ayad
note: there is no space between – – in the below commands
$kubectl run – -image=nginx nginx
$kubectl create deployment – -image=nginx nginx
$kubectl expose deployment nginx – -port 80
$kubectl edit deployment nginx
$kubectl scale deployment nginx – -replicas=5
$kubectl set image deployment nginx nginx =nginx:1.18
Posted in Kubernetes |