Skip to content

Instantly share code, notes, and snippets.

@hkneptune
hkneptune / useful-tools-utilities.md
Created December 10, 2019 01:13
Useful Tools / Utilities

Useful Tools / Utilities

  • PU: Free for personal use
  • CU: Free for commercial use
  • OS: Open source

File Attributes

Attribute Changer - PU CU - A powerful Windows Explorer add-on, available at your fingertips whenever you right-click on files, folders and even drives in Windows Explorer.

@hkneptune
hkneptune / eclipse-java-code-formatter-profile.xml
Last active November 17, 2020 07:01
Java Code Formatter Profile for Eclipse
<?xml version="1.0" encoding="UTF-8"?>
<profiles version="20">
<profile kind="CodeFormatterProfile" name="Simple Java Code Style" version="20">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert" />
@hkneptune
hkneptune / oracle-db-19c-centos-8-in-virtualbox.md
Last active April 24, 2025 11:14
Install Oracle Database 19c on CentOS 8 in VirtualBox

Install Oracle Database 19c on CentOS 8 in VirtualBox

** Please use the root user to edit the files and execute the commands unless further notice. **

Prerequisite

  1. Install the latest VirtualBox Platform Package and the VirtualBox Extension Pack (Oracle_VM_VirtualBox_Extension_Pack-VERSION.vbox-extpack).
  2. Download the latest VirtualBox Guest Additions (VBoxGuestAdditions_VERSION.iso).
  3. Download the latest CentOS Stream 8.
  4. Create a new virtual machine and install the CentOS to the virtual machine. During the CentOS installation, select Workstation as Base Environment, select Container Management, Development Tools and Graphical Administration Tools as Additional software for Selected Environment. Use http://mirror.centos.org/centos/8/BaseOS/x86_64/os/ as the installation source.
@hkneptune
hkneptune / mysql-8-centos-8-in-virtualbox.md
Last active November 9, 2023 04:01
Install MySQL 8 on CentOS 8 in VirtualBox

Install MySQL 8 on CentOS 8 in VirtualBox

** Please use the root user to edit the files and execute the commands unless further notice. **

Prerequisite

  1. Install the latest VirtualBox Platform Package and the VirtualBox Extension Pack (Oracle_VM_VirtualBox_Extension_Pack-VERSION.vbox-extpack).
  2. Download the latest VirtualBox Guest Additions (VBoxGuestAdditions_VERSION.iso).
  3. Download the latest CentOS Linux release 8.
  4. Create a new virtual machine and install the CentOS to the virtual machine. During the CentOS installation, select Workstation as Base Environment, select Container Management, Development Tools and Graphical Administration Tools as Additional software for Selected Environment. Use http://mirror.centos.org/centos/8/BaseOS/x86_64/os/ as the installation source.
@hkneptune
hkneptune / maven-resources-plugin.xml
Created May 21, 2020 02:49
Copy External Libraries to War Package
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
@hkneptune
hkneptune / Normalize.java
Last active January 31, 2022 20:21
The utility class to solve the Path Manipulation issue found by the Fortify Static Code Analyzer.
/**
* Path Manipulation (Input Validation and Representation, Data Flow)
*
* **Abstract:**
*
* Attackers are able to control the file system path argument, which allows them to access or
* modify otherwise protected files.
*
* **Explanation:**
*
@hkneptune
hkneptune / jquery-script.js
Created September 29, 2020 10:00
jQuery - Open All URLs In New Tab
jQuery(document).on('click', 'body a', function(e){
e.preventDefault();
var url = jQuery(this).attr('href');
window.open(url, '_blank');
});
/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var $jscomp = $jscomp || {};
$jscomp.scope = {};
$jscomp.arrayIteratorImpl = function(array) {
var index = 0;
return function() {
@hkneptune
hkneptune / Discuz4.0.0Crack.md
Created January 1, 2022 05:49
Discuz 4.0.0 (20051001) Crack

Discuz! 4.0.0 (20051001) Crack

  1. Replace the include/validate.class.php file
  2. Create a discuz_license.php file in the root directory
@hkneptune
hkneptune / centos8.md
Created February 17, 2022 02:00
Upgrade CentOS Linux 8 to CentOS Stream 8

Fix the AppStream Issue

[root@centos8 ~]# yum update
CentOS-8 - AppStream 71 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

As CentOS Linux 8 had reached the End Of Life (EOL) on December 31st, 2021. It means that CentOS 8 will no longer receive development resources from the official CentOS project. To keep your CentOS updated, you may update the mirrors or upgrade to CentOS Stream.