Tag Archives: The operating system

How to Solve mount error(6): No such device or address

Error:

mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Samba server Settings:
[root@test1 ~]#cat /etc/samba/smb.conf
Global Settings:
[global]

    workgroup = test
    server string = Samba Server Version %v
    #log files split per-machine:
    log file = /var/log/samba/log.%m
    #maximum size of 50KB per log file, then rotate:
    max log size = 50
    security = user
    passdb backend = tdbsam
    load printers = no
    cups options = raw

The home Settings
[homes]

    comment = Home Directories
    browseable = no
    writable = yes
    create mode = 0664
    directory =0755

Projects

    comment = smbuser's home
    path    = /share
    browseable = yes
    writable = yes
    write list = @users

3 . font – family: tahoma; mso – bidi – font – family: tahoma;从/etc/samba/smb.Load smb configuration file conf
rlimit_max: increase rlimit_max(1024) to the minimum window limit (16384)
Process section “[homes]”
Processing section “[project]”
Loaded service file OK.
Server role:ROLE_STANDALONE
View service definition dumps by enter
# global parameters
(Global)

    server string = Samba Server Version %v
    workgroup = TEST
    log file = /var/log/samba/log.%m
    max log size = 50
    load printers = No
    security = USER
    idmap config * : backend = tdb
    cups options = raw

(home)

    comment = Home Directories
    path = 0755
    browseable = No
    create mask = 0664
    read only = No

(project)

    comment = smbuser's home
    path = /share
    read only = No
    write list = @users

Client mount
[root@test2 ~]# mount -t cifs //2.2.1.2/user1/mnt-o username=user1,password=4321
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


Check found an error setting for the server:
Solution: Change directory = 0755 in the home directory to Directory Mode = 0755
[homes]

    comment = Home Directories
    browseable = no
    writable = yes
    create mode = 0664
    directory **mode** = 0755

Testparm didn’t detect a problem, so it took a long time. The key is carefulness, carefulness!

Can’t open file: (errno: 24)

New structures, the database, the application after connecting up, with the following process:
120528 10:07:32 [ERROR]/usr/local/mysql/bin/mysqld: Can ‘t open file:./ag4_1/raa4_1 FRM’ (24) errno:
I didn’t look at the error code carefully at first! Thought the file was corrupted, reimport! Throw the above error again!
Use the perl error tool to see specific errors!
Linux:/usr/local/mysql/bin #./perror 24
OS error code 24: Too many open files
beyond the maximum number of open file limit! The maximum number of open files on the system is 65535. It cannot be exceeded! The maximum number of open files in the database must be out of limit!
Show variables like ‘open_files_limit’; show variables like ‘open_files_limit’;
>

Reproduced in: https://blog.51cto.com/imysqldba/883374

Solution of invalid username / password; login denied error in Oracle Database Foundation

A invalid username/password; CMD must be run as administrator in win7 or win8

1. Enter command under DOS:
SQLPLUS SYS/Password set at installation as SYSDBA
(enter)

2. Then type the command:
alter user scott account unlock;
 

When you enter, the words “User has changed” will appear, and you can move on to the next step.  

3. Enter the command:
conn scott/tiger
 

After entering, an error message (as follows) will appear:

ERROR:
ORA-28001: The password has expired
 

Change Scott’s password

New password:

4. Enter a new password;  

5. Repeat the new password.  

Finally, there you go!

Reproduced in: https://www.cnblogs.com/dfyg-xiaoxiao/p/7213772.html

use cin.get () instead of system (“pause”) to avoid the flash of C + + programs

C + + compiled in a separate console program execution time, often a flash, can’t see the output results, in order to solve this problem, there are a lot of people use the system (” pause “) to suspend, but so are a lot of disadvantages, there are two reasons for
a: poor portability
2: consume resources is very big, in both Windows and Linux

Instead of using system(“pause”) to pause, you can use STD ::cin.get() or getchar()
. Why not system(“pause”)?


Let’s take a look at the flow of system(“pause”)
1: Pause your program
: Start the Shell in the sub-process
3>ind commands to execute and allocate memory for them
4: Wai>r input
5: Recluse m>y
6: End the Shell <>> 7: Continue your program>

To summarize, use STD ::cin.get() or getchar() to pause the execution of a C ++ program

PS: the original http://www.gidnetwork.com/b-61.html

Reproduced in: https://blog.51cto.com/zhanggx/1305045

Solution to the flash of visual studio console program output window

     
When you first come into contact with Visual Studio, most people will write a Hello World program to try. Some people will find that the output window will flash past after execution, and there is no “Press any key to continue”. This happens in both Visual Studio 2008, 2010, and 2012, and some people might do it one of two ways:

Add system(“pause”) or getchar() at the end of the program code. In fact, this is a command under DOS.

 

The problem is that when you Press F5, the correct one should be Ctrl+F5, and the window will display Press any key to continue… That’s it. You can also see the results of the program run.

This is because F5 is in Debugging mode, where the window does not remain open once the application finishes running. If CTRL +F5 is in Start Without Debugging mode, you’ll be able to see the results.

 

