Compare commits
No commits in common. "8371bab7856b7adc20352dd63702e588f9511b33" and "e24ddc4cf8d906d8cc04de23ccf35c9459f5f164" have entirely different histories.
8371bab785
...
e24ddc4cf8
@ -1,20 +1,20 @@
|
||||
% compression
|
||||
|
||||
# Create a tar archive containing files
|
||||
# Create a tar containing files
|
||||
tar cf <name>.tar <files>
|
||||
|
||||
# Create a tar archive with gz compression
|
||||
tar czf <name>.tar.gz <files>
|
||||
|
||||
# Extract a tar archive
|
||||
# Extract the files from a tar
|
||||
tar xf <tar_file>
|
||||
|
||||
# Create a gz archive containing files
|
||||
gzip -9 -c <files> > <name>.gz
|
||||
# Create a tar with Gzip compression
|
||||
tar czf <name>.tar.gz <files>
|
||||
|
||||
# Extract a gz archive
|
||||
# Compress file and appends .gz to its name
|
||||
gzip <path>
|
||||
|
||||
# Decompress compressed file
|
||||
gzip -d <gz_file>
|
||||
|
||||
$ files: ls | awk -F: '{ print $1}'
|
||||
$ tar_file: ls *.{tar,tar.*} | awk -F: '{ print $1}'
|
||||
$ gz_file: ls *.gz | awk -F: '{ print $1}'
|
||||
$ path: ls
|
||||
$ tar_file: ls *.{tar,tar.*} 2>/dev/null
|
||||
$ gz_file: ls *.gz
|
||||
|
@ -1,15 +1,12 @@
|
||||
% docker-compose
|
||||
|
||||
# Up a compose YAML
|
||||
# Builds, (re)creates, starts, and attaches to containers for all services
|
||||
sudo docker-compose -f <file> up
|
||||
|
||||
# Up and daemonze a compose YAML
|
||||
# Builds, (re)creates, starts, and dettaches to containers for all services
|
||||
sudo docker-compose -f <file> up -d
|
||||
|
||||
# Up and daemonze a compose YAML (force)
|
||||
sudo docker-compose -f <file> up -d --force-recreate
|
||||
|
||||
# Up and daemonze a compose YAML
|
||||
# Stops containers and removes containers, networks created by up
|
||||
sudo docker-compose -f <file> down
|
||||
|
||||
$ file: ls *.yaml | awk '{print $1}'
|
||||
|
@ -1,4 +1,4 @@
|
||||
% docker
|
||||
% docker-volumes
|
||||
|
||||
# Create a volume
|
||||
sudo docker volume create <name>
|
||||
@ -11,36 +11,29 @@ sudo docker volume rm <volume>
|
||||
|
||||
$ volume: sudo docker volume ls --format "{{.Name}}" | awk '{print $1}'
|
||||
|
||||
% docker-network
|
||||
|
||||
# Create new network
|
||||
docker network create <name>
|
||||
|
||||
# List the networks
|
||||
sudo docker network ls
|
||||
|
||||
# Remove volume
|
||||
sudo docker volume rm <network>
|
||||
|
||||
$ network: sudo docker network ls --format "{{.Name}}" | awk '{print $1}'
|
||||
% docker
|
||||
|
||||
# List the running containers
|
||||
sudo docker ps
|
||||
|
||||
# Stop a running container through SIGTERM
|
||||
sudo docker stop <container>
|
||||
sudo docker stop <container_id>
|
||||
|
||||
# Stop a running container through SIGKILL
|
||||
sudo docker kill <container>
|
||||
|
||||
# Execute bash on a running container
|
||||
sudo docker exec -it <container> bash
|
||||
|
||||
# Execute a command on a running container
|
||||
sudo docker exec -it <container> sh -c '<command>'
|
||||
sudo docker kill <container_id>
|
||||
|
||||
# Print the last lines of a container's logs
|
||||
sudo docker logs --tail 100 <container> | less
|
||||
docker logs --tail 100 <container_id> | less
|
||||
|
||||
# Print the last lines of a container's logs and following its logs
|
||||
sudo docker logs --tail 100 <container> -f
|
||||
docker logs --tail 100 <container_id> -f
|
||||
|
||||
$ container: sudo docker container ls --format "{{.Names}}" | awk '{print $1}'
|
||||
$ container_id: sudo docker ps --format "{{.ID}}" | awk '{print $1}'
|
||||
|
@ -36,10 +36,7 @@ sudo usermod -a -G <group> <user>
|
||||
# Remove user from a group
|
||||
sudo deluser <user> <group>
|
||||
|
||||
# List port bindings
|
||||
sudo lsof -i -P -n | grep LISTEN
|
||||
|
||||
# Show binding on a port
|
||||
# Port binding
|
||||
sudo lsof -i:<port>
|
||||
|
||||
# Get IP on interface
|
||||
@ -54,9 +51,6 @@ meld <(hexdump -C <file_1>) <(hexdump -C <file_2>)
|
||||
# Compare 2 files (bcompare)
|
||||
bcompare <file_1> <file_2>
|
||||
|
||||
# Replace expression in files
|
||||
ack -rl "<expression>" | xargs sed -i 's#<expression>#<replace_expression>#g'
|
||||
|
||||
# Disable Bluetooth ERTM
|
||||
sudo bash -c "echo Y > /sys/module/bluetooth/parameters/disable_ertm"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user