Script copies UltraVNC to target client (C:\vnc\) and executes UltraVNC with configurable settings. Launches VNC Viewer afterwards and removes VNC (optional).

The ACL part is variable if you use it in an Domain environment. Start uvnc_settings.exe and configure Domain Access with groups or edit the *ultravnc.ini and change to:


Requirements and Usage:
– Copy psexec.exe to C:\Windows
– Run the Powershell with Admin-Rights / elevated Console
– User has to be admin on the target and local machine
– Default password = 123

– Save the Script and create a folder on the same level called „UltraVNC“
– Copy UltraVNC Programm Files to the UltraVNC folder
– Run vnc_deploy.ps1 (elevated)

Download Script, VNC, PSexec

#PowershellScript vnc_deploy.ps1:

# Administrator Privilige needed for Execution Policy Change
Set-ExecutionPolicy RemoteSigned

write "---------------------------------------------"
write "VNC Remote Access"
write "---------------------------------------------"
write "(1) Connect without permission(1)"
write "(2) Ask user for permission (2)"
$q = read-host "(1/2)"
switch ($q)
"1" {
$Hostname_PS = read-host "Enter hostname"
write "---------------------------------------------"
write "Install VNC on remote host"
write "---------------------------------------------"
copy-item UltraVNC\ -dest \\$Hostname_PS\c$\vnc -recurse
write "Assigning Config"
copy-item \\$Hostname_PS\c$\vnc\NOprompt_ultravnc.ini -dest \\$Hostname_PS\c$\vnc\ultravnc.ini -recurse
psexec \\$Hostname_PS C:\vnc\winvnc.exe -service loadinf=C:\vnc\NOprompt_ultravnc.ini
write "VNC copied to $Hostname_PS "
write "---------------------------------------------"
write "Assign security settings"
psexec \\$Hostname_PS C:\vnc\MSLogonACL.exe /i /o C:\vnc\acl.txt
write "starting VNC service"
psexec \\$Hostname_PS C:\vnc\winvnc.exe -install
start-sleep -s 5
write "---------------------------------------------"}
"2" {
$Hostname_PS = read-host "Enter hostname"
write "---------------------------------------------"
write "Install VNC on remote host"
write "---------------------------------------------"
copy-item UltraVNC\ -dest \\$Hostname_PS\c$\vnc -recurse
write "VNC copied to $Hostname_PS"
write "---------------------------------------------"
write "Assigning Config" 
copy-item \\$Hostname_PS\c$\vnc\prompt_ultravnc.ini -dest \\$Hostname_PS\c$\vnc\ultravnc.ini -recurse
psexec \\$Hostname_PS C:\vnc\winvnc.exe -service loadinf=C:\vnc\prompt_ultravnc.ini

write "Assign security settings"
psexec \\$Hostname_PS C:\vnc\MSLogonACL.exe /i /o C:\vnc\UltraVNC\acl.txt
write "Starting VNC service"
psexec \\$Hostname_PS C:\vnc\winvnc.exe -install
start-sleep -s 5
write "---------------------------------------------"}}

write "Connecting to $Hostname_PS"
& UltraVNC\vncviewer.exe -connect $Hostname_PS -quickoption 7
write "---------------------------------------------"
write "---------------------------------------------"
write "---------------------------------------------"
write "---------------------------------------------"
$Pause = read-host "Enter any to uninstall VNC"
write $Pause
psexec \\$Hostname_PS C:\vnc\winvnc.exe -uninstall
start-sleep -s 5
Remove-Item \\$Hostname_PS\c$\vnc -recurse
write "---------------------------------------------"

If you dont want to login with password everytime or you want to use autossh then you should think about Key Login or Key based authentication in SSH.

Generate SSH-Key:


by default they are saved here



pi@pi:~/.ssh $ ls -lart
insgesamt 16
drwxr-xr-x 20 pi pi 4096 Jän 3 18:47 ..
-rw-r--r-- 1 pi pi 390 Jän 3 18:47
-rw------- 1 pi pi 1679 Jän 3 18:47 id_rsa
drwx------ 2 pi pi 4096 Jän 3 18:47 .

show content of generated file:

