Sunday, December 29, 2024

20241229 remove alibabaprotect.exe

Ref: https://blog.yeshere.org/2023/01/remove-alibaba-pc-safe-service.html

Mix things up

takeown /f  "C:\Program Files (x86)\AlibabaProtect" /r /d y  

sc delete AlibabaProtect

sc queryex AlibabaProtect

taskkill /pid <pid number> /f

This will fail.


Rename  "C:\Program Files (x86)\AlibabaProtect" to "C:\Program Files (x86)\AlibabaProtect_"

Reboot

After reboot, remove the folder.

Sunday, May 19, 2024

20240519 Never Zero

1,LTCM合伙人Victor Haghani反思kelly准则在金融界至今仍被忽视- 硬币实验

https://knowen-production.s3.amazonaws.com/uploads/attachment/file/2159/Haghani-Dewey%2Bexperiment.pdf

2,kelly本人 1956年 A New Interpretation of Information Rate论文原文

https://www.princeton.edu/~wbialek/rome/refs/kelly_56.pdf

3,赛马相关论文

1)1976

https://www.journals.uchicago.edu/doi/abs/10.1086/260419?journalCode=jpe

2)2017

https://etheses.whiterose.ac.uk/17852/1/Chi%20Zhang-PhD%20Thesis.pdf

4,赛马专业数据

https://www.totalperformancedata.com/live-pr-api/

Monday, April 3, 2023

20230404 Install ruby on M1 Mac

brew update

brew upgrade

% brew --version

Homebrew 4.0.11

Homebrew/homebrew-core (git revision e9b537f0839; last commit 2023-03-12)

Homebrew/homebrew-cask (git revision a992121346; last commit 2023-03-12)

brew install rbenv

Add these two lines to .zshrc

export PATH="$HOME/.rbenv/bin:$PATH"

eval "$(rbenv init - zsh)"

brew install libyaml

brew install virtualenv

rbenv install -l

rbenv install 2.7.8

rbenv install 3.0.6

rbenv install 3.1.4

rbenv install 3.2.2

rbenv global 2.7.8

ruby --version

ruby -e "puts (1..100).reduce(:+)"

rbenv global 3.2.2

ruby --version

ruby -e "puts (1..100).reduce(:+)"

Thursday, March 9, 2023

20230308 Bamboo Build had to be cancelled: it was marked as in progress in DB

08-Mar-2023 01:34:16 Build XXXX-FPE25-JOB3-191 had to be cancelled: it was marked as in progress in DB but no agents were assigned to it.

UPDATE BUILDRESULTSUMMARY SET LIFE_CYCLE_STATE = 'Finished' where  BUILD_KEY = 'XXXX-FPE25-JOB3' and BUILD_NUMBER = 191
UPDATE BUILDRESULTSUMMARY SET BUILD_STATE = 'Unknown' where  BUILD_KEY = 'XXXX-FPE25-JOB3' and BUILD_NUMBER = 191
UPDATE BUILDRESULTSUMMARY SET BUILD_CANCELLED_DATE = '2023-03-08 17:25:44.2950000' where  BUILD_KEY = 'XXXX-FPE25-JOB3' and BUILD_NUMBER = 191
UPDATE BUILDRESULTSUMMARY SET BUILD_AGENT_ID = 0 where  BUILD_KEY = 'XXXX-FPE25-JOB3' and BUILD_NUMBER = 191
UPDATE BUILDRESULTSUMMARY SET DELTA_STATE = 'NONE' where  BUILD_KEY = 'XXXX-FPE25-JOB3' and BUILD_NUMBER = 191
UPDATE BUILDRESULTSUMMARY SET LIFE_CYCLE_STATE = 'Finished' where  BUILD_KEY = 'XXXX-FPE25' and BUILD_NUMBER = 191

Need to restart according to Atlassian support. 

Wednesday, March 8, 2023

20230308 Start Docker Desktop at the Windows Startup

https://stackoverflow.com/questions/51252181/how-to-start-docker-daemon-windows-service-at-startup-without-the-need-to-log/59467740#59467740

  • Task Scheduler
  • General
    • User: xxxx
    • Run whether user is logged on or not
    • Run with highest privilege
  • Triggers
    • At Startup
    • Delay task for 1 minute
    • Enabled
  • Action
    • Start a program
    • C:\Program Files\Docker\Docker\Docker Desktop.exe
Needed:
  • User xxxx must be in the Administrator group (edit Local Users and Groups)
  • May add xxxx to docker group

Additional:
  • Manually start Docker Desktop, accept agreements, uncheck "Open Docker Dashboard at Startup"
The agreement and dashboard may block the auto startup. 



Tuesday, January 10, 2023

20230110 Error Code 0x800F0954 Windows 10

Temporarily bypass WSUS server using the following registry edit (requires administrator privileges).

1. Right-click Start, and click Run
2. Type regedit.exe and click OK
3. Go to the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
4. In the right-pane, if the value named UseWUServer exists, set its data to 0
5. Exit the Registry Editor
6. Restart Windows update service

Reference: https://learn.microsoft.com/en-us/answers/questions/112308/error-code-0x800f0954-on-windows-10.html

Wednesday, December 7, 2022

20221207 PowerShell auto update

 PowerShell 7.2 enables a default auto update with Windows Update. 

To disable,

$pwshRegPath = "HKLM:\SOFTWARE\Microsoft\PowerShellCore"
if (!(Test-Path -Path $pwshRegPath)) {
    throw "PowerShell 7 is not installed"
}

Set-ItemProperty -Path $pwshRegPath -Name UseMU -Value 0 -Type DWord

Thursday, November 3, 2022

20221103 Windows Server 2019 Docker Linux container

Reference

