- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| window#vim-main-window { | |
| background-color: @dark; | |
| } |
| %s/^\(.*\)$/"\1"/ | |
| s/regex/replace/ is vim command for search n replace. | |
| % makes it apply throughout the file | |
| ^ and $ denotes start and end of the line respectively. | |
| (.*) captures everything in between. ( and ) needs to be escaped in vim regexes. | |
| \1 puts the captured content between two quotes. | |
| #!/bin/bash | |
| ################################################################ | |
| # Install a printer on Arch Linux with cups using command line # | |
| # Used for a HP PSC 1510 with default driver # | |
| ################################################################ | |
| sudo pacman -S cups | |
| sudo systemctl start org.cups.cupsd |
| bind '"' split-window -c "#{pane_current_path}" | |
| bind % split-window -h -c "#{pane_current_path}" |
| #Count word occurrences in file | |
| grep -wo '[[:alnum:]]\+' filename | sort | uniq -cd | |
| # Iter over sum of a word occurence, get first column (awk print$1) and store sum in variable $sum | |
| for i in $(grep -wo '[[:alnum:]]\+' alunos_atualizaram.txt | sort | uniq -cd| awk '{print $1}'); do sim=`expr $sum + $i`; done | |
| echo $sum |
| #Backup | |
| rpm -qa --qf "%{NAME}\n" | sort > /backup/packages-installed.log | |
| #restore | |
| LIST=$(cat /backup/packages-installed.log) | |
| for s in $LIST; do yum -y install $s; done |
| version: '3.5' | |
| services: | |
| es01: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0 | |
| container_name: elasticsearch | |
| environment: | |
| - node.name=es01 | |
| - cluster.name=docker-cluster | |
| - bootstrap.memory_lock=true | |
| - discovery.seed_hosts=es02,es03 |
| version: '3.5' | |
| services: | |
| es01: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6 | |
| container_name: es01 | |
| environment: | |
| - node.name=es01 | |
| - cluster.name=docker-cluster | |
| - bootstrap.memory_lock=true | |
| - discovery.seed_hosts=es01,es02 |
| GET /test2/_count | |
| delete test2 | |
| put test2 | |
| #delete pipeline | |
| DELETE _ingest/pipeline/id-hasher |