RPQEYZHgKulwZpl71lqtOv+/oSyW+g+QomvbRXu9PqbXtbRThNQw4YfpiN pi@pi

Copy to remote machine (where you want to login without password)

vi /user/.ssh/authorized_keys

copy the content inside of this file.

SSH Connection to the host should now be possible without using password.

Makes also AutoSSH possible:

autossh -R 20000:localhost:22

to connect from the other side:

ssh -p 20000 pi@localhost

Recieved 2 additional Raspis and couldnt’stop setting them up unfortunately the display ordered was broken so i didnt build the mobile RetroPi. So I tried it with my cheap china beamer:


Longrunner Cam with Raspberry and self build Lego Case.


Unfortunately broken display (Raspi HD TFT Hat 800×480).

But a 10″ touch screen and case arrived


Kuman Raspberry Pi 3.5

+ Raspberry Pi 3 B+

+ Anker PowerBar (10000 mAh)

Installed NetPi Image from:

see also:

Install additional Kali-Tools

apt-get install git
# git clone  && sudo cp katoolin/ /usr/bin/katoolin
chmod +x /usr/bin/katoolin

establish remote ssh-connection via ssh reverse tunnel (provides ssh-connection to rasp in a network via a server/device with a public ip)

on the raspberry:

ssh -R 2222:localhost:22 loginOfServerIP@ServerIP
on server side to connect back to raspberry:

ssh -p 2222 loginOfComputerWithoutPublicIP@localhost

verify usage of autossh  if regularely needed


mysql::db do failed: MySQL server has gone away at ./ line 1848

Solved by

set a higher value for wait_timeout and connect_timeout in my.cnf

from the MySQL Documentation

  • wait_timeout : The number of seconds the server waits for activity on a noninteractive connection before closing it.
  • connect_timeout : The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake


  • If wait_timeout is 1800 (30 Minutes), the DB Connection will close in 30 minutes if the connection is idle (indicated by Sleep in the command column of the processlist).
  • If connect_timeout is 10, then mysqld will reject you if you cannot login (authenticate) in 10 seconds.

Kernel Panic after yum upgrade to kernel 3.10.0-957.1.3.el7.x86_64 ona Centos 7 VM:

– booted old kernel
– no initramfs-3.10.0-957.1.3.el7.x86_64.img in /boot

Solved by

– yum remove kernel-3.10.0-957.1.3.el7.x86_64

– verify uninstallation

rpm -qa | grep kernel | sort

– reinstall

yum install kernel-3.10.0-957.1.3.el7.x86_64

– verify again, check initramfs creation in /boot

rpm -qa | grep kernel | sort
ls -la /boot/initram

reboot into new kernel

see also:


Send mail via sendmail

vi /tmp/email.txt


Subject: Terminal Email Send
Email Content line 1
Email Content line 2


sendmail < /tmp/email.txt

Quick and dirty, with subject only:

mail -s "Test Subject" < /dev/null

Faking Mails with cutomized sender:

mail -s "Everything possible" < /dev/null

*Will be delivered into spamfolder or not delivered cause SPF checks that mailsender is not authorized sender of the maildomain –> only if accurate spamsolution/SPF is implemented on recipient side

Install/Config sendmail
for just relay edit /etc/mail/ and add:

"Smart" relay host (may be null)

or if ip based:

"Smart" relay host (may be null)

of course relay host must permit this.


If you ever wanted an automation when a process is not running it is just a small script helping to achieve this: (dont forget to make it executable)

check_process() {
  echo "$ts: checking $1"
  [ "$1" = "" ]  && return 0
  [ `pgrep -f $1` ] && return 1 || return 0 
#pgrep -n if process-name match exactly

while [ 1 ]; do
  # timestamp
  ts=`date +%T`
  echo "$ts: begin checking..."
  check_process ""
  [ $? -eq 0 ] && echo "$ts: not running, restarting..." && `/usr/bin/perl /home/me/ >/dev/null`
sleep 10


You can also send yourself a mail instead of just starting process instead of

/usr/bin/perl /home/me/


echo "Subject: Process is stopped" | sendmail

If you want to run this in background do

nohup &

or you can put this on startup via cronjob

crontab -e

@reboot root /home/me/