Author Archives: Error-Prone

Remove Tencent Cloud (QCloud) Cloud Monitor

bash /usr/local/qcloud/stargate/admin/uninstall.sh
bash /usr/local/qcloud/YunJing/uninst.sh
bash /usr/local/qcloud/monitor/barad/admin/uninstall.sh

rm -rf /usr/local/sa
rm -rf /usr/local/agenttools
rm -rf /usr/local/qcloud

process=(sap100 secu-tcs-agent sgagent64 barad_agent agent agentPlugInD pvdriver )
for i in ${process[@]}
do
  for A in $(ps aux | grep $i | grep -v grep | awk '{print $2}')
  do
    kill -9 $A
  done
done

# Optional
chkconfig --level 35 postfix off
systemctl stop postfix
systemctl mask postfix

GMMK Pro Restores to Original Firmware from VIA

Minimal guide how to flash GMMK Pro keyboard from factory firmware to VIA firmware and vice versa.

Factory firmware to VIA firmware

  • Download VIA firmware
  • Download QMK Toolbox
  • Unplug your keyboard and reconnect it while holding the spacebar and B at the same time
  • You should see a message in the QMK Toolbox that indicates that your board is in STM DFU Bootloader Mode.
  • Load the VIA firmware and press Flash

VIA firmware to facttory firmware

  • Download factory firmware
  • Unplug your keyboard and reconnect it while holding the ESC (The official guide is wrong that tells you to hold spacebar and B)
  • You should see a message in the QMK Toolbox that indicates that your board is in STM DFU Bootloader Mode.
  • Load the factory firmware and press Flash

NPM Publish Error 402 Payment Required – You must sign up for private packages

When publishing public scoped packages you might get the following errors:

npm ERR! code E402
npm ERR! 402 Payment Required - PUT https://registry.npmjs.org/.... - You must sign up for private packages

This happens when trying to publish public scoped packages. The default access level is private. To resolve this you can either set npm config set access public or add the following to your package.json:

"publishConfig": {
  "access": "public",
  "registry": "https://registry.npmjs.org/"
},

Microsoft 365 Excel Performance Hack for UHD Displays in Windows

If you have a large spreadsheet to edit (ie. 10k+ columns) with your UHD display (ie. 4K or higher resolution) in Microsoft 365 Excel you may have some performance issues when scrolling.

I just found an easy hack that works for me:

  1. Check Disable hardware graphics acceleration in Excel under File – Options – Advanced – Display section
  2. Exit Excel
  3. Change your display resolution to 1920×1080
  4. Change text scale to 100%
  5. Open the spreadsheet you need to edit with Excel
  6. Change your display resolution back to native resolution
  7. Change text scale back to your original option (ie. 200%)
  8. See magic happens

This hack works until you exit your Excel. So you have to redo step 3-8 when openning new documents.

Download Bilibili 4K Videos. The Hard Way

Requirements:

  • Google Chrome installed
  • Get cookies.txt extension installed
  • youtube-dl installed
  • FFmpeg installed
  • Active bilibili membership (to get 4K streaming perk)
  • Basic JSON and Bash knowledge

Steps:

  • Open the video page you want to download with Google Chrome
  • Open Web Inspector and refresh the page
  • Change video quality to some lower ones (like 480p) and change back to 4K
  • Search for player/playurl in Inspector
  • You should get a JSON payload returned:

Then select one of the most recent requests with accept_quality that has 120 in array:

Then select down to the data.dash.video[0].baseUrl and data.dash.audio[0].baseUrl. Remember these URLs:

Open Get cookies.txt extension and download your current cookies.

Download video and audio with youtube-dl:

youtube-dl --cookies bilibili.com_cookies.txt --referer 'https://www.bilibili.com/video/BV1d5411g7g2' 'https://xxx.mcdn.bilivideo.cn:4483/upgcxcode/12/67/336676712/336676712-1-30232.m4s...'

Then you will get two files like the following:

  • 20210510 336676712-1-30280 [336676712-1-30280].m4s
  • 20210510 336676712-1-30120 [336676712-1-30120].m4s

Rename the video extension to mp4 and audio to m4a. Play them to check if everything works.

Combine these two with FFmpeg:

ffmpeg -i 20210510\ 336676712-1-30120\ \[336676712-1-30120\].mp4 -i 20210510\ 336676712-1-30280\ \[336676712-1-30280\].m4a -c copy output-combined.mp4

Fix Invalid Package Name “.DS_Store” for Node.js NPM Global Update on macOS

If you got the following error message when run npm update -g:

$ npm update -g
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name ".DS_Store": name cannot start with a period

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sparanoid/.npm/_logs/2021-04-28T13_59_32_013Z-debug.log

Simply run if you installed your Node.js via Homebrew:

find /usr/local -name '.DS_Store' -type f -print -delete