Compare commits

..

No commits in common. "8371bab7856b7adc20352dd63702e588f9511b33" and "e24ddc4cf8d906d8cc04de23ccf35c9459f5f164" have entirely different histories.

4 changed files with 24 additions and 40 deletions

View File

@ -1,20 +1,20 @@
% compression % compression
# Create a tar archive containing files # Create a tar containing files
tar cf <name>.tar <files> tar cf <name>.tar <files>
# Create a tar archive with gz compression # Extract the files from a tar
tar czf <name>.tar.gz <files>
# Extract a tar archive
tar xf <tar_file> tar xf <tar_file>
# Create a gz archive containing files # Create a tar with Gzip compression
gzip -9 -c <files> > <name>.gz 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> gzip -d <gz_file>
$ files: ls | awk -F: '{ print $1}' $ path: ls
$ tar_file: ls *.{tar,tar.*} | awk -F: '{ print $1}' $ tar_file: ls *.{tar,tar.*} 2>/dev/null
$ gz_file: ls *.gz | awk -F: '{ print $1}' $ gz_file: ls *.gz

View File

@ -1,15 +1,12 @@
% docker-compose % docker-compose
# Up a compose YAML # Builds, (re)creates, starts, and attaches to containers for all services
sudo docker-compose -f <file> up 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 sudo docker-compose -f <file> up -d
# Up and daemonze a compose YAML (force) # Stops containers and removes containers, networks created by up
sudo docker-compose -f <file> up -d --force-recreate
# Up and daemonze a compose YAML
sudo docker-compose -f <file> down sudo docker-compose -f <file> down
$ file: ls *.yaml | awk '{print $1}' $ file: ls *.yaml | awk '{print $1}'

View File

@ -1,4 +1,4 @@
% docker % docker-volumes
# Create a volume # Create a volume
sudo docker volume create <name> sudo docker volume create <name>
@ -11,36 +11,29 @@ sudo docker volume rm <volume>
$ volume: sudo docker volume ls --format "{{.Name}}" | awk '{print $1}' $ volume: sudo docker volume ls --format "{{.Name}}" | awk '{print $1}'
% docker-network
# Create new network # Create new network
docker network create <name> docker network create <name>
# List the networks # List the networks
sudo docker network ls sudo docker network ls
# Remove volume % docker
sudo docker volume rm <network>
$ network: sudo docker network ls --format "{{.Name}}" | awk '{print $1}'
# List the running containers # List the running containers
sudo docker ps sudo docker ps
# Stop a running container through SIGTERM # Stop a running container through SIGTERM
sudo docker stop <container> sudo docker stop <container_id>
# Stop a running container through SIGKILL # Stop a running container through SIGKILL
sudo docker kill <container> sudo docker kill <container_id>
# 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>'
# Print the last lines of a container's logs # 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 # 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}'

View File

@ -36,10 +36,7 @@ sudo usermod -a -G <group> <user>
# Remove user from a group # Remove user from a group
sudo deluser <user> <group> sudo deluser <user> <group>
# List port bindings # Port binding
sudo lsof -i -P -n | grep LISTEN
# Show binding on a port
sudo lsof -i:<port> sudo lsof -i:<port>
# Get IP on interface # Get IP on interface
@ -54,9 +51,6 @@ meld <(hexdump -C <file_1>) <(hexdump -C <file_2>)
# Compare 2 files (bcompare) # Compare 2 files (bcompare)
bcompare <file_1> <file_2> bcompare <file_1> <file_2>
# Replace expression in files
ack -rl "<expression>" | xargs sed -i 's#<expression>#<replace_expression>#g'
# Disable Bluetooth ERTM # Disable Bluetooth ERTM
sudo bash -c "echo Y > /sys/module/bluetooth/parameters/disable_ertm" sudo bash -c "echo Y > /sys/module/bluetooth/parameters/disable_ertm"