Friday, December 27, 2019

UseAuthentification() and UseAuthorization differences in ASP.NET core 3.0

In the past few days struggling with implementing login on ASP.NET core 3.1 with razor
i have tried to use identityserver4 but it provides MVC template rather than razor. I actually got a simple example running but using it further has met with problems. Hence i decide to write some simple finding

what are the differences between authentication and authorization ?

app.UseAuthentication();
app.UseAuthorization();

in simple meaning,
authentication means we check a user is login or not
after login, we use policy to check the user claim and role whether they are authorized to access certain method
example role is Guest , Admin
example claim is email address, name

i put the reference here about authentification
https://visualstudiomagazine.com/articles/2019/04/01/aspnet-core-security.aspx
https://visualstudiomagazine.com/articles/2019/10/24/aspnet-core-security-2.aspx

An article on https://visualstudiomagazine.com/articles/2019/10/29/aspnet-authentication.aspx explains authorization nicely.

Saturday, August 31, 2019

adding SSD harddisk to HP Zbook Studio X360 G5

After adding M.2 NVMe PNY branded SSD to my laptop. we open disk management in Windows and is presented with this screen


after choosing the newer GPT partition style, i select disk 0, right click and select new simple simple volume
click Next and then select the partition size we want to partition our drive. 
We then choose to assign it a drive letter
Format the disk
After the very quick format we will see the new drive in windows explorer and start using it. 

Wednesday, December 26, 2018

HP Zbook Studio x360 G5

for very long time, i haven't purchased my own laptop, and last week i have received my new Zbook Studio G5. it is also the most expensive laptop that i have purchased at RM12k+

There are a couple of reason why i choose it. One is it has the combination of hardware performance i want - i7 8th generation with vPro, SSD (although only 500GB, but when i have more budget i can slot in another nvme ssd), nvidia P1000 and touch screen with pen. The hardware performance is essential for my work that involves software development involving computer vision and artificial intelligence. it is also graphically intensive as i deal with CAD software. One extra pulling factor is it has the pen input that i have long to have.

In addition, it does have a number of latest connection technologies, Bluetooth 5, thunderbolt 3. What is good is that it comes with a HDMI output, this save the trouble of hooking up to a bulky convertor to hook up for presentation, something i need to use frequently

Although i am not an artist, i enjoy writing and sketching ideas with pen. Zbook Studio G5 is paired with a WACOM pen. So far i am still very much a beginner with pen and there is nothing much that i can shout for it yet. But i do find that there is no good way for me to attach the pen to my laptop, although it comes with a holder that slots into the sd card slot. i worry that the protruding holder might break as i travel. Although the pen itself has magnet and can attach itself to the arm rest area of the laptop, that makes closing the lid not possible and risky (screen is easily broken if one accidently close the screen with the pen beneath. I find the way Microsoft surface attach its magnetic pen to the screen area is more convenient and elegant. Now i am thinking to shop for a leather holder for the pen. The pro is that the pen is responsive, and i have installed a couple of pen friendly program to try it out

Fresh paint
Tracing
One note
paint 3D
xodo
autodesk sketchbook

another thing i like after a few day usage is the feel of the keyboard, the keypress is responsive and the way the pad response to the fingers are very good. HP has really make a good keyboard for this.

Friday, December 14, 2018

troubleshooting visual studio 2017 community fail to install with event viewer

My visual studio 2017 community fail to install. after some troubleshooting, i find it is useful to use the windows event viewer


on windows search, search for event viewer. for my error it seems to be related to another program that i am running. after i end that program, installation of visual studio can be run without error



troubleshooting .net framework 3.5 won't install on windows 8.1

when this .net 3.5 framework cannot install on my windows 8.1 it make other installation fail (sourcetree, visual studio 2017). it also make uninstallation fail (like visual studio 2015)

after following some forum, i follow this thread https://www.softwarecrew.com/2012/07/net-framework-setup-verification-tool-adds-net-4-5-windows-8-support/

i install the .net framework verification tool and verify that .net 4.0 is running, and there are some comments on forum to suggest removing .net 4.0. i hesistate

eventually on the same blog by Aaron Stebner on .net framework cleanup tool at https://blogs.msdn.microsoft.com/astebner/2008/08/28/net-framework-cleanup-tool-users-guide/
As mentioned by Aaron, this tool is the last resort. Good news is that within this blog there is this .net framework repair tool 

i download and run the repair tool till the step to restart the windows installer service for me. i then successfully install .net framework 3.5 (along with 2.0 and 3.0). the last step is of course restart the pc

Saturday, September 8, 2018

Securifi Almond+ adding USB printer on Windows 10

I spent some time figuring out how to connect my USB printer to a Securifi Almond device.
i have Almond 3 and Almond+ and i find that although Almond 3 has USB port, it cannot be used for a USB printer. Below are the step for configuring a USB printer to Almond+

first follow the step on https://wiki.securifi.com/index.php/USB_printer_support_-_Almond%2B_2014

Then, in printer and scanners, try to add a printer. It will fail and we click 'The printer that i want isn't listed' . In the next page (screenshot below), select add a local printer


select create a new port







In the next page 
  • In the "Hostname or IP address:" field enter the IP address of your router.
  • The "Port name:" field may be set to something you like.
  • De-select "Query the printer and automatically select the driver to use," then click next.
  • The computer will then attempt to detect the TCP/IP port, and this will fail after some time.
  • On the "Additional port information required" page set the device type to Custom and click "Settings…"
  • Verify the Printer Name or IP Address. The Protocol should be set to "Raw" and the Raw Settings Port Number should be 9100. Leave LPR Settings and SNMP Status Enabled empty or de-selected. Then click OK.







After clicking next, select the printer driver of your printer.

Tuesday, July 31, 2018

My first Jenkins installation

after a good 3 hours, eventually i have managed to setup my first Jenkins on Ubuntu 16.04.4
due to some oversight i have actually set it up on the desktop version of Ubuntu. However, it should be working similarly to the recommended server version. I follow the instruction on https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04, but reader should take note that java jre and jdk are not installed automatically as dependency as guided in the url. I did a manual install via
sudo apt install openjdk-8-jre-headless
sudo apt install openjdk-8-jdk-headless

I have actually tried with server edition 18.04. it couldn't find the package of openjdk-8-jdk, causing Jenkins to fail installation

Sunday, June 17, 2018

4WD Arduino robot for my kid

It is school holiday and have some plan to buy something for my kid to learn arduino
Figure that this may be fun

Dfrobot MiniQ 4WD cross country robot

To be exact i do have similar 'robot' but i figure that this ready made is fun to learn. i will do it first then only pass to my kid to learn
There are 8 lessons for beginners, from entry-level to line-following, obstacle avoidance, and remote control. Users can easily grasp through the tutorial. All codings and tutorials are open and free to download.
Lesson Lists:
lesson1. Get to Know Your Robot
lesson2. Control Buzzer
lesson3. Light Direction Indication
lesson4. Line_following
lesson5. RGB LED
lesson6. Obstacle Avoidance
lesson7. Encoder
lesson8. IR Remote Control

Monday, October 23, 2017

Renesas GR Peach

GR-PEACH is the GR reference board for RZ family RZ/A1H group products. It is fully pin-compatible with Arduino UNO, GR-PEACH is an ARM® mbed™ enabled development platform. GR-PEACH takes advantage of Web browser-based program development and a robust library selection. With the added appeal of 10MB of built-in RAM and the processing power of ARM Cortex™-A, GR-PEACH was created for the developer interested high-speed prototyping of IoT devices with loads of HMI -- graphics, touch panel, camera input, audio, network and more!
specifications:
Item
Description
Microcontroller
RZ/A1H (R7S721001VCBG 324-pin BGA)
ROM/RAM
External FLASH 8MB/internal 10MB
Operating Frequency
400MHz
Operating Voltage
3.3V/1.18V
Board Function
USB host/peripheral (exclusive selection), Ethernet, XBee interface, micro SD socket, JTAG interface, user switch, reset switch, Arduino shield interface, user LEDs, USB mass storage class-like programming.
References


Event and Activities
a) GR Peach contest ASEAN

Sunday, October 22, 2017

AX88179 USB 3.0 to gigabit ethernet

I have some USB3.0 to gigabit ethernet adapter but was told AX88179 chipset based is more stable than realtek. Hence i tried buy Fosmon USB 3.0 to RJ45 10/100/1000Mbps Gigabit Ethernet LAN Network Adapter AX88179 QF QFN68 Chipset (Black) from Amazon to give it a try. It ships with a CD and because nowadays my laptop contains no DVD drive i have to either wait or finding the driver online. i did manage to find AX88179 driver on its manufacturer website, install but it doesn't work. Look like i have to try it elsewhere.

to be continued....


Friday, August 25, 2017

Weather Station part 1

We are suppose to build a weather station for IoT showcase during the MATLAB and Simulink Day 2017 at Singapore. We have created a completely working weather station simulation that update via Thingspeak in Simulink

now we want to build the real device

here are the list of components we use

raspberry pi 3
sense HAT for raspberry pi
anemometer  or weather station kit with anemometer and rain bucket
arduino nano - for doing i2c with raspberry pi and anemometer as raspberry pi doesn't do analog
or RPI B&A
logic converter (3.3V-5V)
8GB micro SD with NOOBS
PC104 header pin - for accessing GPIO with sense HAT installed
female to male jumper wires

reference
accessing GPIO with sense HAT installed - youtube video

Thursday, July 13, 2017

Echo Show makes science fiction home video conference nearer to reality

I have just decided to get my hand onto the new Amazon Alexa Echo Show
It is equivalent to an Echo Dot with a touch screen. What i like to explore is I can call another echo show owner by voice. What i watch as a child in science fiction show is now becoming a home consumer product. I have being using video conference products in my work since 2007, like webex, lifesize, skype for business, but none of them is voice activated. People will argue that Siri can do it but so far it is not of my liking. Not to mention, the iphone is much costlier than a device like echo show. I have actually also combine laptop, webcam and skype to video conference with my family member as early as 2009 but the usage is not very friendly from senior citizen. The Echo Show comes with 2 colours. For me, i prefer black :)

Age of embedded GPU Processing

As deep neural network (DNN) is becoming more popular in cognitive applications as such object detection, so is the embedded device meant to power it. For the past one month, i am trying out vision application for some demos to customers as well as self hobbyist project. I have run the Renesas GR Peach camera module and its video is noticeable not fast (although considering that it is an ARM MCU, it is still very impressive). I then try to do video processing with Zedboard, a Zynq powered FPGA board, but the workflow is rather tedious and requires lots of work. A latest device that i am looking at is the NVidia Jetson TX2.

It is a credit card size embedded board powered by dual core NVIDIA Denver2 and quad-core ARM Cortex-A57. It boasts a 8GB 128-bit LPDDR4 and integrated 256-core Pascal GPU. NVidia has a developer zone that provide resource for developer to play with the kit. So far i am still at the stage of literature review. The embedded board is meant for doing robotic and drone application.

I am planning to perform DNN with it. To ease learning curve in CUDA, i am going be using MATLAB to develop it. The parallel computing toolbox currently enable us to write algorithmn that can make use of GPU with simple syntax. In addition, the forthcoming the CPU Coder enable user to convert it into CUDA code, subsequently deploy it onto an embedded board like Jetson TX2.

The developer kit is launched somewhere in March 17 and now can be purchased online at Amazon. It can be shipped to south east asia free of charge.


Wednesday, April 12, 2017

Alexa remote for echo dot (2nd generation)

I have decided to give this remote control a try. it allows me to give commands beyond standard listening range of the echo dot. One still need to push the button on the remote to talk.


Thursday, March 9, 2017

IoT Training

I have first conducted my IoT talk 2 years ago at Singapore. Subsequently on and off i have talked and engaged with IoT related presentation and deployment with various people. Yesterday encountered an impromptu request to showcase Thingspeak at customer. Then only i have to summarized that it would be great if i can just permanently create a small IoT deployment example with the small microcontroller like ESP8266. I have used Arduino Mega with WiFI shield but it is slighlty bulky.


Tuesday, February 14, 2017

Next trip to Saigon

Next month early March i will be on my first business trip to Ho Chi Minh city, or previously known as Saigon. In fact its airport still carries SGN as name. It will be my 3rd trip to the city, the first more than at 2008, the second just last year. I have observed huge change to the city. Many new buildings but lesser motorcycles. Perhaps the population is getting richer and can afford car.

In my last trip 9 years ago i stay at New World Hotel, one of the best hotel back then. Last year i stayed at a budget hotel nearby the walking street. For next month, i will attempt my favourite hotel chain Accor. It is fascinating to find that there is a Pullman as well as Novotel at Ho Chi Minh and the Pullman seems cheaper. As a former French colony i would have wondered Vietnam is filled with Novotel, but it is not.

Right now, work aside, i am planning what to buy. Coffee bean, anyone?

Wednesday, February 8, 2017

The Amazon Fire tablet is on sale during this valentine season, discounted by $10
that makes the 8GB version around US$39.9 RM178 and the 16 GB around RM267
It is really a bargain, considering that other than having some amazon contents BUT also ads, it can interface with Alexa. considering that Echo dot cost $49.9, this is a cheaper version that can also act like tablet and as Kindle ebook reader.

I am really seriously considering getting it but haven't make up my mind whether i should go for 8GB or 16GB. Take note that it does support microSD card but some apps needs to be installed on built in storage. Now get by clicking the link below


Monday, January 30, 2017

Transferring Photo from iphone to windows 10 with SHARE it

my iphone 6p has being complaining about lack of disk space for months. Today i have finally transferred out many GB of photo to my windows 10 laptop. How to do it? After some searching, i settle down to an app that i have previously used for transferring files between android and ios, SHARE it. surprising it works like a charm and it is free (unlike some tools like wireless transfer app that has in app purchase)

first download SHARE it from windows store and install it on laptop. Likewise install SHARE it on iphone.

after that, connect both the phone and laptop to the same router. start the app on iphone, choose transfer. Start the app on windows 10, choose receive. Then we choose a folder to transfer, in my case my entire camera roll, and just sit back and relax. Due to its huge size it does take long time.
 

Friday, January 27, 2017

Day 2 Las Vegas to Williams for Grand Canyon

With the long journey ahead, we want to leave Las Vegas early for Grand Canyon. Along the way, we have decided to stay at a small town named Williams.




We reach Williams around 9pm. It is basically a city with two main roads, with shops and motels lining the streets. We stopped by a first one it cost around USD54 per night, and good for up to 4 pax. The strange thing we discover this trip is that most US motel has 2 double beds and can sleep up to 4. We eventually settled at the second motel we asked and it is a chain by Wyndham group, the Travelodge Williams Grand Canyon. Over the next few days, we continuously stay at Wyndham group franchise hotels. They are basic but provide free basic breakfast and the price and quality seems ok to us.


click here to find all the hotels at Williams.



Thursday, January 26, 2017

Almond 3 in Malaysia

i bump into Almond 3 while shopping for Amazon Echo Dot. It is a smart router with a touch screen that can support Alexa. Price at below US$140 per unit (cheaper if you buy those 3 in 1 package), it can double up as a DIY home security system. With its ZigBee support, one can try out various home automation project with it.  i actually bought what it terms as Used-slight imperfection on box

I have set my unit up today, connecting it to a LAN cable. the setup is very intuitive and browsing is really a breeze. When it is idle, it will become a clock.

it comes with a stylus at the upper right inside corner of the unit. with touch screen it is so easy to find out the settings

next step:
link with Alex
do some DIY hardware that connect to Almond 3.