I don’t really have a good impression on Oracle product, though it is truth that their product perform well, they are just less user orientated.
So this time, I am having trouble with updating Java Runtime Environment, or JRE in short. It has been a long problem. I got several desktops in my company which require JRE for their work. But after a month or two, the users will complaint to me that they cannot use their application and show me a screenshot which is actually a pop up saying JRE is out of date.
Oracle never provided an automatic update mechanism for JRE, and because the user doesn’t have administrator right, they can’t perform their installation on their on. At the end of the day, I have to update the JRE on their desktop, one by one.
So finally today I am looking for solution to the problem, and found this, a batch script to update the Java. I tried, and found a few bugs and issues. So I decided to fork it and create my own one, which is the birth of my own Auto-Java-Updater.
You may visit the project page here or download the script at the project release page here.
Anyway, my day has gone to make this script, and hopefully saving me the trouble onward until JRE 8 is obsoleted.
I used to use telnet for testing if the firewall working properly in the office. Telnet is good for simple test, but when comes to testing a large number of destination IP and ports it will be very time consuming. After searching on the Internet I found Netcat, a tool for testing connection. It is build-in in most Linux OS but not on Windows. So I found Ncat here as part of the Nmap for Windows by nmap.org, but too bad that it won’t execute on some Windows as it requires Microsoft Visual C++ Redistributable Package installed.
A Ncat portable is an alternative, but the website only provided a beta version of Ncat 5.59BETA1, and require you to compile your own if you would like a newer version.
They did provide a documentation on how to compile Ncat with static linking library, but if you follow the steps you will encounter a few problems which you have to troubleshoot yourselves.
So here is my steps on compiling Ncat portable after I had gone through all the trouble.If you are someone who can edit the documentation on secwiki.org, please do that for me as I don’t want to get an extra account for just editing the document :)
If you want to avoid the trouble to compile, you can download the Ncat which I compiled here, however use it at your own risk as I might have inject some malware inside :)
Building Ncat Portable for Windows
The following steps has been tested using the following environment:
Microsoft Visual Studio 2010 Version SP1 (10.0.40219.1 SP1Rel)
First, follow all steps on the original documentation at https://secwiki.org/w/Nmap/Ncat_Portable till you copied the resulted static libs and include files from “C:\OpenSSL” to the “mswin32\OpenSSL” directory in the Nmap source tree in step 5. Below is a screenshot of the original documentation in case it is edited at the time you read this article.
Assuming that everything went fine till now, you’re about 7 steps away from building Ncat portable.
Open Nmap solution in Visual Studio from mswin32\nmap.sln and switch the build configuration to “Ncat Static” like so:
Right click on Solution “nmap” in the Solution Explorer sidebar and choose “Configuration Manager“.
Switch the active solution configuration to “Ncat Static“. Check the “Build” check box for project “liblua“. Make sure that the nsock, nbase and ncat projects have switched to the “Static” configuration also. Then close the “Configuration Manager”.
Right click on the ncat project and select “Set as StartUp Project“.
Right click on the “nsock” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “C/C++” > “General“, in “Additional Include Directories“, add path “..\mswin32\OpenSSL\include“
Right click on the “ncat” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “C/C++” > “General“, in “Additional Include Directories“, add path “..\mswin32\OpenSSL\include” and “..\liblua“
Right click on the “ncat” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “Linker” > “General“, in “Additional Library Directories“, add path “..\mswin32\OpenSSL\lib“
Expand the “ncat” project, double click the file “ncat_ssl.c” and comment out the line “#include <openssl/applink.c>“
Right click on the “liblua” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “C/C++” > “Code Generation“, set “Runtime Library” to “Multi-threaded DLL (/MD)“
Right click on the “ncat” project in Visual Studio and click “Build“. Alternatively you can press the F7 key to start building.
Sometimes ago I needed to change NTP setting on a Windows Server which is running active directory (AD) service. Not sure why the usual way to set the NTP on Windows 7 or non-AD servers via GUI is not an option. It simply doesn’t have a GUI for you! Anyway after some Google here is the command I used. Assume the NTP server is 192.168.0.150.
Then force resync from the NTP source so that the source can be displayed correctly in the next command.
Finally double check if the NTP source is configured correctly
w32tm /query /source
The 0x9 flag is important as I can’t make it work without that. I still not sure what the flag does but according to the article Windows Time Service Tools and Settings this mark the server as Always time server and Automatic reliable time server.
I helped a few small company in administrating their PC. To prevent the user from installing software and to prevent from infection of computer virus, I have set their accounts to limited account.
However some legacy software installed on the protected area of the drive (EG. C:\legacy_program) and require write access might have problem for these limited account to run the program.
A quick search I did on the Internet found this article which mentioned the workaround to this, is to use access control list (ACL). To do this, you can use the GUI to configure or by the following command:
cacls "C:\legacy_program" /e /t /p users:c
If this still doesn’t help, it could be the case that the legacy program is trying to write to registry as well. You will need to locate the registry and configure the necessary permission.
Sometimes you download a file from Internet and it become a file ended with dot character which cannot be opened, renamed and deleted. I found this article on the Internet with the solution. To be able to handle this, you have to use the special path format in the command prompt.
So for example, you want to delete the file, the command you will use is: