Tuesday, June 26, 2018

run program on windows minimized



Manual method, set from "normal" "maximized" "minimized' in properties.
https://www.cnet.com/how-to/how-to-automatically-start-a-program-minimized-in-windows/

launch via command prompt minimized

https://stackoverflow.com/questions/23057448/open-program-minimized-via-command-prompt

To open notepad in minimized mode:
start /min "" "C:\Windows\notepad.exe"
To open MS word in minimized mode:
start /min "" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"



-30-

windows 10 startup at first logon



We only need to have our program running after the first user login, so no need for an earlier start.  Also none of the functions are required to be present when the user is not logged on, so logoff killing all applications, including this one is okay.

The start menu example:

C:\Users\jws\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

is sufficient for starting the fso.  shortcut to app needs to be installed there to launch

manual way to do it:
https://www.windowscentral.com/how-launch-apps-automatically-during-startup-windows-10

shell:startup

shell:AppsFolder

will bring up installed apps and startup folder (abs path above) for the user it is run on.

application is run w/o admin privileges so should be find with just a shortcut, not rights elevation.

https://www.howtogeek.com/208224/how-to-add-programs-files-and-folders-to-system-startup-in-windows-8.1/

With registry entries

https://winaero.com/blog/how-to-add-or-remove-startup-apps-in-windows-10/

To add or remove startup apps for the current user from the Registry, you need to follow the instructions below:
  • Open Registry Editor.
  • Go to the following key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run.
  • There you will find startup items for current users which are stored in the Registry:
If we need runonce vs. run always.

https://docs.microsoft.com/en-us/windows/desktop/SetupApi/run-and-runonce-registry-keys

The Windows registry includes the following four keys:
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
 complaint from github about Installshield

https://github.com/HandBrake/HandBrake/issues/414




-30-

Monday, June 25, 2018

crontab examples



example:  to run a program every 5 minutes

*/5 * * * * /root/checkmotion/checkmotion.sh

https://crontab.guru/every-5-minutes 

https://crontab.guru/examples.html

crontab template

*/5      *       *       *       *
Minute   hour    day     month   day
                (month)         (week)


*           any value
,           value list separator
-           range of values
/           step values
@yearly     (non-standard)
@annually   (non-standard)
@monthly    (non-standard)
@weekly     (non-standard)
@daily      (non-standard)
@hourly     (non-standard)
@reboot     (non-standard)


to edit crontab;

export EDITOR=vi
crontab -e

(or editor of choice)

-30-

Sunday, June 24, 2018

raspberry pi bluetooth audio


as of 10/2017 versions of raspbian, it appears that bluetooth raspberry pi bluetooth adio doesn't work.

A lot of the thread below is for any bluetooth (probably adding a USB adapter for the RPI).

My attempt is for Raspberry Pi Model 3 B which has bluetooth  on the board.

Select audio device by right clicking the gui symbol and selecting audio device.

https://www.raspberrypi.org/forums/viewtopic.php?t=192859

https://raspberrypi.stackexchange.com/questions/53408/automatically-connect-trusted-bluetooth-speaker

https://www.raspberrypi.org/magpi/bluetooth-audio-raspberry-pi-3/

note after all the audio crap, VLC playback of video produces a black box, no video on the 7" raspberry pi screen frame buffer.  Not so useful.

bluetoothctl
scan on
<search for device>
copy device address
pair <device>
connect <device>

should show connected on gui bluetooth gui.

right click the gui audio, and bluetooth device should be available as a device for audio.

-30-

Saturday, June 23, 2018

Add On Screen Keyboard to Raspberry Pi 7' or other screen


if a touch screen rpi is large enough to use an on screen keyboard, this is how to install and enable it.

https://www.raspberrypi.org/forums/viewtopic.php?t=14719

The discussion above mentions the matchbox keyboard, and doesn't mention installing it.

As of the April 2018 raspbian, the matchbox keyboard is not included in the installed goods.  And for good reason, since it is only useful for touch screens.  It could be used with a mouse only system, but would of course be a bit painful.

to install it:
sudo apt-get -y install matchbox-keyboard

to execute it:
sudo matchbox-keyboard

To add it to a desktop

create a file on the Desktop called keyboard.sh

write in the file
#!/bin/bash
matchbox-keyboard

Then open a terminal and
write :
cd Desktop
chmod +x keyboard.sh

Now you can double click the file and your keyboard will appear.

-30-

Wednesday, June 20, 2018

friendlyarm nanopi t4 with rockchip 3399


Notes about setting up Lubuntu bits on the t4 board

login is pi, default pi

