Thursday, July 19, 2018

Removing disk appeared after big Windows 10 update

After big Windows 10 new disk appeared. This is drive with data needed for Windows Recovery. Earlier it was hidden and now it is visible as normal drive.
Problem is that disk is full of data and Windows regulary warns about no free disk space on it. To solve it you should not delete partition, it is enough to unassign driver letter from it Taken from here.
I just wonder why this 'wanrning' feature is not disabled on this disk?

  1. Select the Start  button, type cmd, select and hold (or right-click) Command Prompt in the list of results, and then choose Run as administrator.
  2. In the Administrator: Command Prompt window, type diskpart, then press Enter.
  3. Type list volume, then press Enter. Note the volume number (Volume ###) for the drive letter (Ltr) you want to remove. 
  4. Type the following command, where [volume number] is the volume number you noted in the previous step, then press Enter:

         select volume [volume number] 
  5. Type the following command, where [drive letter] is the drive letter you want to remove, then press Enter:

         remove letter=[drive letter] 
  6. The drive letter will no longer appear in File Explorer and Disk Management. You may close the command prompt window.

Tuesday, June 26, 2018

Permanent disabling digital signature requirement for drivers in Windows 10

Windows 10 x64 (and also some other versions of  Windows) requires that drivers which are going to be installed must have digital signature. Certificates chain should contains Microsoft Root certificate.
 This is good for security, but not convinient for drivers developers who should build and test drivers.

To disable this requirement temporary (until Windows reboot) Press and hold 'Shift' key, then choose 'Reboot' in Windows main menu. Then in service menu choose 'additional' variants and find option 'Disable driver signature verification'. Again : it will work until next Windows reboot.

In order to make this permenent : open console with Administrator permissions and execute two commands:

> bcdedit /set testsigning on

and

> bcdedit /set nointegritychecks on

Important! If these commans will fail, then reboot, go to BIOS and disable  'Safe Boot' option !

Formats of PublicKey in Eliptic Curve Cryptography (ECC)

In ECC public key is a point on curve with coordinates (x,y)

In uncompressed format it is 65 bytes : [0x04] [32 bytes of X] [32 bytes of Y]

But as long as X can be delivered from Y, you can omit Y. It is called 'compressed format':

[02 if Y is even | 03 if Y is odd] [32 bytes of X]

Total 33 bytes long.

If key is only  32 bytes long -- then it is just point X. If you'll add  02 or 03 in front then you'll get  compressed format - which can be used in different Crypto APIs.

How to start / stop Linux service manually

To start or stop service, execute command:


$ sudo service <service-name>  [ start | stop ]

How to add Linux service to autostartup

If you wish that your service would start during Linux boot, you have to execute following commands:


sudo update-rc.d <service-name> defaults
 
This should add the service to the automatic startup system. But if you get:
System start/stop links for /etc/init.d/<service-name> already exist.

Execute the command:


sudo update-rc.d <service-name> enable

How to add pm2 service (node.js) to autostartup

If you wish that your node.js service which is under monitoring of 'pm2'  tool will be started automatically during system start, you have just to execute following command from service folder:


$ pm2 startup

How to refresh service list on Ubuntu


After adding new service in /etc/init.d/ you should refresh service list by executing following command:


$ systemctl daemon-reload

How to install Java on Linux from .tar.gz

$ sudo tar xvzf jdk-8u5-linux-i586.tar.gz -C /usr/java
 
now to set your JAVA_HOME environment variable:

$ JAVA_HOME=/usr/java/jdk1.8.0_05/
$ sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000
$ sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000
 
make sure the Oracle's java is set as default java by:

$ update-alternatives --config java

Useful command to work with apt-get

1. How to get version in installed package?

sudo apt-cache policy <package-name>

2. How to get list of all installed packages?

sudo dpkg -l

Streaming video : file -> gstreamer -> vlc

tested on  Ubuntu:

on server:
gst-launch filesrc location=file.mp4 ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! ffenc_mpeg4 ! rtpmp4vpay send-config=true ! udpsink host=<ip_of_VLC_PC> port=5000

on client create file test.sdp with contents:

v=0
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 MP4V-ES/90000


and open it VLC..

How to play video file using Gstreamer

Tested on Ubuntu.

Variant 1. Using playbin:

gst-launch playbin uri=file:///pathto/test.mp4


Variant 2. Using filesrc:

gst-launch filesrc location=video.avi ! decodebin2 name=dec ! queue !
ffmpegcolorspace ! autovideosink dec. ! queue ! audioconvert ! audioresample !
autoaudiosink

Streaming video using gstreamer to VLC

On server execute (tested on Ubuntu)

gst-launch videotestsrc ! ffenc_mpeg4 ! rtpmp4vpay send-config=true ! udpsink host=<ip_of_vlc_PC> port=5000

On receiver-host create file test.sdp файл with following contents:

v=0
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 MP4V-ES/90000


Launch VLC, choose 'Open file..' and select test.sdp

GStreamer on Android. Building Tutorials

Descriptions on official site http://docs.gstreamer.com/display/GstSDK/Android+tutorial+1%3A+Link+against+GStreamer does not work.

Also this manuals not fully ok http://www.fluendo.com/media/papers/gstreamer-on-android.pdf


1. We will use Lunux (Ubuntu 12, 64 bit in Hyper-V) and cerbero build system

git clone git://anongit.freedesktop.org/gstreamer-sdk/cerbero
cerbero -c config/cross-android.cbc bootstrap
cerbero -c config/cross-android.cbc package gstreamer-sdk

this would download all required packages

2. Download Android SDK: ADT-bundle with eclipse.
Add to  $PATH :  adt/sdk/tools

Before building of tutorial execute in project folder:
 
android update project -p . -s --target android-17

Last paramter - target can be determined android list target

'android' located in sdk/tools/

3. In jni/Android.mk before lines

ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID


add lines:

GSTREAMER_SDK_ROOT := /home/<user>/cerbero/dist/android_arm  # this is path to cerbero..
GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/




4. In Java part of tutorial (src/..) copy GStreamer.java from folder gstreamer-sdk

5. jni/ndk-build, Eclipse - debug application..

will create  bin/ foder in folder of tutorial. There you'll find fresh generated TutorialX.apk..

Skype on MeeGo 1.2 (Samsung N100)

There is rare MeeGo OS, it is Linux based system for mobiles.

Officially Skype is not supported on MeeGo, but it is possible to run version for  Linux Fedora.

Last available version of skype on official site in the moment of writing is v4.1, but for this all required dependencies can not be fulfilled (QtWebKit ..  - ldd /usr/bin/skype). 
But version skype-2.1.0.81-fc10.i586.rpm works pretty good, even if it is also reports dependecy problems. Audio and video calls are supported.
Tested on Samsung N100.

Capturing audio from microphone on Raspberry Pi (Debian)

Initial conditions:

1) Debian Linux on Raspberry Pi (arm7)
2) Logitech USB Microphone

So, first of all:

1. Installing ALSA, SOX using apt-get.
 
Actual capturing performed by following command:

 > sox -t alsa default recording.wav

If you'll get an error:

sox FAIL formats: can't open input  `default': snd_pcm_open error: No such file or directory

It means that default audio capturing device is not specified. Solution is here.

Creating file .asoundrc in home directory with following contents:

pcm.!default {
  type hw
  card 1
}


where card ID (in our case 1) - taken from /proc/asound/cards:

 0 [ALSA           ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA
                      bcm2835 ALSA
 1 [AK5370         ]: USB-Audio - AK5370
                      AKM AK5370 at usb-bcm2708_usb-1.2, full speed
Welcome to It Hints blog. Here is posted small IT hints which can be useful for administrators and developers.