Skip to content

Instantly share code, notes, and snippets.

View flashvnn's full-sized avatar

Huynh Khac Thao flashvnn

View GitHub Profile
@flashvnn
flashvnn / tunnel.example.com.conf
Last active February 7, 2023 13:44
Go http proxy with apache
<VirtualHost 10.0.0.195:80>
ServerAlias *.tunnel.example.com
ProxyPass / http://localhost:7080/
ProxyPassReverse / http://localhost:7080/
UseCanonicalName on
ProxyPreserveHost on
</VirtualHost>
# Support ssl .well-known folder for virtualmin
<VirtualHost *:80>
@flashvnn
flashvnn / index.js
Created June 7, 2022 05:46
Totaljs http2
const spdy = require('spdy');
const fs = require('fs');
require('total4');
// Registers a route
ROUTE('GET /', function() {
// this === Controller
this.json({ message: 'Hello world' });
});
@flashvnn
flashvnn / get_module_php_version.js
Created June 2, 2022 06:46
Get php varsion requirement of Drupal contrib modules
require('total4');
const fs = require('fs');
var contrib = PATH.root() + '/../../docroot/modules/contrib'
const directories = source => fs.readdirSync(source, {
withFileTypes: true
}).reduce((a, c) => {
c.isDirectory() && a.push(c.name)
@flashvnn
flashvnn / install.zip.so
Created May 18, 2022 04:10
Install php zip.so from source
https://developpaper.com/aliyun-centos-7-6-install-php7-3/
@flashvnn
flashvnn / vite.config.js
Created April 28, 2022 04:42
Vite config for output without hash
import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
resolve: {
@flashvnn
flashvnn / php_kill_process.php
Created March 21, 2022 03:33
PHP kill process
<?php
$exe_command = 'ping google.com';
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout -> we use this
2 => array("pipe", "w") // stderr
);
$process = proc_open($exe_command, $descriptorspec, $pipes);
if (is_resource($process))
{
@flashvnn
flashvnn / php7.4-zip.sh
Last active July 7, 2023 03:56
Install php74-zip extension
pecl uninstall zip && pecl install zip
# if has error with zipconf.h
cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h
pecl install zip
@flashvnn
flashvnn / apache_php74_install.sh
Last active August 24, 2021 15:00
Install apache php 7.4 Andronix Ubuntu
#!/bin/bash
## Install apache
echo "Install apache..."
sudo apt install zip unzip patch apache2 -y
## Add mode rewrite
sudo a2enmod rewrite
@flashvnn
flashvnn / link.txt
Created August 14, 2021 10:37
Download VSCode for Ubuntu Andronix