2021-12-30

What is the 1st thing to do after check out angular project from git?

 

What is the 1st thing to do after check out angular project from git?

Reference URL: https://stackoverflow.com/a/54142081



npm install



2021-12-17

Extract some pages from a PDF file with Foxit free?

 

Foxit doesn't have this feature.

But found this workaround from foxit forum.






Actually you can easily delete pages on the FoxIt Free version. Here is how:

1) Make sure you have FoxIt Reader PDF Printer installed
2) Click the printer icon or press control P while viewing your PDF
3) Select "FoxIt Reader PDF Printer" as your printer from the drop-down menu
4) Select the "Pages" radio box and enter the pages you want in your PDF (in your case enter "2-3")
5) A new PDF will now be generated containing only the pages you specified, effectively deleting the other pages from your PDF












2021-12-04

Blocking .Net Framework 4.7 installations?

 

Source URL: https://dotnet.microsoft.com/download/dotnet-framework/net35-sp1

MARTIN BRINKMANN
Jun 12, 2017
Windows
|
10

Windows users who don't want the Microsoft .NET Framework 4.7 at this point in time may block the Windows Update deployment of it.

Microsoft released the new .Net Framework 4.7 back in April 2017, and announced back then that it would distribute the new version "in a couple of months" through Windows Update.

Anyone interested in the new version could download online and offline installers for the .Net Framework 4.7 already.

The new version introduces new capabilities to the framework which users will benefit from as well once they are integrated into .Net applications. This includes high DPI support for Windows Forms, touch support for WPF applications, performance and reliability improvements, and enhanced cryptography support.

The new version is an in-place upgrade for the following .Net Framework versions: 4, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2.

Note: The Microsoft .Net Framework 4.7 is part of The Windows 10 Creators Update. If you run that particular version of Windows 10, you are all set already.

Blocking the .Net Framework 4.7

block net framework 4.7

Microsoft notes in a new support article that some businesses and organizations may have the requirement to block the installation of the new .Net Framework version for a temporary period of time.

Provided through Windows Update and Windows Server Update Service (WSUS), the .Net Framework 4.7 is offered as a recommended update on all platforms that Microsoft released it for.

Windows administrators who want to block the deployment of the latest version of the .Net Framework need to set a Registry key for that. While there may be other means to do that, hiding the update in Windows Update, or using manual updating methods only, this is the recommended method by Microsoft.

  1. Tap on the Windows-key, type regedit.exe, and hit the Enter-key on the keyboard. This should start the Windows Registry Editor.
  2. Go to the key: HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP
  3. Right-click on NDP and select New > Key.
  4. Name that key WU.
  5. Right-click on WU, and select New > Dword (32-bit) Value.
  6. Name it BlockNetFramework47.
  7. Set its value to 1 (double-click it to set value).

Microsoft admits in the support article that this is a temporary block. The company has yet to reveal for how long it will block the deployment of the new .Net Framework.

We will update this article once Microsoft communicates the deadline.

TipUse the .Net Framework 4.7 Cleanup Tool to remove versions completely from your system.


















2021-11-22

ActiveMQ couldn't start.

 


java.net.BindException: Address already in use: JVM_Bind


resolved by turn off device's Mobile Hotspot





Reference URL: https://stackoverflow.com/a/17694754


If you are using Windows 7, please try to disable "Internet Connection Sharing (ICS)" service.


2021-11-18

Angular pipe could not be found

 


Angular pipe could not be found



Reference URL: https://stackoverflow.com/a/40463405


see this is working for me.

ActStatus.pipe.ts First this is my pipe

import {Pipe,PipeTransform} from "@angular/core"; @Pipe({ name:'actStatusPipe' }) export class ActStatusPipe implements PipeTransform{ transform(status:any):any{ switch (status) { case 1: return "UN_PUBLISH"; case 2: return "PUBLISH"; default: return status } } }



main-pipe.module.ts in pipe module, i need to declare my pipe/s and export it.

import { NgModule } from '@angular/core'; import {CommonModule} from "@angular/common"; import {ActStatusPipe} from "./ActStatusPipe.pipe"; // <--- @NgModule({ declarations:[ActStatusPipe], // <--- imports:[CommonModule], exports:[ActStatusPipe] // <--- }) export class MainPipe{}



app.module.ts user this pipe module in any module.

