Skip to content

Instantly share code, notes, and snippets.

View flashvnn's full-sized avatar

Huynh Khac Thao flashvnn

View GitHub Profile
@flashvnn
flashvnn / Vagrantfile
Created July 16, 2021 13:35
Vagrantfile ubuntu
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@flashvnn
flashvnn / install_apache_php.sh
Created July 15, 2021 08:28
Install Apache PHP 7.4
#!/bin/bash
## Install apache
echo "Install apache..."
sudo apt install zip unzip apache2 -y
sudo service apache2 start
## Install virtualhost to create vhost
echo "Install virtualhost create script..."
@flashvnn
flashvnn / index.js
Created June 29, 2021 06:35
Totaljs Serverless
require('total4');
const serverless = require('serverless-http');
async function Server(req, res, options) {
F.console = NOOP;
return new Promise(function (resolve, reject) {
F.custom('prod', undefined, req, res, options, () => resolve(true));
})
}
@flashvnn
flashvnn / index.js
Created June 27, 2021 13:49
Total js with aws serverless
require('total4');
ROUTE('GET /test', function () {
this.json({'data': 'OK'});
})
NEWSCHEMA('Customers', function(schema) {
schema.setQuery(function($) {
$.callback({time: NOW.toTimeString()});
});
@flashvnn
flashvnn / PhpStorm2020TrailReset.bat
Last active May 24, 2021 01:35
PhpStorm2020TrailReset.bat, run with administration on Windows
cd "%USERPROFILE%\AppData\Roaming\JetBrains\PhpStorm2020*"
::copy /y "options\recentProjectDirectories.xml" %tmp%\recentProjectDirectories.xml
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs" /f
:: This will work for idea 2018.3 and later
::
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
@flashvnn
flashvnn / csv.php
Created April 14, 2021 03:08
league csv force enclosure
<?php
$header = ["position" , "team", "played", "goals difference", "points"];
$records = [
[1, "Chelsea", 26, 27, 57],
[2, "Arsenal", 26, 22, 56],
[3, "Manchester City", 25, 41, 54,],
[4, "Liverpool", 26, 34, 53],
[5, "Tottenham", 26, 4, 50],
[6, "Everton", 25, 11, 45],
[7, "Manchester United", 26, 10, 42],
#!/bin/bash
## Install apache
echo "Install apache..."
sudo apt install zip unzip apache2 -y
sudo service apache2 start
## Install virtualhost to create vhost
echo "Install virtualhost create script..."
@flashvnn
flashvnn / install_ubuntu_andronix.sh
Last active July 25, 2021 02:06
Install Ubuntu on Ubuntu Andronix
#!/bin/bash
## Fix locale
# https://github.com/iam-rocketman/ubuntu-locale-fix/blob/master/fix_locale.sh
echo "Install Java JDK"
sudo apt install default-jdk -y
## Install apache
echo "Install apache..."
sudo apt install apache2 -y
@flashvnn
flashvnn / background.sh
Created November 19, 2020 13:15
Run command in background
command > /dev/null 2>&1 &
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName drupal.local
ServerAlias drupal.local
DocumentRoot /data/data/com.termux/files/home/projects/drupal/web
<Directory />
AllowOverride All
</Directory>
<Directory /data/data/com.termux/files/home/projects/drupal/web>