Monday, January 2, 2023

Pi-Hole Docket rpi4

 

https://pi-hole.net/


https://github.com/pi-hole/docker-pi-hole/#running-pi-hole-docker


sudo apt install docker

sudo apt install docker-compose

create este sh


#!/bin/bash
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md
PIHOLE_BASE="${PIHOLE_BASE:-$(pwd)}"
[[ -d "$PIHOLE_BASE" ]] || mkdir -p "$PIHOLE_BASE" || { echo "Couldn't create storage directory: $PIHOLE_BASE"; exit 1; }
# Note: FTLCONF_LOCAL_IPV4 should be replaced with your external ip.
docker run -d \
--name pihole \
-p 53:53/tcp -p 53:53/udp \
-p 80:80 \
-e TZ="America/Chicago" \
-v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
-v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
--dns=127.0.0.1 --dns=1.1.1.1 \
--restart=unless-stopped \
--hostname pi.hole \
-e VIRTUAL_HOST="pi.hole" \
-e PROXY_LOCATION="pi.hole" \
-e FTLCONF_LOCAL_IPV4="127.0.0.1" \
pihole/pihole:latest
printf 'Starting up pihole container '
for i in $(seq 1 20); do
if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ] ; then
printf ' OK'
echo -e "\n$(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: http://${IP}/admin/"
exit 0
else
sleep 3
printf '.'
fi
if [ $i -eq 20 ] ; then
echo -e "\nTimed out waiting for Pi-hole start, consult your container logs for more info (\`docker logs pihole\`)"
exit 1
fi
done;



https://pimylifeup.com/pi-hole-docker/

sudo docker ps -a # para mirar que hay 
sudo docker rm 3c501a524b12 # para eliminar
sudo docker-compose up -d   #para subir

Error al levantar en ubuntu 2022

ERROR: for pihole  Cannot start service pihole: driver failed programming external connectivity on endpoint pihole (b829371fdb48806bd51274093e2e543f17c9b3b0c9dbaef4d067ccd5f55ae04f): Error starting userland proxy: listen tcp4 0.0.0.0:53: bind: address already in use

ERROR: for pihole  Cannot start service pihole: driver failed programming external connectivity on endpoint pihole (b829371fdb48806bd51274093e2e543f17c9b3b0c9dbaef4d067ccd5f55ae04f): Error starting userland proxy: listen tcp4 0.0.0.0:53: bind: address already in use

#como resolver el error
systemctl disable systemd-resolved.service
systemctl stop systemd-resolved


XRDP is not working

 Based on 

https://forums.raspberrypi.com/viewtopic.php?t=323471

Re: bullseye: xrdp not working for user "pi"


https://github.com/neutrinolabs/xrdp/issues/2060

Modify /etc/X11/xrdp/xorg.conf to use xrdp normally


sudo nano /etc/X11/xrdp/xorg.conf

and comment 

#Option "DRMDevice" "/dev/dri/renderD128"

Option "DRMDevice" ""


ademas agregar esto al final para que ande mas rapido el xrdp

Section "Extensions"
    Option "Composite" "Disable"
EndSection

Saturday, December 17, 2022

vnc Raspbian

 para instalar VNC en raspbian 

sudo apt-get install realvnc-vnc-server


mas info en https://www.realvnc.com/en/blog/how-to-setup-vnc-connect-raspberry-pi/

por el error de no iniciar el escritorio

How to Fix Raspberry Pi's 'Cannot Currently Show the Desktop' Error

https://www.tomshardware.com/how-to/fix-cannot-currently-show-desktop-error-raspberry-pi

Friday, November 18, 2022

Power Shell para revisar rango de IP

Power Shell para revisar rango de IP

 for ($i = 1; $i -lt 255; $i++) {

    Test-Connection "192.168.100.$i" -Count 1 -ErrorAction SilentlyContinue

}

Wednesday, November 9, 2022

Jenkins no se inicia de manera automatica

Error:

Service cannot be started. System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified

   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)

   at winsw.Util.ProcessHelper.StartProcessAndCallbackForExit(Process processToStart, String executable, String arguments, Dictionary`2 envVars, String workingDirectory, Nullable`1 priority, ProcessCompletionCallback callback, Boolean redirectStdin, LogHandler logHandler, Boolean hideWindow)

   at winsw.WrapperService.StartProcess(Process processToStart, String arguments, String executable, LogHandler logHandler, Boolean redirectStdin)

   at winsw.WrapperService.OnStart(String[] args)

   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state) 


https://serverfault.com/questions/1039864/jenkins-fails-to-start-on-windows-server-after-java-runtime-update-uninstalled-o


D:\Services\Jenkins\jenkins.xml


el error lo da el ejecutable 

<executable>C:\Program Files (x86)\Java\jre1.8.0_341\\bin\java.exe</executable>


el motivo es que se actualizo la version de java y esto no es detectado por jenkins.

Thursday, October 13, 2022

Sitios utiles

Sitios utiles

https://haveibeenpwned.com/ - para ver tu correo personal o corporativo

https://cybernews.com/password-leak-check/ - para ver si las claves mas usadas que tienes han sido filtradas.

Saturday, September 3, 2022

Comandos de red utiles

 

sudo arp-scan --localnet                 para saber que hay en la red

sudo netdiscover -r 192.168.1.0/24 para saber que hay en la red

Enum4linux                 conocer usuarios de la red

nmblookup -A IP         para saber nombre de la maquina


NMAP                  scan de puertos
nmap -sS 192.168.0.1 validacion de servicios TCP
nmap -sT 192.168.0.1 validacion de servicios UDP
nmap -sV 192.168.0.1 validacion de version del servicio
nmap -sC -A -p23,80,443,5000 192.168.0.1 revision de puertos especificos
nmap 192.168.0.5,233,252 o rangos: nmap 192.168.0.200-254 para scan de rangos de IP