Hardware – VAN-DAAG https://van-daag.nl Fri, 07 Jun 2024 12:38:44 +0000 en-US hourly 1 https://wordpress.org/?v=7.1.3 136854481 Set HP Elitebook Boot Logo https://van-daag.nl/?p=725 https://van-daag.nl/?p=725#respond Fri, 07 Jun 2024 12:38:02 +0000 https://van-daag.nl/?p=725 To set a Boot logo on all managed HP Laptops use script located on
Scripts/HPBiosLogo at main · Daagvandermeer/Scripts (github.com)

Put in the same folder a JPG file.
Max resolution is 1024×768
File size max 32751 bytes.
(https://developers.hp.com/hp-client-management/doc/Set-HPFirmwareBootLogo)

All HP files can be found on Client Management Solutions – HP Downloads | HP® Official Site

About the Script.
First checks if exist. If yes, it delete them. Then imports the HP Modules.

With Set-HPFirmwareBootLogo -File “$PSScriptRoot\Logo.jpg” -Password “” you install the logo.
Fill in the Bios Password if used.

I’m using this install when installing/reinstalling systems with MDT. But script can be changed if you want to execute it via Intune

]]>
https://van-daag.nl/?feed=rss2&p=725 0 725
Troubleshooting HP EliteBook 640 G10 USB-C Dock NIC Connection https://van-daag.nl/?p=715 https://van-daag.nl/?p=715#respond Fri, 07 Jun 2024 09:56:09 +0000 https://van-daag.nl/?p=715 Recently we bought new HP laptops (HP EliteBook 640 G10). We thought that the current USB-C docks should work. All is working fine. But only Nic won’t connect to the secure environment.

And Yes, in the bios MAC Address Pass Trough is set correct. (Reuse Embedded LAN Address is checked)

We don’t want to replace all USB-C Docks to something else, I found out that in Windows you can set a MAC address on NIC’s

Open Network Properties.

Click on Configure. Tab Advanced. Go to Property Network Address.
Here you can fill any MAC Address.

When this is filled, Network is working.

Because I’m IT Specialist, I don’t want to do this on every system manual.
Hereby my Script that I placed in a Computer GPO -> Scripts (Startup/Shutdown)

I think it can also be in Intune, but didn’t checked it.https://github.com/Daagvandermeer/Scripts/blob/main/NICPasstrough.ps1

]]>
https://van-daag.nl/?feed=rss2&p=715 0 715
Enable MAC pass through on Lenovo Thinkpad T14s https://van-daag.nl/?p=562 Fri, 31 Mar 2023 12:45:14 +0000 https://blog.van-daag.nl/?p=562 Here is a walk tough to enable MAC pass though for when connecting it to a docking but don’t want to use the MAC of the docking because of network security.

This is only for the Lenovo Thinkpad T14s

Start the laptop by pressing the Power button and Press F12 on the keyboard to enter the Boot menu/BIOS

When your Boot menu/BIOS is Password protected, Enter the Password and press con Continue

Now Entering Boot Menu

Now you entered the Boot Menu. Your mouse is available here.

Move your mouse to App Menu and click on it

On the right side click on Setup

Now you are in the setup

Move the mouse to Config and Click on it.

Click on Network

Now you are in the Network config. On the last row there is MAC Address Pass Through. Click on Disabled (If it is not on enabled)

Select Internal MAC Address

When its set Press F10 to Save and Exit

Click on Yes to confirm

Now the laptop is ready.

]]>
562
Enable MAC pass through on Lenovo T480s https://van-daag.nl/?p=543 Fri, 31 Mar 2023 09:30:31 +0000 https://blog.van-daag.nl/?p=543 Here is a walk tough to enable MAC pass though for when connecting it to a docking but don’t want to use the MAC of the docking because of network security.

This is only for the Lenovo Thinkpad T480s

Start the laptop by pressing the Power button and Press F12 on the keyboard to enter the Boot menu/BIOS

When your Boot menu/BIOS is Password protected, Enter the Password

Now the system is entering the Boot Menu

The Boot Menu is now loaded.

Use TAB on your keyboard to switch to App Menu, then press Enter to go in to Setup

Now you are entered in to the BIOS

Use the right arow key to move to Config, and press Enter on the Network

Now use the down arrow key to go to MAC Address Pass Through

When you are on MAC Address Pass Through

Press the Enter Key, Press on Down arrow key to Enable it, and press Enter

When it is enabled. Press F10 to Save and Exit the BIOS

Confirm the changes by selecting Yes and then Enter

Now the laptop is ready.

]]>
543
Fix Domoticz DB https://van-daag.nl/?p=358 Fri, 28 Dec 2018 20:27:25 +0000 https://blog.van-daag.nl/?p=358 The FIX::

You need to have sqlite3 installed on your Pi

CODE: SELECT ALL

sudo apt-get install sqlite3 

If you have it you can do the following commands:

CODE: SELECT ALL

cd ~
cd domoticz
sqlite3 domoticz.db
.mode insert
.output dump.sql
.dump
.exit

Remove first line of dumped database:
tail dump.sql -n +2 > dump1.sql
# Make back-up of original just in case:
mv domoticz.db domoticz.bak.db
# Import into fresh database:
sqlite3 domoticz.db < dump1.sql
# Clean-up the temporary files:
rm dump*.sql

https://www.domoticz.com/forum/viewtopic.php?t=10984

]]>
358
Domoticz Cisco Port on / of switch https://van-daag.nl/?p=351 Mon, 26 Nov 2018 09:00:46 +0000 https://blog.van-daag.nl/?p=351 Script is created by Johan ven Boomgaard.

#!/bin/bash
# Set-cisco-port.sh
# ==============
# |Author: JvdB|
# ==============
# 
# Find,disable,enable port using SNMP at Cisco switch#
# 
# Usage: cd <directory> ./Set-cisco-port.sh <switch ip-address> <description> <action>
# Example: cd <directory> ./Set-cisco-port.sh 192.168.2.250 Test-pc e 
#
# Where:
# - 1st parameter is switch IP address
# - 2nd is Description of NIC/Device
# - 3rd is operation(e - enable port when find description at port, d -disable port when find description at port)
#
# =======================================
# Start script with setting the variables
# =======================================
#
switch_ip=$1;
desc=$(echo $2 | sed 's/://g');
community="private";
operation=$3;
#
2970_get_port(){
# Check for description at port
for i in `snmpwalk -On -v2c -c $community@1 192.168.2.250 .1.3.6.1.4.1.9.9.46.1.3.1.1.2  | sed 's/.1.3.6.1.4.1.9.9.46.1.3.1.1.2.1.//g'  | awk '{print $1}'`; do
        find_mac=`snmpwalk -On -v2c -c  $community@$i 192.168.2.250 .1.3.6.1.2.1.17.4.3.1.1 | sed s/' '//g  | grep -i $desc | sed 's/^.*Hex-STRING\://g'| awk '{print $1}'`;
        if [[ $find_mac != "" ]]; then
                point1=$(snmpwalk -On -v2c -c $community@$i $switch_ip .1.3.6.1.2.1.17.4.3.1.1 | sed s/' '//g  | grep -i $desc  | sed 's/.1.3.6.1.2.1.17.4.3.1.1.//g' | sed 's/=.*//g' );
                port_numb=`snmpwalk -v2c -c $community@$i $switch_ip .1.3.6.1.2.1.17.4.3.1.2  | grep -i $point1 | sed 's/^.*INTEGER\: //g'`;
                echo "Description $desc was found at port number #"$port_numb;
        fi
done;
}
disable_port(){
        echo "Going to disable port by Description";
	# Find by port description
        port_to_disable=`snmpwalk -v2c -On -c $community $switch_ip .1.3.6.1.2.1.31.1.1.1.18 | grep -i $desc | sed 's/.1.3.6.1.2.1.31.1.1.1.18.//g' | awk '{print $1}'`;
        # If port was not found
        if [[ $port_to_disable == "" ]]; then
                echo "Port wasn't found by port description. Exiting ...";
                2970_get_port;
                $port_to_disable=$port_numb;
                echo $ $port_to_disable;
                exit;
        fi;
        # Disable port
        snmpset -v2c -c $community $switch_ip .1.3.6.1.2.1.2.2.1.7.$port_to_disable i 2;
        # Save running config of Cisco switch to startup
        save_2970_cfg;
}
enable_port(){
        echo "Going to enable port by Description";
        # Find by port description
        port_to_enable=`snmpwalk -v2c -On -c $community $switch_ip .1.3.6.1.2.1.31.1.1.1.18 | grep -i $desc | sed 's/.1.3.6.1.2.1.31.1.1.1.18.//g' | awk '{print $1}'`;
        # If port was not found
        if [[ $port_to_enable == "" ]]; then
                echo "Port wasn't found by port description. Exiting ...";
                2970_get_port;
                $port_to_enable=$port_numb;
                echo $ $port_to_enable;
                exit;
        fi;
        # Enable port
        snmpset -v2c -c $community $switch_ip .1.3.6.1.2.1.2.2.1.7.$port_to_enable i 1;
        # Save running config of Cisco switch to startup
        save_2970_cfg;
}
save_2970_cfg(){
        echo "Saving Cisco 2970 switch configuration";
         snmpset -t60 -v2c -c $community $switch_ip 1.3.6.1.4.1.9.2.1.54.0 i 1
}
main(){
        if [[ $operation == "f" ]]; then
                echo "Find port operation";
                2970_get_port;
        elif [[ $operation == "d" ]]; then
                echo "Disable port operation";
                disable_port;
        elif [[ $operation == "e" ]]; then
                echo "Enable port operation";
                enable_port;
        else
                echo "Wrong arguments given";
        fi;
}
main;

 

]]>
351
Monitor domoticz https://van-daag.nl/?p=349 Mon, 26 Nov 2018 08:52:38 +0000 https://blog.van-daag.nl/?p=349