https://stackoverflow.com/questions/57317141/linux-docker-ee-containers-on-windows-server-2016/57691939#57691939

https://github.com/docker/labs/issues/490

https://computingforgeeks.com/how-to-run-docker-containers-on-windows-server-2019/


Thursday, May 26, 2022

20220526 git move folders with their history to another repo

Main ref: https://mattsch.com/2015/06/19/move-directory-from-one-repository-to-another-preserving-history/

If there are multiple folders, we need to do thing differently.

  1. Source repo
    1. git remote rm origin
    2. git filter-branch --index-filter 'git rm --cached --ignore-unmatch -rf XXX' --prune-empty -f HEAD
      1. for all other folders or files
      2. for all subtrees, just do a clean up
  2. Dest repo
    1. git remote add <branch> <source repo directory>
    2. git checkout <branch>
    3. git checkout <Dest repo working branch>
    4. git merge develop --allow-unrelated-histories
    5. git push
    6. add back subtree
    7. git push
The assumption is that the directory names in the source repo remain the same in the dest repo.  If different, the commit history needs to change. 
  • Directory name and level manipulation shall be done at the Source repo side.  This shall greatly simplify the merge. 

Thursday, April 28, 2022

20220428 LDAP query

Download and install Remote Server Administration Tools for Windows 10

  • https://www.microsoft.com/en-us/download/details.aspx?id=45520

Open up a Powershell console and use Active Directory cmdlets

  • https://docs.microsoft.com/en-us/powershell/module/activedirectory/?view=windowsserver2022-ps

Examples:

Get-ADUser -Identity "username"

  • get basic user info

Get-ADPrincipalGroupMembership username| select name

  • get all groups that a user belongs to


Get-ADGroup

Get-ADGroupMembers



Wednesday, March 30, 2022

20220330 powershell configure pagefile.sys

 Only for Powershell 5

Get-Volume; $pagefile = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges; $pagefile.AutomaticManagedPagefile = $false; $pagefile.put(); $pagefileset = Get-WmiObject Win32_pagefilesetting; $pagefileset.InitialSize = 1024; $pagefileset.MaximumSize = 8339; $pagefileset.put();Gwmi win32_Pagefilesetting | Select Name, InitialSize, MaximumSize; restart-computer -force


Monday, March 1, 2021

Youtube mp3/mp4 download

https://github.com/ytdl-org/youtube-dl/blob/master/README.md#readme

on Windows PC

start CMD.exe

type wsl

sudo apt update

sudo apt install youtube-dl

youtube-dl -x --audio-format mp3 --embed-thumbnail -o "%(playlist_index)s-%(title)s.%(ext)s" URL


yt-dlp -f "bestaudio[ext=m4a],bestaudio[ext=webm]" -x --audio-format mp3 --audio-quality 0 -o "%(playlist)s%(playlist_index)03d %(title)s.%(ext)s" URL


yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -S vcodec:h264 --windows-filenames --restrict-filenames --write-auto-subs --sub-lang "en.*" --embed-subs --add-metadata --add-chapters --no-playlist -N 4 -ci --verbose --remux-video "mp4/mkv" URL


Download MIT class

yt-dlp -f "bestaudio[ext=m4a],bestaudio[ext=webm]" -x --audio-format mp3 --audio-quality 0 -o "%(playlist)s/%(titles)s.%(ext)s" "https://www.youtube.com/watch?v=wWnfJ0-xXRE&list=PLyQSN7X0ro203puVhQsmCj9qhlFQ-As8e"

Friday, January 29, 2021

20210129 mac mini m1 laptop

mac mini把电源模块改成电池可行吗? - 知乎
https://www.zhihu.com/question/432675947/answer/1683427375

版权属于知乎和原作者

先放图,可行.
12月份拿到机器之后没多久就手痒将原装电源拆下来,改成type c供电.主要是给PD诱骗器画了个固定件然后3d打印出来.用诱骗器直接向PD电源诈骗20v,然后再降压到12v供给主板.


后来觉得这么大个机箱,主板才这么点大小,干脆塞一组电池进去算了,当个UPS不香吗

然后就换了个电源管理板子,再塞了4颗三星50e进去,刚好能塞满了整个机箱.

给电池画了支架,能刚好扣在风扇的固定柱上
因为赶着要用,电池组在最后装的时候手上没有高温胶带,就随便找了卷胶布包的像个粽子一样,反正能用就不管美观了,不炸就行23333.
风扇装上去之后是这个样子的.
能用就行.jpg塞进去的电池能量在70Wh左右,Mac mini满载功耗加上屏幕和ssd我测了一下在40w左右,理论上能满载续航一个半小时.当然了我平时把这组电池当UPS用,电池电压会调成单节4v停充,避免长时间满电搞坏电池.缺点嘛,没法在系统里面看电量,外部断电的时候也没有报警装置,用起来的时候还是有点怕怕的,只是我应对的都是短时间断电就没所谓了.另外折腾成这个样子保修估计悬了.


Parts:
* 诱骗器PD23.0转DC100W直流20V触发转接USBC笔记本T12供电改Type-C

* LM5118模块 自动升降压模块 大功率电源模块 高效率电源模块

* 三星 21700 50G 50E 低内阻锂电池 充电宝手电筒适用 拆机

* 铅蓄锂电池充电24V19V12v9V5V10A移动电源直流UPS不间断电源模块



改装DIY升级苹果 MAC mini Macbook 线性电源 专用滤波模组接口板

Mod a Mac Mini for DC Power
Battery is NP-L7S

2018 Mac Mini power supply wiring

Connector

Monday, August 24, 2020

Ball Balancing PID System

 


https://www.instructables.com/id/Ball-Balancing-PID-System/