Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex (Huy Tran) htr3n

View GitHub Profile
@htr3n
htr3n / wildfly-install.sh
Created Apr 19, 2021 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
View wildfly-install.sh
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
@htr3n
htr3n / UuidUtil.java
Created Apr 19, 2021
Helper class to work with Java UUID
View UuidUtil.java
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.UUID;
/**
* This class provides helper methods to work with UUID, for instance, converting UUID into 16-byte
* array for database column BINARY(16) and vice versa.
*/
public final class UuidUtil
{
@htr3n
htr3n / termite-install.sh
Created Aug 19, 2019
Debian/Ubuntu-specific termite installation script
View termite-install.sh
#!/usr/bin/env sh
sudo apt-get install -y \
git \
g++ \
libgtk-3-dev \
gtk-doc-tools \
gnutls-bin \
valac \
intltool \
@htr3n
htr3n / cloudSettings
Last active Nov 10, 2020
VSCode/Codium settings
View cloudSettings
{"lastUpload":"2020-11-10T23:43:02.343Z","extensionVersion":"v3.4.3"}
@htr3n
htr3n / ubuntu-installation.md
Created Jun 19, 2019
Installing and setting a working Ubuntu box
View ubuntu-installation.md

Software Management

Ubuntu/Linux Tools

APT (Ubuntu's Advanced Packaging Tool)

# installing a package
sudo apt install zsh
View win-installation.md

System

ssh-keygen -t rsa -b 4096 -C "hoang.huy.tran@gmail.com"

PowerShell

  • Windows PowerShell was built upon .NET and only worked on Windows
  • PowerShell Core is open sourced and built on .NET Core 2.x, work on Windows, Linux, macOS, ARM
@htr3n
htr3n / macos-ramdisk.md
Last active Sep 19, 2021
Creating RAM disk in macOS
View macos-ramdisk.md

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@htr3n
htr3n / firefox-optimization.md
Last active Jul 24, 2021
Firefox Quantum optimization
View firefox-optimization.md

about:config

  • Set browser.download.animateNotifications to False
  • Set security.dialog_enable_delay to 0
  • Set network.prefetch-next to False (Only on slow internet connections)
  • Set browser.newtabpage.activity-stream.feeds.telemetry to false
  • Set browser.newtabpage.activity-stream.telemetry to false
  • Set browser.ping-centre.telemetry to false
  • Set toolkit.telemetry.archive.enabled to false
  • Set toolkit.telemetry.bhrPing.enabled to false
View HelloWorld.java
@RestController
class HelloWorld {
@RequestMapping("/")
public String hello(){
return "Hello World!";
}
}
View Customer.java
package io.github.htr3n.springjdbcsimple.entity;
public class Customer {
private Integer id;
private String name;
private String email;
public Integer getId() {
return id;
}