Skip to content

Instantly share code, notes, and snippets.

@manuel-rabade
manuel-rabade / gentoo_emerge_depclean_rebuild_revdep
Last active August 29, 2015 14:09
One-liner para ver que todo este en orden después de un emerge --update @world en gentoo
# emerge -pauDN @world && emerge -p --depclean && emerge -p @preserved-rebuild && revdep-rebuild -ip
@manuel-rabade
manuel-rabade / nmap_scan_network
Last active August 29, 2015 14:09
Encontrar hosts en una subred
$ nmap -n -sn 192.168.15.0/24
@manuel-rabade
manuel-rabade / gentoo_kernel_oldconfig_genkernel
Last active February 14, 2016 23:39
Actualiza el kernel de gentoo con oldconfig y genkernel
# eselect kernel set X
# zcat /proc/config.gz > /usr/src/linux/.config
# cd /usr/src/linux && make oldconfig
# genkernel --no-oldconfig --no-clean all
# emerge @module-rebuild
# grub2-mkconfig -o /boot/grub/grub.cfg
@manuel-rabade
manuel-rabade / huawei_e303_linux
Last active November 29, 2022 17:57
Modem Huawei E303 en Linux
# dmesg
...
...
[ 141.291550] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[ 141.412568] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1f01
[ 141.419643] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 141.431509] usb 1-1.2: Product: HUAWEI HiLink
[ 141.436031] usb 1-1.2: Manufacturer: HUAWEI
[ 141.457977] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 141.469876] scsi0 : usb-storage 1-1.2:1.0
@manuel-rabade
manuel-rabade / autopasswd
Created December 29, 2014 04:57
Genera un password para un usuario y se lo guarda en ~/.passwd
#!/bin/bash
USER=$1
CHARS=12
HOME=$(awk -F: -v v="$USER" '{if ($1==v) print $6}' /etc/passwd)
PASSWD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c $CHARS)
if [ -z "$HOME" ]; then
echo "$USER is a user?"
@manuel-rabade
manuel-rabade / huawei_e303_api_device
Last active October 26, 2020 10:19
API del modem Huawei E303
$ curl http://192.168.1.1/api/device/information
<?xml version="1.0" encoding="UTF-8"?>
<response>
<DeviceName>E303</DeviceName>
<SerialNumber>K3XBYAxxxxxxxxxx</SerialNumber>
<Imei>xxxxxxxxxxxxxxx</Imei>
<Imsi>xxxxxxxxxxxxxxx</Imsi>
<Iccid>xxxxxxxxxxxxxxxxxxxx</Iccid>
<Msisdn></Msisdn>
<HardwareVersion>CH2E303SM</HardwareVersion>

Keybase proof

I hereby claim:

  • I am manuel-rabade on github.
  • I am manuel_rabade (https://keybase.io/manuel_rabade) on keybase.
  • I have a public key ASDPOtGd4Y4IqA5H80HJUVNwN1_L6zEqeWyku3VxqqRgqQo

To claim this, I am signing this object: