Monday, February 22, 2021

Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

 

https://github.com/PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

 To see the code being executed, please visit the following: http://bit.ly/2kn7mSp.

 I prefer using constructor injection (over field and setter injection) to keep the state in my components immutable. 

 The immutable state is important if you want to be able to run the component in a multithreaded runtime environment.

Tuesday, February 9, 2021

Linux add user into group

 Command: 

sudo /usr/sbin/usermod -a -G jboss $USER (one time efffort in your login whenever VM rebuilt to allow to edit file in "jboss jboss")


The people can run himself and logout, re-login,

Check "groups THEID | grep jboss" 


Thursday, February 4, 2021

MAC Crontab testing

 MAC Crontab testing

28 * * * * cd ~/auspix && ./hello.sh

@reboot cd ~/auspix && ./hello2.sh

1. It won't run before the login, even if added into Login Items. (Unless enable auto login)

2. After login, it will run when the screen is locked or the user is switched

3. When MAC is power on, another user logins, the crontab user doesn't login yet, the crontab will run

4. Before the login, MAC screen shows GMT time instead of local time!


Tuesday, February 2, 2021

沪深股票自动交易之交易执行

自动交易大概可以分为数据获取、交易策略、回归测试以及交易执行,做为小散,CTP/FIX等不适用,破解通达信DLL,会担心安全问题,比较合适的还是控制键盘鼠标来执行交易。

拿我使用的华泰证券来说,之前一直用AutoIt来做交易,但这个有两个问题,一是华泰证券升级之后,得做相应的改动,比如拷贝数据要输入验证码什么的。另一个问题是,因为身在国外的原因,连接华泰证券各站点,速度慢且不稳定,ping起来最少也有200多ms,甚至不能ping通。后来发现有个python的easytrader,简单又好用,感谢作者shidenggui。

第二个问题,曾经试过用google cloud,但必须在云主机上在安装VirtualBox,在VirtualBox上安装Windows XP,直接在google cloud上断开远程桌面后自动化的UI无法执行(解决方法见后)。easytrader不支持windows XP,如果在云主机上再安装windows 7/10的话,需要云主机很好的配置才可能。具体可参见这篇文章:如何关闭远程桌面后仍处于可交互状态

前几天试了一下腾讯云,意外发现在腾讯云的1核 2GB 1Mbps的标准型SA2主机上运行起来如行云流水,ping值只有20多ms,而且通过这位仁兄介绍的方法,远程桌面断开后也工作的很好。另外一种方式是用如shengdenggui推荐的TightVNC。设置windows自动登录,然后在交易前重新启动一下机器,定时运行的交易程序也会照常运行。

for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (

  %windir%\System32\tscon.exe %%s /dest:console

)

Sunday, January 17, 2021

Windows 10 ARM for MAC M1

 

1. Download Windows 10 on ARM

https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewARM64

Windows10_InsiderPreview_Client_ARM64_en-us_21286.VHDX

2. Download Parallels Desktop 16 for M1 Mac Technical Preview

https://my.parallels.com/desktop/beta

ParallelsDesktop-16.3.1-50393.dmg

3. Install PD and Windows 10

It only takes 9 minutes to install Windows 10 ARM

4. After restart, no internet, need to reinstall Prallels Tool


Verified it's very smooth to plan Leage of legends (FPS 120, Ping 22ms)

Able to use 华泰证券

It's not stable yet, but quite impressive.

Sunday, January 10, 2021

Angular note

 Udemy Angular - The Complete Guide (2020 Edition)

1. ng new my-first-app

n/n

   cd my-first-app

   ng serve

   http://localhost:4200/

2. ng new hello-cli

ng g c product --inline-style --inline-template --skipTests

will generate a single file, product.component.ts, with inlined styles and template and no test in the src/app/product directory,               

and add ProductComponent to the declarations property of @NgModule.

3. ng new ngAuction --prefix nga --routing

npm i bootstrap jquery popper.js --save-prod

ng serve -o

ng g c home

ng g c carousel

ng g c footer

ng g c navbar 

ng g c product-item 

ng g c product-detail 

ng g c search

ng g c stars

ng g s shared/product

    template: `

      <a [routerLink]="['/']">Home</a>                         

       <a [routerLink]="['/product']">Product Details</a>      

       <router-outlet></router-outlet>                         

     `           

4.

ng new angular-reddit  


Friday, January 8, 2021

English

 my soul is chaff when it's dampered by the blue light