@NgModule({ declarations: [...], imports: [..., MainPipe], // <--- providers: [...], bootstrap: [AppComponent] })



you can directly user pipe in this module. but if you feel that your pipe is used with in more than one component i suggest you to follow my approach.

  1. create pipe .

  2. create separate module and declare and export one or more pipe.

  3. user that pipe module.

How to use pipe totally depends on your project complexity and requirement. you might have just one pipe which used only once in the whole project. in that case you can directly use it without creating a pipe/s module (module approach).










2021-11-16

gzip with -9 option

 
A log file: with size of: 789M

gzip with different option, to have different compression as below

gzip -9 file.log
32M


gzip -9 file.log
37MB




example #2


-rw-r--r--. 1 srvusr srvusr  87M Jul 18 19:53 output.log.20220718_pm074234.log
-rw-r--r--. 1 root   root    87M Jul 21 12:01 output.log.20220718_pm074234.without9.log


sudo gzip -9 output.log.20220718_pm074234.log
sudo gzip output.log.20220718_pm074234.without9.log


-rw-r--r--. 1 srvusr srvusr 4.0M Jul 18 19:53 output.log.20220718_pm074234.log.gz
-rw-r--r--. 1 root   root   4.2M Jul 21 12:01 output.log.20220718_pm074234.without9.log.gz





2021-10-22

Export connections in MySQL Workbench



saw in log:
%USERPROFILE%\AppData\Roaming\MySQL\Workbench\connections.xml


cd %USERPROFILE%\AppData\Roaming\MySQL\
zip up whole folder: Workbench

restore in new laptop, and done.

you can get what you have in previous laptop, the price to pay so far is: rekey in all passwords for all connections.







2021-10-21

Subversive vs Subclipse

 

Found a chinese article sharing his experience as per title.


从 Subclipse 到 Subversive: 第一印象

Source URL; https://cumt.org/blog/550

His preference is: Subversive.






I never run into any issue among these, Subversive vs Subclipse before version 2020-09, until 2021-06 tested with Subclipse.














Eclipse 2021-09 unable install Subversive - SVN Team Provider 4.0.5

 


"The following solutions are not available: Subversive - SVN Team provider 4.0.5"



Version: 2021-09

The following solutions are not available: Subversive - SVN Team Provider 4.0.5 (id=org.eclipse.team.svn.resource.ignore.rules.jdt.feature.group, site=http://download.eclipse.org/technology/subversive/4.0/update-site/)


Version: 2021-06

The following solutions are not available: Subversive - SVN Team Provider 4.0.5 (id=org.eclipse.team.svn.resource.ignore.rules.jdt.feature.group, site=http://download.eclipse.org/technology/subversive/4.0/update-site/)


but URL still reachable via browser: http://download.eclipse.org/technology/subversive/4.0/update-site/





So I manual add to install with Eclipse@202109.






For later versions: 



Archived: How to clear the 'SoftwareDistribution' folder on Windows 10 and make updates happen again

 


WINDOWS 10 ADVANCED
How to clear the 'SoftwareDistribution' folder on Windows 10 and make updates happen again
If Windows Update isn't working, it could be caused by a problem with the SoftwareDistribution folder, and here we'll show you how to fix it.
MAURO HUCULAK
16 Mar 2017


On Windows 10, the "SoftwareDistribution" folder is an essential component for Windows Update, which temporarily stores files needed to install new updates to keep your device secure and with the latest fixes and improvements.

This folder is maintained by the WUAgent (Windows Update Agent), and typically, it should be left alone, but there will be times when you may need to clear its content manually in the case the Datastore and Download folders aren't synchronized, and it's preventing Windows Update from applying new updates to your PC.

Usually, if you're having trouble with Windows Update, or after updates have been applied, it's safe to empty the content of the SoftwareDistribution folder. Windows 10 will always re-download all the necessary files, or re-create the folder and re-download all the components, if removed.






In this Windows 10 guide, we'll walk you through the steps to delete the content inside the SoftwareDistribution folder. As an alternative option, we'll also show you the steps to rename the folder, in case you only want to test if the folder's content is the one causing problems.

How to clear the 'SoftwareDistribution' folder

To delete the content inside the SoftwareDistribution folder, do the following:

  1. Open Start.
  2. Search for Command Prompt, right-click the result, and select Run as administrator.
  3. Type the following command to stop the Windows Update Service and press Enter:

    net stop wuauserv

  4. Type the following command to stop the Background Intelligent Transfer Service and press Enter:

    net stop bits

  5. Use the Windows key + R keyboard shortcut to open the Run command.
  6. Open File Explorer and browse the following path:

    C:\Windows\SoftwareDistribution

  7. Select all its content and click the Delete button to clear the content.

    Quick Tip: In the case, you're having trouble deleting all the files, simply restart your computer, and try again.

  8. On Command Prompt, type the following command to start the Windows Update Service and press Enter:

    net start wuauserv

  9. Type the following command to start the Background Intelligent Transfer Service and press Enter:

    net start bits

Once you completed the steps, Windows 10 will reconfigure the folder and re-download all the necessary components.

How to rename the 'SoftwareDistribution' folder

If you don't want to delete the content inside of the folder, you can alternatively, rename the folder to troubleshoot Windows Update problems.

To rename the SoftwareDistribution folder, do the following:

  1. Open Start.
  2. Search for Command Prompt, right-click the result, and select Run as administrator.
  3. Type the following command to stop the Windows Update Service and press Enter:

    net stop wuauserv

  4. Type the following command to stop the Background Intelligent Transfer Service and press Enter:

    net stop bits

  5. Use the Windows key + R keyboard shortcut to open the Run command.
  6. Type the following command to rename the folder and press Enter:

    rename %windir%\SoftwareDistribution SoftwareDistribution.bak

    Quick Tip: If the command isn't letting you rename the folder, try steps No. 3 and 4 one more time, and then try to rename the folder.

  7. Type the following command to start the Windows Update Service and press Enter:

    net start wuauserv

  8. Type the following command to start the Background Intelligent Transfer Service and press Enter:

    net start bits

After you've completed the steps, Windows 10 will re-create the folder and re-download all the necessary components.

The only caveat with this process is that the SoftwareDistribution folder also includes the Windows Update history information, which means that emptying up the folder will result in loss of this data. In addition, you'll notice that Windows Update will take longer than usual to detect and update your computer because the WUAgent must check and re-create the Datastore information. However, it's a small price to pay to get your device to update again.

While sometimes the folder may grow, it's only recommended to use these instructions only when necessary. You shouldn't mess with the SoftwareDistribution folder to free up storage space on your computer.







Upgrade nvm v1.1.7 to v1.1.8

 



Old files of version 1.1.7:


After run nvm-update.exe, it will prompt you which version to upgrade, and download files:













2021-09-25

Archived: Windows XP Pro won't boot, safe mode boot hangs at agp440.sys

 











If you see hard drive activity while the PC APPEARS to be stuck on agp440.sys, this is a GOOD thing since it means Windows XP is conducting chkdsk in the background. Let it finish, even if it takes all night. Just check it in the morning.

If that is not the issue, you will need to create your own bootable Windows XP Recovery Console CD, configure your PC's BIOS to boot from it, then actually boot from it, and then run the chkdsk command with the /r switch. Complete instructions may be found in ElderL's post from this thread:


For simplicity, here they are:

Power failures are notorious for corrupting your NT File System (NTFS), so you need to boot into the XP Recovery Console and run chkdsk  /r  until it reports no errors (that may take more than one pass).  You are on the right track though.

If after burning your CD as indicated below, you do NOT see the message:

Press any key to boot from CD...

Then you need to get into the BIOS in your system of unspecified make and model and adjust the device boot order to put the CD Drive as the first boot device.

If you see the same missing or corrupt message instead something is not right and you need to look at things more closely.  Sometimes there is an option on the screen when the system reboots to press a key to select a boot device (mine is F11) and then you can just choose the CD/DVD drive as the boot device.

If anybody wants to recreate these sorts of problems for practice, just pull the plug on your running XP system 4 or 5 times and you will all the message we know and love.



Here are my standard suggestions:

You can make a bootable Recovery Console CD by downloading an ISO file and burning it to a CD.

The bootable ISO image file you need to download is called:

xp_rec_con.iso 

Download the ISO file from here:

http://www.mediafire.com/?ueyyzfymmig

Use a new CD and this free and easy program to burn your ISO file and create your bootable CD:

http://www.imgburn.com/

When installing ImgBurn, DO NOT install the Ask toolbar.

Here are some instructions for ImgBurn:

http://forum.imgburn.com/index.php?showtopic=61

It would be a good idea to test your bootable CD on a computer that is working.

You may need to adjust the computer BIOS settings to use the CD ROM drive as the first boot device instead of the hard disk.  These adjustments are made before Windows tries to load.  If you miss it, you will have to reboot the system again.

When you boot on the CD, follow the prompts:

Press any key to boot from CD...

The Windows Setup... will proceed.

Press 'R' to enter the Recovery Console.

Select the installation you want to access (usually  1: C:\WINDOWS)

You may be asked to enter the Administrator password (usually empty).

You should be in the C:\WINDOWS folder.  This is the same as the 

C:\WINDOWS folder you see in explorer.

The Recovery Console allows basic file commands like: copy, rename, replace, delete, cd, chkdsk, fixboot, fixmbr, etc.

For a list of Recovery Console commands, enter help at the prompt or read about the XP Recovery Console here:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/recovery_console_cmds.mspx?mfr=true

A good idea before starting things is to first verify the integrity of your file system using the chkdsk command.

From the command prompt window run the chkdsk command on the drive where Windows is installed to try to repair any problems on the afflicted drive.

Running chkdsk is fine even if it doesn't find any problems.  It will not hurt anything to run it.

Assuming your boot drive is C, run the following command:

chkdsk C: /r

Let chkdsk finish and correct any problems it might find.  

It may take a long time for chkdsk to complete or it may appear to be 'stuck'.  Be patient.  If the HDD light is still flashing, chkdsk is doing something.  Keep an eye on the percentage amount to be sure it is still making progress.  It may even appear to go backwards sometimes.

You should run chkdsk /r again until it finds no errors to correct.

Remove the CD and type 'exit' to leave the RC and restart the computer.

You do not have to adjust the BIOS again to boot on the HDD since the CD will not be present.






















2021-09-23

Unable update table where clause in same sub table.

 




https://stackoverflow.com/a/43610081




If you can't do

UPDATE table SET a=value WHERE x IN
    (SELECT x FROM table WHERE condition);

because it is the same table, you can trick and do :

UPDATE table SET a=value WHERE x IN
    (SELECT * FROM (SELECT x FROM table WHERE condition) as t)

[update or delete or whatever]