Skip to content

Instantly share code, notes, and snippets.

View n1lux's full-sized avatar
🎯
Focusing

Nilo Alexandre Pereira n1lux

🎯
Focusing
  • Grupo Boticário
  • Poços de Caldas - MG
  • 14:52 (UTC -12:00)
View GitHub Profile
@n1lux
n1lux / gist:69779c228c937b402904ba7029feb6df
Last active May 29, 2023 12:43
Install: QEMU - KVM - VIRTMANEGER - OPENSUSE
sudo zypper install libvirt qemu virt-manager libvirt-daemon-driver-qemu qemu-kvm
sudo systemctl enable libvirtd
sudo systemctl start libvirtd
ERROR: "network 'default' is not active"
Solution 1:
sudo virsh net-list --all
sudo virsh net-start default
@n1lux
n1lux / urxvt.txt
Created December 27, 2022 14:47
Urxvt tips
[copy/paste]
https://www.tomica.net/blog/2019/01/fixing-urxvt-copy-paste/
@n1lux
n1lux / es-ingest-pipeline.json
Created September 14, 2022 18:10
ES Ingest Pipeline
GET /test2/_count
delete test2
put test2
#delete pipeline
DELETE _ingest/pipeline/id-hasher
@n1lux
n1lux / docker-compose.yml
Created September 14, 2022 12:38
ElasticSearch Kibana
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
@n1lux
n1lux / docker-compose.yml
Created August 17, 2022 13:23
ElasticSearch docker cluster
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
@n1lux
n1lux / bakcup-restore-rpm-packages.sh
Last active August 15, 2022 14:49
Backup/Retore rpm packages
#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
@n1lux
n1lux / bash_tips.txt
Last active February 12, 2021 14:03
Bash-tips
#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
@n1lux
n1lux / .tmux.conf
Created January 8, 2020 12:06
Tmux split same dir
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@n1lux
n1lux / install_printer
Created October 11, 2019 00:53 — forked from notdodo/install_printer
Install a printer on Arch Linux with cups using command line
#!/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
@n1lux
n1lux / char_around_content_vim.txt
Last active November 26, 2020 12:06
Put char around content vim
%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.