If you press Ctrl+F5 and it still flashes, then use the following Settings:

Right-click on Project –>; Property – & gt; Configure properties –> Connector – & gt; System – & gt; Subsystem (on the right side of window) –>; SUBSYSTEM:CONSOLE Drop down SUBSYSTEM selection CONSOLE

[OpenGL] cannot start this program because the computer is missing glut32.dll. Try to re install the program to fix this problem. …

An error is reported when running OpenGL program, as shown in the figure:

Solution: Copy glut32.dll to the C:\ windows\ SysWOW64 directory instead of to the C:\ windows\ System32 directory as the online tutorial does.
Because my system is Win10 64-bit, the folder SysWOW64 is used to run 32-bit software.

Reproduced in: https://www.cnblogs.com/huahai/p/7270952.html

Solutions to several VTK compilation errors (vtk5.8 + VS2010)

There are several common errors that can occur during the compilation of a VTK project. The solutions are as follows:
error 1:
fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403
cause:
The minimum version of the system set for version migration is too low
Visual C++ 2010 no longer supports targeting Windows 95, Windows 98, Windows ME, or Windows NT. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros. When you upgrade a project that was created by using an earlier version of Visual C++, You may see compilation errors related to the WINVER or _WIN32_WINNT macros if they are assigned to a version of Windows that is no longer supported (From MSDN)
The immediate cause – there are three lines of code in atlcore.h:
#if _WIN32_WINNT < 0x0403
#error This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.
#endif
> bbb>
All in VTK directory stdafx. H file reference to modify WINVER, http://msdn.microsoft.com/en-us/library/aa383745.aspx _WIN32_WINNT, _WIN32_WINDOWS and _WIN32_IE definition, for example: # define WINVER 0 x0501
 


