Skip to content

Instantly share code, notes, and snippets.

View anibalardid's full-sized avatar
🏠
Working from home

Anibal anibalardid

🏠
Working from home
View GitHub Profile
@anibalardid
anibalardid / mkt.sh
Last active August 13, 2025 18:41
mkt, create working directories #hack #security #s4vitar
# create enum directories
function mkt(){
mkdir {nmap,content,exploits,scripts}
}
@anibalardid
anibalardid / extractPorts.sh
Created May 18, 2021 01:02
Extract ports from nmap output #hack #security #s4vitar
# Used:
# nmap -p- --open -T5 -v -n ip -oG allPorts
# Extract nmap information
# Run as:
# extractPorts allPorts
function extractPorts(){
ports="$(cat $1 | grep -oP '\d{1,5}/open' | awk '{print $1}' FS='/' | xargs | tr ' ' ',')"
ip_address="$(cat $1 | grep -oP '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' | sort -u | head -n 1)"
echo -e "\n[*] Extracting information...\n" > extractPorts.tmp
@anibalardid
anibalardid / functions.php
Created April 1, 2019 20:56
[wpo woocommerce] optimizacion woocommerce #woocommerce #wordpress
<?php
//* Incluir en el functions.php y personalizar
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@anibalardid
anibalardid / convert-image-img2iso.sh
Created April 9, 2020 17:38
convert image .img to .iso
sudo apt-get install ccd2iso
ccd2iso file.img fil1.iso
#OR
sudo apt install iat
iat file.img file.iso
@anibalardid
anibalardid / zsh-ohmyzsh-powerlevel10k.txt
Last active May 29, 2024 15:03
zsh powerlevel10k-ohmyzsh
https://ohmyz.sh/
https://safjan.com/top-popular-zsh-plugins-on-github/
https://github.com/b4b4r07/enhancd
https://awesomerank.github.io/lists/unixorn/awesome-zsh-plugins.html
alternative to powerlevel10k: https://github.com/spaceship-prompt/spaceship-prompt
@anibalardid
anibalardid / woocommerce-new-custom-payment-gateway.php
Created December 5, 2020 03:19
WooCommerce add new custom payment gateway
<?php
// CASH PAYMENT GATEWAY
/**
* Add the gateway to WC Available Gateways
*
* @since 1.0.0
* @param array $gateways all available WC gateways
* @return array $gateways all WC gateways + offline gateway
@anibalardid
anibalardid / rmk.sh
Last active May 7, 2024 05:12
rm securely #linux #security #hack #s4vitar
#remove file securely, anti recovery
function rmk(){
scrub -p dod $1
shred -zun 10 -v $1
}
@anibalardid
anibalardid / disable-calendar-evolution-notifications.txt
Created May 28, 2020 13:29
disable evolution gnome notifications (display duplicate in calendar notifications)
In the file /etc/xdg/autostart/org.gnome.Evolution-alarm-notify.desktop I changed the line
OnlyShowIn=GNOME;Unity;XFCE;Dawati;MATE;
to
NotShowIn=GNOME;

remove_old_kernels.sh

#!/bin/bash
# Run this script without any param for a dry run
# Run the script with root and with exec param for removing old kernels after checking
# the list printed in the dry run

uname -a
IN_USE=$(uname -a | awk '{ print $3 }')
@anibalardid
anibalardid / git-remove-unused-local-branches.md
Created July 7, 2022 12:26
Git Remove unused local branches

Prune local tracking branches that do not exist on remote anymore

git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d