http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T4#Connect_NVME_SSD_High_Speed_Hard_Disk_to_T4

Connect NVME SSD High Speed Hard Disk to T4

Connect a NVME SSD hard disk to NanoPC-T4's M.2 interface, initialize and automatically mount the SSD by running the following commands. Before proceed turn off your T4 and connect an SSD to your T4. Power on your T4 and open a command line utility(go to top left of the GUI and enter System Tools -> LXTerminal) or SSH to your T4.

We suggest you switch to "root" by running the following command:
su -
The password for "root" is "fa".

Detection of SSD

root@FriendlyELEC:~# cat /proc/partitions 
major minor  #blocks  name
   1        0       4096 ram0
 259        0  125034840 nvme0n1
If there is a nvme0n1 device node it means an SSD is recognized by T4.

Partition of SSD

To mount an SSD under Linux we re-partition it as one section by running the following command:
(echo o; echo n; echo p; echo 1; echo ""; echo ""; echo w; echo q) | fdisk /dev/nvme0n1
If you want to re-partition it to multiple sections you can run "fdisk /dev/nvme0n1". For more detail about this command refer to the fdisk's manual.

Format Section to EXT4

After an SSD is successfully partitioned you can check its sections by running "cat /proc/partitions". The image provided treats a PCIe nvme device's sections as an eMMC's sections you will find that an SSD has some small sections.

We can check the "blocks" column and the biggest section is available for users. The /dev/nvme0n1p7 section is used to store data:
root@FriendlyELEC:~# cat /proc/partitions 
major minor  #blocks  name
   1        0       4096 ram0
 259        0  125034840 nvme0n1
 259        1       4096 nvme0n1p1
 259        2       4096 nvme0n1p2
 259        3       4096 nvme0n1p3
 259        4      12288 nvme0n1p4
 259        5      32768 nvme0n1p5
 259        6      32768 nvme0n1p6
 259        7  124932440 nvme0n1p7

The following command formats a section to ext4:
mkfs.ext4 /dev/nvme0n1p7

Auto Mount SSD on System Startup

Before we mount an SSD's section you need to know its Block ID. You can check it by running "blkid":
blkid /dev/nvme0n1p7
/dev/nvme0n1p7: UUID="13fb682e-ef40-4c71-b98b-3d17403e1205" TYPE=“ext4"
Add a "Block ID" to "/etc/fstab" and here is what it looks like
UUID=<Block ID> /media/nvme ext4 defaults 0 0
You need to replace <Block ID> with the UUID obtained by running "blkid". To mount the SSD in our example we made the "/etc/fstab" file as follows:
UUID=13fb682e-ef40-4c71-b98b-3d17403e1205 /media/nvme ext4 defaults 0 0
We want to mount an SSD to "/media/nvme" but this directory doesn't exist. Therefore we create it and change its access right by running the following commands:
mkdir /media/nvme
chmod 777 /media/nvme
Run "mount" to check if the SSD is mounted successfully:
mount /media/nvme
You can reboot your T4 to check if your SSD will be automatically mounted:
poweroff

-30-

Monday, June 11, 2018

How to find out port usage program on windows

On linux, one can type

sudo netatat -aopn

to get a list of processes which are in operations with ports on the system.  The "p" parameter required superuser access to get the pid.

On Windows 10 (and perhaps others) one can do the same

Using an administrator privilged cmd window, you get the same access as superuser for accessing ports

netstat -abno in that window will show all the processes on the system and their pids

To determine the process name associated with each pid

tasklist

will do that.  One can locate a specific task with for example:

tasklist /fi "pid eq 4444"


https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows
https://stackoverflow.com/questions/27211427/find-process-name-by-its-process-id
-30-

Thursday, June 7, 2018

Force bios mode during boot on Vmware player


Vmware player has notoriously made it impossible to catch the bios boot for some reason, somehow thinking that will make one buy vmware workstation, maybe.

This is how to force the boot on vmware player as of jun 2018, anyway

Edit the virtual machines VMX file and add this

to make it easier to access the BIOS setup screen, edit the configuration (.vmx) of the virtual machine and add or edit one of these options:
  • bios.forceSetupOnce = "TRUE"

    This forces entry to the BIOS setup at startup.

  • bios.bootDelay = "xxxx"

    This adds a delay to the initial POST screen, showing it for longer and giving you more time to access the BIOS setup, where xxxx is the number of milliseconds to show the POST screen (There are 1000 milliseconds in a second.). The maximum value for the boot delay is 10000 milliseconds or 10 seconds.

https://kb.vmware.com/s/article/1004129

-30-