Skip to content

Instantly share code, notes, and snippets.

View angelbladex's full-sized avatar

Luis García angelbladex

View GitHub Profile
@angelbladex
angelbladex / check_CVE-2024-3094.sh
Last active April 1, 2024 14:13
Idea for check CVE-2024-3094 on servers with Debian
#!/bin/bash
#Are you have multiple Debian servers? Use parallel-ssh instead
#Based on https://github.com/FabioBaroni/CVE-2024-3094-checker/tree/main
parallel-ssh -A -i -H "ip1 ip2 ip3 ... ipn" -l username "dpkg -l | grep xz-utils "
@angelbladex
angelbladex / validate2.sh
Created March 22, 2023 20:45
Check page using HTTPie
#Other version for check page, using HTTPie
#previous version (using wget) >https://gist.github.com/angelbladex/dad9308bbdb7e18f384a
# HTTPie https://httpie.io/
function validate_url(){
if [[ `http -h $1 --verify no 2>&1 --timeout 20 | grep -E '200|320|302'` ]]; then
echo "URL exist"
else
#!/bin/bash
#put first letter of each word on Uppercase
cat file | tr "[A-Z]" "[a-z]" | sed -e "s/\b\(.\)/\u\1/g" > newFile
@angelbladex
angelbladex / pm.h diff update
Created June 6, 2016 11:57 — forked from guilespi/pm.h diff update
Compile latest igb driver on debian squeeze 2.6.32-5-amd64
/*When presented with failure
*igb-3.4.8/src/igb_main.c:193: error: implicit declaration of function SET_RUNTIME_PM_OPS
*
*Add the following macro to
*/usr/src/linux-headers-2.6.32-5-common/include/linux/pm.h
*/
#ifdef CONFIG_PM_RUNTIME
#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
.runtime_suspend = suspend_fn, \
.runtime_resume = resume_fn, \
@angelbladex
angelbladex / vpn.sh
Last active May 13, 2016 16:32
Using openconnect for access to VPN server via script
#!/bin/bash
username="user@hostname"
password="your-Complex-password"
url="Your-URL"
pidfile="/tmp/openconnect-pid"
case "$1" in
start)
@angelbladex
angelbladex / update_mirrors.sh
Last active May 5, 2016 19:43
Determinate 6 fasterst mirrors for ArchLinux
#!/bin/bash
limit=6
file="/tmp/mirrorlist.pacnew"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@angelbladex
angelbladex / track.sh
Last active May 5, 2016 14:44
Determinate hosts alive from subnet
#!/bin/bash
subnet="192.168.16.0/24"
#sudo nmap -sP $subnet | grep report | grep -oE "[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}" | tr '\n' ' '
#sudo nmap -sP $subnet | grep report | grep -oE "[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}"
sudo nmap -sP $subnet | grep report | grep -oE "([[:digit:]]{1,3}.){3}[[:digit:]]{1,3}"
@angelbladex
angelbladex / strikethroughText.sh
Created October 27, 2013 20:35
Este script tacha el texto recibido por parámetro
#!/bin/bash
echo $@ | sed $"s/./&\xCC\xB6/g"
@angelbladex
angelbladex / colorear.sh
Created October 22, 2013 15:36
Script para convertir algún código en html con resaltado de colores, usando el paquete highlight
#!/bin/bash
if [[ ! -n "$1" ]];
then
echo "Nombre de archivo no ingresado"
exit
fi
@angelbladex
angelbladex / aMinusculas.sh
Created October 22, 2013 15:34
Script para pasar a minúsculas, todo lo que recibe
#!/bin/bash
#Convierte a minúsculas todos los parámetros que recibe
echo $@ | awk '{print tolower($0)}'