Image

Image

Search This Blog

Sunday, December 18, 2022

Verify if the files refered by a variable in another files exists

If the file does not exist, rename the referencing file in *.BAD

SETLOCAL ENABLEDELAYEDEXPANSION 
::use local variables
set di=c:\temp
for %%f in (%di%\*.ctl) do ( 
::look in every file that ends in .ctl
for /f "tokens=1,* delims==" %%a in ('findstr /i "object_name=" "%%f"') do (
::get the name of the second file from the variable "object_name"
if not exist "%di%\%%b"(
 
::if the second file does not exist
move /y "%%f" "%%f.BAD" >>%di%\script_report.log 
::rename the .ctl file in .bad and let a trace in a logfile

                                             )  

                                                                                                                         )
                                           )
ENDLOCAL

 

 

type aaa.ctl:

[...]

 object_name=File.txt

[...]

Sunday, October 16, 2022

17

 another one. soon is already 20 :)

Sunday, July 17, 2022

Intel AMT revisited

 The old article refers to using the Intel AMT SDK and Real VNC Plus for connecting to the remote console, but a better solution is to use meshcommander - this allows you to control all the available devices in your local network form one place.

In order to install meshcommander, only NodeJS and the corresponding npm is needed, so it all resumes to:

mkdir ~/.meshcommander
cd ~/.meshcommander
npm install meshcommander 
 
then, to start, 
cd ~/.meshcommander/node_modules/meshcommander

node meshcommander
[--any (default is 127.0.0.1) --port (default is 3000)] 

and you can use the web console (http://localhost:3000):


 

 


Friday, June 24, 2022

EliteBook ambientlight sensor

Map keycode e033 (or any other key you choose) to the following command that toggles the sensor on or off:

echo $((1 - $(cat /sys/devices/platform/hp-wmi/als))) | sudo tee -a /sys/devices/platform/hp-wmi/als

Saturday, April 23, 2022

HiSilicon Hi3516Ev200 debrick

 HiSilicon Hi3516Ev200 camera gets bricked if tried to update the OpenIPC from the web interface running on :85, as the mtd block erase crashes the system during the process.

Download the latest build from github, unpack it and put it on the tftp directory.

wget https://github.com/OpenIPC/firmware/releases/download/latest/openipc.hi3516ev200-br.tgz | tar -zvx /tmp/tftboot

Set the local IP as 192.168.1.254

Start tftp server:   in.tftpd -L -vvvv -a 192.168.1.254:69 -s /tmp/tftpboot 

Connect the USBSerial adapter and configure minicom speed at 115200bps.


Connect power to the HiSilicon board and press CTRL+C

At the prompt, type:

setenv bootargs 'mem=${osmem:-32M} console=ttyAMA0,115200 panic=20 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=hi_sfc:256k(boot),64k(env),2048k(kernel),5120k(rootfs),-(rootfs_data)'
setenv bootcmd 'setenv setargs setenv bootargs ${bootargs}; run setargs; sf probe 0; sf read 0x42000000 0x50000 0x200000; bootm 0x42000000'
setenv uk 'mw.b 0x42000000 ff 1000000; tftp 0x42000000 uImage.${soc} && sf probe 0; sf erase 0x50000 0x200000; sf write 0x42000000 0x50000 ${filesize}'
setenv ur 'mw.b 0x42000000 ff 1000000; tftp 0x42000000 rootfs.squashfs.${soc} && sf probe 0; sf erase 0x250000 0x500000; sf write 0x42000000 0x250000 ${filesize}'
setenv soc hi3516ev200
setenv osmem 32M
setenv totalmem 64M
setenv ipaddr 192.168.1.10
setenv serverip 192.168.1.254
saveenv
run uk; run ur; reset  
 
Enjoy!

Blog Archive