Monitoring door Monit voor Raspberry Pi en Domoticz

]]>
349
Update Synology Mail Plus spam server more than once a day. https://van-daag.nl/?p=337 Fri, 26 Oct 2018 11:59:31 +0000 https://blog.van-daag.nl/?p=337 Update Synology Mail Plus spam server more than once a day

Just found the scripts that you can run and schedule to run more often than once a day. And if you run ClaimAV as virusscanner.

Run the following scripts.

bash /volume1/@appstore/MailPlus-Server/scripts/SpamRuleUpdate.sh all
bash /volume1/@appstore/MailPlus-Server/scripts/SpamAutoLearn.sh
bash /volume1/@appstore/AntiVirus/scripts/clamav.sh check_update

]]>
337
Raspberry PI as a VPN Client to FRITZBOX with IPSEC https://van-daag.nl/?p=300 Mon, 23 Jul 2018 11:23:41 +0000 https://blog.van-daag.nl/?p=300 Setup of VPN at the Fritzbox

First, a new user is created under System-> FRITZ! Box user.

Here, the access from the Internet must be granted and VPN (of course, be unlocked, everything else is deselected.

we remember the information from the iphone settings:

  • Description:
  • Server: arpdggefuegr23723n.myfritz.net
  • Account: vpn_user
  • Password: Password of the FRITZ! Box user “vpn_user”
  • Use certificate is disabled
  • Group name: vpn_user
  • Shared Secret: TANrpS1y34hHHJGIS4
 Now it goes on the Raspi ….

Installation:

sudo apt-get install vpnc

Create and customize config:

sudo nano /etc/vpnc/fritzbox.conf

IPSec gateway arpdggefuegr23723n.myfritz.net
IPSec ID vpn_user
IPSec secret TANrpS1y34hHHJGIS4
IKE Authmode psk
Xauth username vpn_user
Xauth password <passwort>
local port 0
DPD idle timeout (our side) 0

first test of the tunnel:

sudo vpnc fritzbox.conf

Ending the VPn connection:

sudo vpnc-disconnect

I have the start of the script in /etc/rc.local registered so that the VPN connection is established during boot.

vpnc fritzbox.conf

– Update –

Since the VPN connection breaks partially uncontrolled Abdelkader Wahb has made a script that monitors the connection and reboots when needed. I do not want to deprive you of this:

Entry in / etc / crontab so that every 3 minutes is automatically executed on boot:

* / 3 * * * * root /etc/init.d/autovpncscript

Source: kuemmel.wtf

]]>
300
Raspberry pi cleanup script https://van-daag.nl/?p=267 Tue, 29 May 2018 06:05:28 +0000 https://blog.van-daag.nl/?p=267 Create with the following command in your raspberry pi the script.

sudo nano cleanup.sh

Paste below the text and with CTRL + X close nano

#!/bin/bash
 
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"
 
if [ $USER != root ]; then
echo -e $RED"Error: must be root"
echo -e $YELLOW"Exiting..."$ENDCOLOR
exit 0
fi
 
echo -e $YELLOW"Cleaning apt cache..."$ENDCOLOR
aptitude clean
 
echo -e $YELLOW"Removing old config files..."$ENDCOLOR
sudo aptitude purge $OLDCONF
 
echo -e $YELLOW"Removing old kernels..."$ENDCOLOR
sudo aptitude purge $OLDKERNELS
 
echo -e $YELLOW"Emptying every trashes..."$ENDCOLOR
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null
 
echo -e $YELLOW"Script Finished!"$ENDCOLOR

To run the script. First:

sudo chmod 777 cleanup.sh

Start the cleanup:

Sudo ./cleanup.sh

 

]]>
267