error 2:
error C2371: ‘char16_t’ : redefinition
:
In VTK project files are generated in the process of choosing the Matlab support (tex-mex), and adopted the VS2010 and above programming environment (http://connect.microsoft.com/VisualStudio/feedback/details/498952/vs2010-iostream-is-incompatible-with-matlab-matrix-h) :
I looked at the source code for matrix.h < core/matlab/include/matrix.h>
It has a definition for char16_t
typedef char16_t char16_t;” . Also the C++ header “Microsoft Visual Studio 10.0\VC\ Include \ YVALS. H “Also defines the same identifier(CHAR16_T). Because of these two definitions we get the redefinition error when matrix iostream.h(it internally includes yvals.h) are included in some cpp file.
Declaration of char16_t in the yvals.h is newly introduced in dev10 and was not there in VS2008. Therefore you are getting this redefinition error now on VS 2010(Dev10).

> solution 1 (without follow-up test) : BBB>
//added by John for solving conflict with VS2010
#if (_MSC_VER) < 1600 //VS2010
# ifndef __STDC_UTF_16__
# ifndef CHAR16_T
# if defined(_WIN32) & & defined(_MSC_VER)
# define CHAR16_T wchar_t
# else
# define CHAR16_T UINT16_T
# endif
typedef CHAR16_T char16_t;
# endif
#endif
#else
#include < yvals.h>
#endif//VS2010
> solution 2 (without follow-up test) : BBB>
Rename all char16_t in matrix.h
 
error 3:
LNK4199: /DELAYLOAD:vtkIO.dll ignored; no imports found from vtkIO.dll
cause:
DelayLoad (selected from the in-depth analysis DelayLoad “http://blog.csdn.net/panda1987/article/details/5936770).
As we know, there are two basic methods of DLL loading: implicit loading and explicit loading. Implicit loading is the method introduced in the previous article, where the input table of a PE loads the DLL into the memory space before entering the entry function. Explicit loading uses methods like LoadLibrary and GetProAddress to load the DLL into the process space when needed. Both of these methods are the ones we use most often. So what is delay load?
A DLL designated as Delay Load will not actually load the process space until it is needed, which means that the DLL will not be loaded if no function located in the DLL is called. The loading process is done by LoadLibrary and GetProcAddress, which is, of course, transparent to the programmer.
What are the benefits of this?There is no doubt that the program starts faster, because many DLLs may not be used at startup. Even some DLLs may not be used in the entire life cycle, so with Delay Load, the DLL does not need any memory.
> bbb>
Because for dynamic libraries, the load information is still recorded in the corresponding lib file, so in the properties of the project Linker->; Input-> Additional Depandencies may also have #pragma comment(lib, “vtkio. lib”) at the beginning of the Cpp. If the file is not found by the compile prompt, it is also required in the Linder->; General-> Add the location of the file in the Additional Library Directory.
If someone is the difference between the Lib and Dll unclear, see: http://www.cppblog.com/amazon/archive/2011/01/01/95318.html

Reproduced in: https://www.cnblogs.com/johnzjq/archive/2011/12/14/2287823.html

Through PID (process identification) to find the port (port) occupied applications, to solve the problem of port occupied

Step 1: Query the applied PID value occupying the port (Process Identification Process ID)

Enter the command in the DOS window: netstat -aon|findstr "port number "
to get the PID of the occupied port application, the port number is determined according to its own occupied port number

Step 2: Query the process for the specified PID value

In the DOS window, enter the command: tasklist|findstr "PID value "
to view the specified PID process. The PID value is obtained according to the port number occupied by itself

Step 3: End the process occupying the port

In the DOS window, enter the command: taskkill /T /F /PID PID value
to end the process command, the PID value should be changed to the PID value of the process you want to end

It is also possible to find the corresponding PID value of the process in the task manager manually right-click to end

Parsing the difference between “R” and “RB” patterns of text files (Python)

Difference between a text file in r and rb mode
what’s the Difference between r and rb in fopen
0. EOL (end-of-line)
The difference is mainly in the treatment of EOL. For different operating systems,
Unix: \nMac: \rWindows: \r\n
For the Python language, the query is performed using the following statement:

>> import os
>> os.linesep
'\r\n'

1. Different operating systems
For Windows systems, having b (rb, wb, r+b) means to open files in binary form. Python on Windows handles text files differently than binary files,
2. Python 2 vs Python 3
For Python 3 environments:
r : Python returns STR rb : binary mode, read() returns 0 bytes1

Mac & how to uninstall LANDesk

Mac & how to uninstall LANDesk

Mac – LANDesk – Uninstall LANDesk


https://community.ivanti.com/docs/DOC-22475
https://www.quora.com/How-do-you-remove-LANDESK-from-your-computer
https://community.ivanti.com/docs/DOC-2092

/Library/Application Support/LANDesk/bin/LDUserMenu.app/Contents/MacOS/LDUserMenu




https://blog.csdn.net/cangraoo/article/details/81254848
https://download.csdn.net/download/e345ug/10206162
solution


#!/bin/bash
#####################################################
# LANDesk Agent framework uninstaller
# Description: script to remove landesk agent
# components.
#
# Note: do not use 'rm -rf' on  directories.  Use the
# remove_landesk_dir or one of the other remove_dir
# functions.  They are safer and will protect you
# from making silly mistakes.
#####################################################
REMOVED=0
CLEAN=0
PKGUTIL=
SCRIPT=`/usr/bin/basename $0`
[ -x /usr/sbin/pkgutil ] && PKGUTIL=/usr/sbin/pkgutil

if [ `/usr/bin/id -u` -ne 0 ]; then
    echo "Uninstalling the LANDesk agent requires administrative priveleges."
    echo "Please enter your password to continue or press CTRL-C to cancel."
    sudo "$0" "$@"
    exit 0
fi


function show_help()
{
    echo "LANDesk agent uninstaller"
    echo "Usage: $SCRIPT [ -h | -c ]"
    echo "  options: "
    echo "     -h           Show this help message"
    echo "     -c           Force the uninstall and completely remove the install directories."
    echo "                  The default is to only remove empty directories."
    echo ""
}

function remove_flat_receipt( )
{
    RDIR=$1
    [ -z "$RDIR" ] && fatal "remove_flat_receipt(${RDIR}) must be passed a valid application name"
    # remove the receipt file
    if [ -d /Library/Receipts/$RDIR ]; then
        echo "removing receipt for: $RDIR "
        rm -rf /Library/Receipts/$RDIR
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove receipt: $RDIR. \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_database_receipt( )
{
    OBJ=$1
    [ -z "$OBJ" ] && fatal "remove_database_receipt(${OBJ}) must be passed a valid application name"
    if [ -n "$PKGUTIL" ]; then
        RES=`$PKGUTIL --pkgs | grep $OBJ`
        if [ -n "$RES" ]; then
            echo "Removing receipt database entry for: $OBJ "
            $PKGUTIL --forget $OBJ
        fi
    fi

}

function remove_framework_dir()
{
    FDIR=$1
    echo "Checking $FDIR"
    [ -z "$FDIR" ] && fatal "remove_framework_dir(${FDIR}) must be passed a valid directory"
    # remove the framework directory
    if [ -d /System/Library/Frameworks/${FDIR} ]; then
        echo "removing framework installation: $FDIR"
        rm -rf /System/Library/Frameworks/${FDIR}
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove framework: ${FDIR}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_LaunchDaemon()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_LaunchDaemon(${FNAME}) must be passed a valid file name"
    # remove the framework directory
    if [ -e /Library/LaunchDaemons/${FNAME} ]; then
        echo "removing LaunchDaemon: $FNAME"
        rm -f /Library/LaunchDaemons/${FNAME}
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi

}

function unload_LaunchAgent()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_LaunchAgent(${FNAME}) must be passed a valid file name"

    # unload launch agent
    if [ -f /Library/Application\ Support/LANDesk/bin/launchInContext.sh ]  && [ -e /Library/LaunchAgents/${FNAME} ]; then
        echo "unloading LaunchAgent: $FNAME"
        /Library/Application\ Support/LANDesk/bin/launchInContext.sh console /bin/launchctl unload -S Aqua /Library/LaunchAgents/${FNAME}
        [ "$?" != "0" ] && ( echo "ERROR: failed to unload file: ${FNAME}  \n\t$!"; exit 1 )
    fi
}

function remove_LaunchAgent()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_LaunchAgent(${FNAME}) must be passed a valid file name"
    # remove the framework directory
    if [ -e /Library/LaunchAgents/${FNAME} ]; then
        echo "removing LaunchAgent: $FNAME"
        rm -f /Library/LaunchAgents/${FNAME}
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi

}

function remove_startup()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_startup(${FDIR}) must be passed a valid file name"
    # remove the startup item
    if [ -d "/Library/StartupItems/${FNAME}" ]; then
        echo "removing launch daemon: $FDIR"
        rm -rf "/Library/StartupItems/${FNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi

}

