Skip to content

Instantly share code, notes, and snippets.

View aperture147's full-sized avatar

Vũ Hải aperture147

View GitHub Profile
@aperture147
aperture147 / Example.java
Created December 18, 2017 10:26
Scanner Example
import java.util.Scanner;
public class MainApp {
public static void main(String[] args) {
String ten;
int tuoi = 0;
String diachi;
Scanner input = new Scanner(System.in);
import java.util.Scanner;
public class MainApp {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Nhap do dai mang: ");
int n = input.nextInt();
int[] array = new int[n];
@aperture147
aperture147 / Scanner3.java
Created December 18, 2017 19:35
Scanner3
import java.util.Scanner;
public class MainApp {
public static void main(String[] args) {
String ten;
int tuoi = 0;
String diachi;
Scanner input = new Scanner(System.in);
@aperture147
aperture147 / keybase.md
Created September 11, 2019 15:55
Keybase

Keybase proof

I hereby claim:

  • I am aperture147 on github.
  • I am aperture147 (https://keybase.io/aperture147) on keybase.
  • I have a public key ASBd6WY1IzBYC5Zy4QVnfILfp8SmybQ2VmhHke5DNp9B3Ao

To claim this, I am signing this object:

@aperture147
aperture147 / ddclient.conf
Last active August 3, 2020 00:31
ddclient config file for cloudflare
protocol=cloudflare,
#Tell ddclient to get real ip address
use=web, web=checkip.dyndns.org
#Credentials for Cloudflare api
ssl=yes
login=#some email
password=#global API Key
zone=haivq.com
@aperture147
aperture147 / ffmpeg.go
Last active November 13, 2024 16:30
fix make buffer
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"os/exec"
)
@aperture147
aperture147 / sysctl.conf
Created January 9, 2024 18:30 — forked from maprangzth/sysctl.conf
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@aperture147
aperture147 / cryptojs_compatible.py
Last active April 14, 2025 07:49
A encrypt-decrypt function pair that generate compatible AES encrypted data which compatible with CryptoJS default function. Kudo to @Danyfirex
# original answer: https://gist.github.com/sh4dowb/efab23eda2fc7c0172c9829cf34dc96c?permalink_comment_id=5144932#gistcomment-5144932
# pip install pycryptodome
import base64
from Crypto.Hash import MD5
from Crypto.Util.Padding import unpad
from Crypto.Util.Padding import pad
from Crypto.Cipher import AES
import secrets
def decrypt(ciphertext, password):
@aperture147
aperture147 / int_to_vie_pron.py
Last active April 21, 2025 08:38
A simple python code to convert integer number to pronunciation. Use this function to pre process text before feeding it into a TTS model. Work best for number less than 1 trillion (since I have no clue how number beyond 1 trillion be pronounced in Vietnamese)
import itertools
rule_1_pronunciation_list = ['', 'mốt', 'hai', 'ba', 'tư', 'lăm', 'sáu', 'bảy', 'tám', 'chín']
rule_2_pronunciation_list = ['không', 'một', 'hai', 'ba', 'bốn', 'năm', 'sáu', 'bảy', 'tám', 'chín']
# should support decimal number, but I don't know how to pronounce decimal number correctly in Vietnamese
a = 1234567890
suffix_cycle = itertools.cycle(['', 'nghìn', 'triệu', 'tỷ'])