Skip to content

Instantly share code, notes, and snippets.

View danilogco's full-sized avatar

Danilo Carolino danilogco

  • QFlash
  • Rio Claro-SP, Brasil
  • 21:35 (UTC -03:00)
View GitHub Profile
@danilogco
danilogco / gist:4886491bd230beb05863699fbe2c9187
Last active December 18, 2023 08:43
UFW outgoing basic rule
sudo ufw default deny outgoing
sudo ufw allow out to any port 80 # http
sudo ufw allow out to any port 443 # https
sudo ufw allow out to any port 53 # dns
sudo ufw reload
sudo ufw status verbose
sudo ufw allow out to 20.201.28.151 port 22 proto tcp comment 'Allow SSH' # github
@danilogco
danilogco / crontab
Created December 18, 2023 05:42
Crontab Clamav
* */6 * * * rm -rf /var/log/clamav/freshclam.log && freshclam >/dev/null 2>&1
* */6 * * * clamscan -r -i / | grep FOUND >> /home/danilogco/virus-scan-reports/virus-scan-report-`date +"%d-%m-%Y"`.txt >/dev/null 2>&1
# create the folder virus-scan-reports in your home
nordvpn set technology openvpn
nordvpn set protocol tcp
nordvpn set threatprotectionlite on
nordvpn set killswitch on
nordvpn set lan-discovery enable
nordvpn set dns off
nordvpn connect us10460
nordvpn set autoconnect on us10460
@danilogco
danilogco / motd.sh
Created December 15, 2023 02:36
Custom motd.sh for Manjaro Linux
#! /usr/bin/env bash
# /etc/profile.d/motd.sh
# Basic info
HOSTNAME=`uname -n`
ROOT=`df -Ph | grep xvda1 | awk '{print $4}' | tr -d '\n'`
OS=`cat /etc/manjaro-release`
OS_VERSION=`lsb_release -r`
KERNEL=`uname -r`
UPTIME=`uptime`
@danilogco
danilogco / allow_ssh_clients.sh
Created December 14, 2023 21:23
ufw - allow connection from local ssh client
ufw allow from 192.168.0.201 to any port 22
ufw allow from 192.168.0.201 to any port 22 proto tcp
@danilogco
danilogco / clean.sh
Last active September 28, 2023 23:02
Simple script to clean Manjaro temporary files
# Vacuum journals
sudo journalctl --vacuum-size=500M && sudo journalctl --vacuum-time=7d
# Remove all uninstalled packages
sudo paccache -rvuk0
# Remove old installed packages, leave 3
sudo paccache -rvk3
# Clean yay cache
@danilogco
danilogco / delete_all.sh
Created September 28, 2023 20:19
Delete all node installed global libraries
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
@danilogco
danilogco / pokemon.rb
Last active March 13, 2023 01:52
Pokemon moves score comparison script
# frozen_string_literal: true
# Move
puts "Is the move the same type as the Pokemon? (0 - yes, 1 - no) "
same_type = gets.chomp.to_i
puts "What's the move type? (0 - attack, 1 - special attack) "
f = gets.chomp.to_i # 0 - attack / 1 - special attack
puts "What's the move attack power? (0-200) "
c = gets.chomp.to_i # move attack power
@danilogco
danilogco / vlc_configure.sh
Last active February 15, 2023 02:19
VLC-Arc-Dark Manjaro
sudo pamac install vlc vlc-arc-dark-git libva-vdpau-driver libva-intel-driver
# After installing on Arch with pacman/yaourt/yay etc.. its in "/usr/share/vlc/skins2/"
# but VLC is not using the theme automatically.
# Start VLC and open Settings -> choose "custom Settings" and go to "/usr/share/vlc/skins2/"
# with the file browser. Select the wanted skin, press "Save" and restart VLC.
@danilogco
danilogco / .p10k.zsh
Created December 21, 2022 18:52
p10k custom
# Generated by Powerlevel10k configuration wizard on 2022-12-21 at 15:49 -03.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 59558.
# Wizard options: nerdfont-complete + powerline, large icons, unicode, lean, 2 lines,
# solid, left frame, dark-ornaments, compact, many icons, concise,
# instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#