function remove_Preferences()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_Preferences(${FNAME}) must be passed a valid file name"
    # remove the preferences file
    if [ -e "/Library/Preferences/${FNAME}" ]; then
        echo "removing Preference: ${FNAME}"
        defaults delete "/Library/Preferences/${FNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}


function remove_PreferencePane()
{
    FNAME="$@"
    [ -z "$FNAME" ] && fatal "remove_PreferencePane(${FNAME}) must be passed a valid dir name"
    # remove the preference pane directory
    if [ -d "/Library/PreferencePanes/${FNAME}.prefPane" ]; then
        echo "removing Preference: $FNAME"
        rm -rf "/Library/PreferencePanes/${FNAME}.prefPane"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_application_support_application()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_application_support_application(${FDIR}) must be passed a valid dir name"
    # remove the preference pane directory
    if [ -d "/Library/Application Support/${FNAME}" ]; then
        echo "removing Application Support directory: $FNAME"
        rm -rf "/Library/Application Support/${FNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_landesk_dir()
{
    DNAME=$1
    [ -z "$DNAME" ] && fatal "remove_landesk_dir(${DNAME}) must be passed a valid dir name"
    # remove the landesk directory named:
    if [ -d "/usr/local/LANDesk/${DNAME}" ]; then
        echo "removing LANDesk directory: $DNAME"
        rm -rf "/usr/local/LANDesk/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
    if [ -d "/usr/LANDesk/${DNAME}" ]; then
        echo "removing LANDesk directory: $DNAME"
        rm -rf "/usr/LANDesk/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
    if [ -d "/opt/landesk/${DNAME}" ]; then
        echo "removing LANDesk directory: $DNAME"
        rm -rf "/opt/landesk/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_landesk_files()
{
    for DNAME in "$@"; do
        [ -z "$DNAME" ] && fatal "remove_landesk_file(${DNAME}) must be passed a valid filek name"
        # remove the landesk directory named:
        if [ -f "/usr/local/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk file: $DNAME"
            rm -f "/usr/local/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -f "/usr/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk file: $DNAME"
            rm -f "/usr/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -f "/opt/landesk/${DNAME}" ]; then
            echo "removing LANDesk file: $DNAME"
            rm -f "/opt/landesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
    done
}

function remove_landesk_links()
{
    for DNAME in "$@"; do
        [ -z "$DNAME" ] && fatal "remove_landesk_link(${DNAME}) must be passed a valid symlink name"
        # remove the landesk directory named:
        if [ -h "/usr/local/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk link: $DNAME"
            rm -f "/usr/local/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove link: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -h "/usr/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk link: $DNAME"
            rm -f "/usr/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove link: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -h "/opt/landesk/${DNAME}" ]; then
            echo "removing LANDesk link: $DNAME"
            rm -f "/opt/landesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove link: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
    done
}


function remove_sharedtech()
{
    remove_Preferences com.landesk.cba8.plist
    remove_Preferences com.landesk.msgsys.plist
    remove_Preferences com.landesk.broker.plist

    if [ -e /Library/StartupItems/cba8/cba8 ]; then
        /Library/StartupItems/cba8/cba8 stop
    fi
    remove_startup cba8

    remove_LaunchDaemon com.landesk.pds.plist
    remove_LaunchDaemon com.landesk.pds1.plist
    remove_LaunchDaemon com.landesk.pds2.plist
    remove_LaunchDaemon com.landesk.msgsys.plist
    remove_LaunchDaemon com.landesk.cba8.plist
    remove_LaunchDaemon com.landesk.broker.plist
    remove_LaunchDaemon com.landesk.rotatelog.plist
    remove_LaunchDaemon com.landesk.reboot.plist
    remove_LaunchDaemon com.landesk.vulscan.plist
    remove_LaunchDaemon com.landesk.dispatch.plist
    remove_LaunchDaemon com.landesk.ldlaunch_daemon.plist
    remove_LaunchDaemon com.landesk.scheduler.plist
    remove_LaunchDaemon com.landesk.ldwatch.plist
    remove_LaunchAgent com.landesk.ldusermenu.plist
    remove_LaunchAgent com.landesk.hideScreen.plist
    remove_LaunchAgent com.landesk.ldswprogress.plist
    remove_LaunchAgent com.landesk.remotelaunch.plist
    remove_LaunchAgent com.landesk.dispatch.pl.plist
    remove_LaunchAgent com.landesk.dispatch.ui.plist
    remove_LaunchAgent com.landesk.dispatch.sui.plist
    remove_LaunchAgent com.landesk.ldlaunch_daemon.plist
    remove_LaunchAgent com.landesk.ldNotificationMonitor.plist
    remove_LaunchAgent com.landesk.logged_in.plist
    remove_LaunchAgent com.landesk.logged_out.plist
    remove_LaunchAgent com.landesk.ldwatch.plist
    remove_LaunchAgent com.landesk.ldNotificationMonitor.plist
    remove_LaunchAgent com.landesk.lockscreen.plist

    echo "removing SharedTech: "

    remove_landesk_files  common/{addhandler,makekey,sha1tool,shutdownhandler.sh}
    remove_landesk_files  common/{reboothandler.sh,cba8_uninstall.sh,alert}
    remove_landesk_files  common/{resetguard,cba,proxyhost,ldpgp}
    remove_landesk_files  common/{alertrender,postbsa,ldnacgi,httpclient,ldpds1}
    remove_landesk_files  common/{brokerconfig,pds2_uninstall.sh,pds2d,pds2dis,poweroff.exe,uniqueid}
    remove_landesk_files  common/cbaroot/certs/064eb6a5.0
    remove_landesk_files  common/cbaroot/allowed/{cba8.crt,logodk.gif,hdr_lsdk.gif,ldping,index.tmpl}
    remove_landesk_files  common/cbaroot/services/{filexfer,exec}
    remove_landesk_files  common/cbaroot/alert/alert.xml
    remove_landesk_files  common/stop.time
    remove_landesk_files  common/start.time
    remove_landesk_links /bin/{addhandler,alert,cba,alertrender,makekey,httpclient,ldpgp,ldping,proxyhost}
    remove_landesk_links /bin/{resetguard,sha1tool,shutdownhandler.sh,reboothandler.sh,postbsa,ldnacgi,httpclient}


    cd /opt/landesk/
    STRING_FILES=`ls common/*strings.xml`
    for FILENAME in $STRING_FILES; do
        remove_landesk_files  ${FILENAME}
    done


    #rm -f /opt/landesk/bin/{addhandler,makekey,sha1tool,shutdownhandler.sh,reboothandler.sh,cba8_uninstall.sh}
    #rm -f /opt/landesk/bin/{aler,resetguard,cba,proxyhost,ldpgp,alertrender,postbsa,ldnacgi,httpclient}
    #rm -f /opt/landesk/etc/cbaroot/certs/064eb6a5.0
    #rm -f /opt/landesk/etc/cbaroot/allowed/{cba8.crt,logodk.gif,hdr_lsdk.gif,ldping,index.tmpl}
    #rm -f /opt/landesk/etc/cbaroot/services/{filexfer,exec}
    #rm -f /opt/landesk/etc/cbaroot/alert/alert.xml
    #rm -f /opt/landesk/bin/{addhandler,alert,cba,alertrender,makekey,httpclient,ldpgp,ldping,proxyhost}
    #rm -f /opt/landesk/bin/{resetguard,sha1tool,shutdownhandler.sh,reboothandler.sh,postbsa,ldnacgi,httpclient}
    [ -e /etc/pam.d/cba8 ] && rm -f /etc/pam.d/cba8
    [ -e /etc/xinetd.d/cba8 ] && rm -f /etc/xinetd.d/cba8

    remove_landesk_dir common/cbaroot
    remove_landesk_dir Resources
    remove_landesk_dir common

    /usr/bin/killall -HUP xinetd
}

function remove_crontab()
{
    # remove the crontab
    local crontabTag="# ldms"                                   # used to determine if the crontab file has already setup
    local installed=`sudo crontab -l -u root | grep -c '# ldms'`
    if [ $installed -gt 0 ]; then
        sudo crontab -l | sed '/ldms/d' | sudo crontab -
    fi
}

function remove_firewall()
{
    # remove the port exceptions we put in the firewall at installation
    if [ -e "/Library/Preferences/com.apple.sharing.firewall.plist" ]; then
        local saveDir=`pwd`
        cd /Library/Application\ Support/LANDesk/bin/
        echo `pwd`
        echo "Removing LANDesk Remote Control port exceptions"
        sudo ./ldxmlutil -d -f /Library/Preferences/com.apple.sharing.firewall.plist -k "/firewall/LANDesk Remote Control"
        echo "Removing LANDesk Trageted Multicast port exceptions"
        sudo ./ldxmlutil -d -f /Library/Preferences/com.apple.sharing.firewall.plist -k "/firewall/LANDesk Targeted Multicast"
        echo "Removing LANDesk CBA8 port exceptions"
        sudo ./ldxmlutil -d -f /Library/Preferences/com.apple.sharing.firewall.plist -k "/firewall/LANDesk CBA8"
        cd $saveDir
        echo `pwd`
    fi
    if [ -e "/System/Library/PrivateFrameworks/NetworkConfig.framework/Versions/Current/Resources/firewalltool" ]; then
        sudo /System/Library/PrivateFrameworks/NetworkConfig.framework/Versions/Current/Resources/firewalltool
    else
        echo "Warning the firewall must be restarted"
    fi
}

function remove_framework()
{
    # remove agent framework
    echo "Removing agent framework"
    remove_flat_receipt "LANDeskAgentFramework.pkg"
    remove_database_receipt "LANDeskAgent.framework"
    remove_framework_dir "LANDeskAgent.framework"
}

function remove_pkg_receipts()
{
    remove_flat_receipt "ldslm.pkg"
    remove_flat_receipt "agentconfig.pkg"
    remove_flat_receipt "brokerconfig.pkg"
    remove_flat_receipt "vulscan.pkg"
    remove_flat_receipt "swd.pkg"
    remove_flat_receipt "stuffitutility9.pkg"
    remove_flat_receipt "stuffitutility10.pkg"
    remove_flat_receipt "sharedtech.pkg"
    remove_flat_receipt "remotecontrol.pkg"
    remove_flat_receipt "ldusermenu.pkg"

    remove_database_receipt "com.landesk.agent.sharedtech"
    remove_database_receipt "com.landesk.stuffitutility9"
    remove_database_receipt "com.landesk.stuffitutility10"
    remove_database_receipt "com.landesk.agent.configui"
    remove_database_receipt "com.landesk.agent.ldslm"
    remove_database_receipt "com.landesk.agent.remotecontrol"
    remove_database_receipt "com.landesk.agent.swd"
    remove_database_receipt "com.landesk.agent.vulscan"
    remove_database_receipt "com.landesk.agent.brokerconfig"
    remove_database_receipt "com.landesk.agent.ldusermenu"

}

function remove_config_app()
{
    DNAME=$1
    [ -z "$DNAME" ] && fatal "remove_config_apps(${DNAME}) must be passed a valid dir name"
    # remove the landesk directory named:
    if [ -d "/Applications/Utilities/${DNAME}" ]; then
        echo "removing LANDesk application: $DNAME"
        rm -rf "/Applications/Utilities/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_Fuze()
{
    DNAME=$1
    [ -z "$DNAME" ] && fatal "remove_config_apps(${DNAME}) must be passed a valid dir name"
    # remove the landesk directory named:
    if [ -d "/Applications/${DNAME}" ]; then
        echo "removing LANDESK: $DNAME"
        rm -rf "/Applications/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}


function remove_baseagent()
{
    #remove baseagent
    remove_flat_receipt "baseagent.pkg"
    remove_database_receipt "baseagent"

    remove_landesk_files common/{sendstatus,alertsync,ldcron,lddaemon,ldwatch,ldiscan,ldxmlutil}
    remove_landesk_files common/{ldpds1,brokerconfig,pds2_uninstall.sh,pds2d,pds2dis,poweroff.exe,uniqueid}

    remove_landesk_links bin/{sendstatus,alertsync,ldcron,lddaemon,ldwatch,ldiscan,ldxmlutil}

    remove_LaunchDaemon com.landesk.ldwatch.plist
    remove_Preferences com.landesk.ldms.plist
    # remove preference panes
    remove_PreferencePane "LANDesk Agent"
    remove_PreferencePane "LANDesk Client"
    remove_startup LANDesk
    remove_application_support_application LANDesk

    remove_config_app "LANDesk Agent.app"

    remove_landesk_dir data common
}

function remove_gateway()
{
    remove_config_app "LANDesk Management Gateway.app"
}

function remove_tmc()
{
    remove_LaunchDaemon com.landesk.ldtmc.plist
}

function remove_swd()
{
    remove_LaunchDaemon com.landesk.remote.plist
    remove_landesk_links common/{ldgidget,ldkahuna,sdclient}
}

function remove_rc()
{
    echo "removing rc files"

}

function remove_ldav()
{
# only remove if we installed application
# check /Library/LaunchDaemons/com.landesk.ldav.plist for Disabled
# this will only be set to false if Kaspersky was installed by ldinstallav

    output=""

    if [ -e /Library/LaunchDaemons/com.landesk.ldav.plist ]; then
        output=`/usr/libexec/PlistBuddy -c "print Disabled" /Library/LaunchDaemons/com.landesk.ldav.plist`
        if [ "$?" -eq "0" ] && [ "$output" == "false" ]; then
            echo "detected /Library/LaunchDaemons/com.landesk.ldav.com:Disabled  = ${output}"
            echo "Uninstall Kaspersky AV"
            if [ -e '/Library/Application Support/LANDesk/bin/ldinstallav' ]; then
                /Library/Application\ Support/LANDesk/bin/ldinstallav /uninstall
            fi
            if [ -e '/Library/Application Support/Kaspersky Lab' ]; then
                rm -rf '/Library/Application Support/Kaspersky Lab'
            fi
        fi
    fi

    remove_LaunchDaemon com.landesk.ldav.plist
    remove_LaunchAgent com.landesk.ldav.agent.plist
}

function cleanup_directories()
{
    echo "Attempting to remove directory structure..."
    ECNT=0

    if [ -d "/usr/local/LANDesk" ]; then
        if [ $CLEAN -ne 0 ]; then
            rm -rf "/usr/local/LANDesk"
            return;
        fi
        if [ -d "/usr/local/LANDesk/common" ]; then
            rmdir "/usr/local/LANDesk/common"
            [ $?-eq 0 ] && ((ECNT++))
        fi
        if [ -d "/usr/local/LANDesk/bin" ]; then
            rmdir "/usr/local/LANDesk/bin"
            [ $?-eq 0 ] && ((ECNT++))
        fi

        if [ $ECNT -eq 0 ]; then
            rmdir "/usr/local/LANDesk";
        fi
    fi
    if [ -d "/usr/LANDesk" ]; then
        if [ $CLEAN -ne 0 ]; then
            rm -rf "/usr/LANDesk"
            return;
        fi
        if [ -d "/usr/LANDesk/common" ]; then
            rmdir "/usr/LANDesk/common"
            [ $?-eq 0 ] && ((ECNT++))
        fi
        if [ -d "/usr/LANDesk/bin" ]; then
            rmdir "/usr/LANDesk/bin"
            [ $?-eq 0 ] && ((ECNT++))
        fi

        if [ $ECNT -eq 0 ]; then
            rmdir "/usr/LANDesk";
        fi
    fi
    if [ -d "/opt/landesk" ]; then
        if [ $CLEAN -ne 0 ]; then
            rm -rf "/opt/landesk"
            return;
        fi
        if [ -d "/opt/landesk/common" ]; then
            rmdir "/usr/local/LANDesk/common"
            [ $?-eq 0 ] && ((ECNT++))
        fi
        if [ -d "/opt/landesk/bin" ]; then
            rmdir "/usr/local/LANDesk/bin"
            [ $?-eq 0 ] && ((ECNT++))
        fi

        if [ $ECNT -eq 0 ]; then
            rmdir "/opt/landesk";
        fi
    fi
    [ -e /tmp/postinstaller ] && rm -f /tmp/postinstaller
    [ -e /tmp/LDMSClient.mpkg.zip ] && rm -f /tmp/LDMSClient.mkpg.zip
    [ -e /tmp/LDMSClient.mpkg ] && rm -f /tmp/LDMSClient.mkpg
}

function killAllProcs(  )
{
    sudo /usr/bin/killall $1
    /bin/ps ax | /usr/bin/grep $1 | grep -v grep | /usr/bin/awk '{print $1}' | /usr/bin/xargs sudo kill -9
}

function stop_processes()
{
    # stop our processes

    if [ -e "/Library/LaunchDaemons" ]; then
        [ -f /bin/launchctl ] && /bin/launchctl unload /Library/LaunchDaemons/com.landesk.*
        [ -f /bin/launchctl ] && /bin/launchctl unload /Library/LaunchAgents/com.landesk.*
        killAllProcs "ldslm"
        killAllProcs "ldtmc"
        killAllProcs "ldcron"
        killAllProcs "lddaemon"
        killAllProcs "LDUserMenu"
        killAllProcs "ldremotelaunch"
        killAllProcs "ldNotificationMonitor"
        killAllProcs "LANDesk Agent"
        killAllProcs "ldav"
    else
        killAllProcs "ldwatch"
        killAllProcs "ldcba"
        killAllProcs "ldslm"
        killAllProcs "ldremote"
        killAllProcs "ldtmc"
        killAllProcs "ldcron"
        killAllProcs "lddaemon"
    fi
}

function remove_crashlogs()
{
    # remove user crash logs
    local loglist="ldcba ldremote ldscan ldwatch ldorwell ldobserve ldremotemenu"

    for app in $loglist
    do
        if [ -e "~/Library/Logs/CrashReporter/$app.crash.log" ]; then
            echo " removing user $app.crash.log"
            sudo rm "~/Library/Logs/CrashReporter/$app.crash.log"
            ((REMOVED++))
        fi

        if [ -e "/Library/Logs/CrashReporter/$app.crash.log" ]; then
            echo " removing system $app.crash.log"
            sudo rm "/Library/Logs/CrashReporter/$app.crash.log"
            ((REMOVED++))
        fi
    done
}

function remove_pidfiles()
{
    if [ -e "/var/run/landesk" ]; then
        echo " removing pid files"
        sudo rm -r "/var/run/landesk"
        ((REMOVED++))
    fi
}

function remove_xinetd_files
{
    # remove Xinet files
    local doomedFiles="LANDeskCBA ldpds1 ldpds2 cba8 pds2"
    for target in $doomedFiles; do

        if [ -e "/etc/xinetd.d/$target" ]; then
            echo " removing $target xinet files"
            sudo rm "/etc/xinetd.d/$target"
            ((REMOVED++))
        fi
    done
}

function remove_netinfo_entries()
{
    # get our system version
    local sysVersion=$(uname -r)
    local sysMajorVersion=${sysVersion%%.*}
    local tempMinorVersion=${sysVersion#*.}
    local sysMinorVersion=${tempMinorVersion%%.*}

    if [ $sysMajorVersion -lt 8 ] ; then
        echo "Uninstaller: Uninstalling Jaguar and Panther items"
        sudo nicl . -delete /services/pds
        sudo nicl . -delete /services/pds1
        sudo nicl . -delete /services/pds2
        sudo nicl . -delete /services/cba8
        sudo nicl . -delete /services/msgsys
    else
        echo "Uninstaller: Uninstalling Tiger or later items"
        sudo dscl . -delete /services/pds
        sudo dscl . -delete /services/pds1
        sudo dscl . -delete /services/pds2
        sudo dscl . -delete /services/cba8
        sudo dscl . -delete /services/msgsys
    fi
}

function remove_service_entries()
{
    echo " removing services entries"
    sudo cp -f /etc/services /etc/services.bak
    sudo /bin/sh -c 'sed -e /cba8/d -e /pds/d -e /pds1/d -e /pds2/d -e /msgsys/d /etc/services.bak > /etc/services'
    sudo rm /etc/services.bak
}

function remove_inet_entries()
{
    echo " removing inet entries"
    sudo cp -f /etc/inetd.conf /etc/inetd.conf.bak
    sudo /bin/sh -c 'sed -e /cba8/d -e /pds/d -e /pds1/d -e /pds2/d -e /msgsys/d /etc/inetd.conf.bak > /etc/inetd.conf'
    sudo rm /etc/inetd.conf.bak
}

function update_xinetd()
{
    if [ -e "/var/run/xinetd.pid" ]; then
        echo " hupping xinetd"
        sudo /usr/bin/killall -HUP xinetd
        sudo /bin/sleep 5
    fi
    if [ ! -e "/var/run/xinetd.pid" ]; then
        # If not Xinet, restart it. (The HUP might kill it if there are no services.)
        echo " restarting xinetd"
        sudo xinetd -pidfile /var/run/xinetd.pid
    fi
}

### main ###

for arg in "$@"; do
    case "$arg" in
        -c)
            CLEAN=1
            ;;
        -h)
            show_help
            exit 1
            ;;
    esac
done

#uninstall ldav to ensure Kaspersky gets uninstalled and agents unloaded properly
remove_ldav

#unload launch agents to ensure are stopped in the proper context
unload_LaunchAgent com.landesk.remotelaunch.plist
unload_LaunchAgent com.landesk.usermenu.plist
unload_LaunchAgent com.landesk.ldNotificationMonitor.plist
unload_LaunchAgent com.landesk.ldusermenu.plist
unload_LaunchAgent com.landesk.dispatch.ui.plist
unload_LaunchAgent com.landesk.dispatch.sui.plist
unload_LaunchAgent com.landesk.ldlaunch_daemon.plist
unload_LaunchAgent com.landesk.ldwatch.plist
unload_LaunchAgent com.landesk.lockscreen.plist
unload_LaunchAgent com.landesk.ldlogged_in.plist
unload_LaunchAgent com.landesk.ldlogged_out.plist
unload_LaunchAgent com.landesk.usermenu.plist

stop_processes

remove_crontab

remove_firewall

remove_tmc

remove_rc

remove_swd

remove_baseagent

remove_framework

remove_gateway

remove_sharedtech

remove_pkg_receipts

remove_crontab

remove_firewall

cleanup_directories

remove_crashlogs

remove_pidfiles

remove_xinetd_files

remove_netinfo_entries

remove_service_entries

remove_inet_entries

remove_Fuze "LANDESK Fuse.app"

remove_Fuze "BridgeIT.app"

update_xinetd

defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL

echo "Cleanup complete: $REMOVED elements were removed."


# vim:ts=4:sw=4

Reproduced in: https://www.cnblogs.com/xgqfrms/p/10216954.html

Windows Update Error: 80244019

Recently, It was found that Windows Update (hereinafter referred to as WU) always prompts 80244019 error when checking for updates (as shown in the figure below). Notice the prompt “Managed by your system Administrator” at the bottom of the window. It is preliminarily estimated that WU could not connect to Microsoft Update due to the group policy deployed by domain control on all computers.

Check Online for Updates from Microsoft Update link. This should be another way to deal with the failure of connecting to Microsoft updates. WU started searching for updates after clicking on the link.

But doing so each time is cumbersome, as the domain controller must have modified some location in the registry when deploying the group policy to make it unusable for WU. So finding them and fixing them should solve the problem. Look around in the Policy and find something WindowsUpdate.
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
1. Click WindowsUpdate, and if domaincontrol has deployed WSUS, its Settings will be shown here: WUServer, WUStatusServer, both of which say WSUS server address in the domain, without saying delete (first backup is best, don’t be too bold…) .

2. Let’s take a look at what’s in the AU below WindowsUpdate, which also holds parameters for group policy Settings. Especially UseWUServer, which is supposed to tell WU where to find Windows updates, just set its Data to “0”.

Reboot to see what happens. WU is back to his old self:


3. In fact, compared with a non-domain computer, if the group policy has not been modified, there is no WindowsUpdate directory in the registry, that is to say, it is ok to delete all [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows \WindowsUpdate]. The fact proves that there is no problem with all deletion. Attach a Reg for deletion.