Wednesday, November 30, 2022

Windows: Force WiFi to work only on 5GHz


1. From Control Panel, open Device Manager as Administrator;

2. Expand Network Adapters;

3. Double click on the WiFi device you want to change;

4. Click on the Advanced tab;

5. Select 802.11a/b/g Wireless Mode. Change its value to: 5GHz 802.11a

6. Select 802.11n/ac/ax Wireless Mode. Change its value to: 802.11ac

7. Click OK to save the settings.

The selected 2 modes work only on 5GHz. Select other modes to allow it work on 2.4GHz again.


Monday, October 10, 2022

Windows VirtualBox VM Downloads


Windows (with IE8/9/10/11/Edge) Virtual Machine Download URLs:

Official: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

GitHub: https://github.com/magnetikonline/linux-microsoft-ie-virtual-machines 

Archive.org: https://archive.org/details/ie11.win81.virtualbox


For Speaker and Microphone:
VirtualBox Settings:
Audio
Enable Audio
Host Audio Driver: Pulse Audio
Audio Controller: Intel HD Audio

---

For WebCam (Linux Host):
Add your user to the vboxusers group:
$ sudo usermod -a -G vboxusers $(whoami)

Logout from your desktop and login again. If you open a terminal you can check that the group appears at the end of your group list:
$ groups

VirtualBox Settings:
USB
Enable USB Controller
Add the WebCam (by the 2nd button)



Note: Default username: IEUser; password: Passw0rd! .


Saturday, October 8, 2022

Google Chrome for Ubuntu/Debian Linux


Repository Manifest: http://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages

Packages is a text file, which contains: SHA256, SHA1, MD5 checksums

Download link: https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Sunday, October 2, 2022

Use curl to send 2 HTTP requests in one connection


$ curl -X POST http://myserver/myapp -d 'data-1' --next http://myserver/myapp -d 'data-2'

Friday, July 8, 2022

Java: no such provider: BC


Problem:

java.security.NoSuchProviderException: no such provider: BC


Solution:

1. Download Bouncy Castle JAR, e.g.: bcprov-jdk15on-157.jar

2. In the code, add:

  if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null)
  {
    Security.addProvider(new BouncyCastleProvider());
  }


Thursday, July 7, 2022

Linux: build OpenSSL 32bit on a 64bit box


$ setarch i386 ./config -m32 --prefix=... --openssldir=...


Wednesday, July 6, 2022

Tomcat: 403 access denied on manager


Problem:

403 Access Denied on Tomcat manager page: http://localhost/manager/html

 

Solution:

1. Go to /path/to/tomcat/webapp/manager/META-INF

2. Edit file context.xml, and remove/comment-out the following lines:

  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
        allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />

3. Save context.xml

4. Restart Tomcat.

Tuesday, July 5, 2022

Linux: run valgrind on Apache httpd


Source code must be compiled with option -g

Command:

$ valgrind --leak-check=full --tool=memcheck --error-limit=no --log-file=val.log /usr/bin/httpd -f /etc/httpd.conf -DFOREGROUND


Monday, July 4, 2022

Bash: shell script to obtain the cipher list of a server


#!/bin/bash
 
SERVER=$1
 
if [[ "$SERVER" == "" ]]; then
  echo "Usage: $0 hostname:port"
  exit
fi
 
DELAY=2
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
 
for cipher in ${ciphers[@]}
do
  echo -n Testing $cipher ...
  result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
 
  if [[ "$result" =~ "Session-ID:" ]]; then
    echo "YES"
  else
    if [[ "$result" =~ ":error:" ]]; then
      error=$(echo -n $result | cut -d':' -f6)
      echo "NO \($error\)"
    elif [[ "$result" =~ "errno=104" ]]; then
      echo "NO \(Connection reset by peer\)"
    else
      echo "Unknown response"
    fi
  fi
 
  sleep $DELAY
done
 

Sunday, July 3, 2022

Windows: Change SSL Cipher Suite


1. Right click on the Windows icon and select "Search".

2. Input "gpedit.msc". Right click on the gpedit.msc icon and select "Run as administrator".

3. The "Local Group Policy Editor" is loaded.

3.1. On its left panel, expand "Computer Configuration / Administrative Templates / Network", and then select "SSL Configuration Settings".

3.2. On the right panel, double click on "SSL Cipher Suite Order" to open "SSL Cipher Suite Order" dialogue.

3.3. At the top left side of the dialogue, select "Enabled" radio box.

3.4. At the lower left side of the dialogue, in the "Options" box, change the value of "SSL Cipher Suites".

3.5. Click the OK button to save the changes.

4. Restart the computer.


 
Get This <