Skip to content

Instantly share code, notes, and snippets.

View KhoiNguyenICT's full-sized avatar
🎯
Focusing

KhoiNguyenICT

🎯
Focusing
View GitHub Profile
@KhoiNguyenICT
KhoiNguyenICT / SSH_key_gen.txt
Last active March 3, 2022 03:42
SSH key gen
ssh-keygen -t rsa -b 4096 -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
ssh -T [email protected]
@KhoiNguyenICT
KhoiNguyenICT / deploy-net-core.md
Last active April 24, 2021 03:12
Deploy .net and environments

Install .net sdk and .net runtime

  1. Add the Microsoft package signing key to your list of trusted keys and add the package repository
wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
  1. Install the SDK
1. build app1 project with prod flag
ng build --prod
2. copy files under dist folder to the server
scp -r dist/app1/* {username}@{ip address of server}:/var/www/app1/
3. set base href of application (app1 works on /)
<base href="/">
4. build app2 project with prod flag
@NgModule({
imports: [OAuthModule.forRoot({...})] // <-- how to use the configuration.json here
})
export class AppModule {
constructor(@Inject(AppConfig) private readonly appConfig: AppConfiguration) {} // I can inject
}
@KhoiNguyenICT
KhoiNguyenICT / apache-superset-on-windows10.md
Created September 16, 2020 09:42 — forked from mark05e/apache-superset-on-windows10.md
Installing Apache Superset on Windows 10

Installing Apache Superset on Windows 10

⚠️ WARN: This doc might be outdated. Use with caution. Only tested with Python v3.7

🙋‍♂️ INFO: If you have fixes/suggestions to for this doc, please comment below.

🌟 STAR: This doc if you found this document helpful.


import os
from werkzeug.contrib.cache import RedisCache
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
REDIS_SERVER_IP = os.getenv('REDIS_SERVER_IP', '')
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD', '')
POSTGRES_SERVER_IP = os.getenv('POSTGRES_SERVER_IP', '')
POSTGRES_USER = 'superset'
POSTGRES_PASSWORD = os.getenv('POSTGRES_PASSWORD', '')
SUPERSET_CACHE_REDIS_URL = "".join(['redis://:', REDIS_PASSWORD, '@', REDIS_SERVER_IP, ':6379/1'])
SUPERSET_BROKER_URL = "".join(['redis://:', REDIS_PASSWORD, '@', REDIS_SERVER_IP, ':6379/0'])
@KhoiNguyenICT
KhoiNguyenICT / ERC20.sol
Created September 3, 2020 07:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity^0.4.25;
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
interface ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
@echo off
title Activate Office 365 ProPlus for FREE - MSGuides.com&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products: Office 365 ProPlus (x86-x64)&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&echo Activating your Office...&cscript //nologo slmgr.vbs /ck
@KhoiNguyenICT
KhoiNguyenICT / SQLServerFTS.cs
Last active May 10, 2022 03:53
SQLServerFTS.cs
using Microsoft.EntityFrameworkCore.Migrations;
namespace Application.Api.Migrations
{
public partial class InitMetadataDatabase : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("CREATE FULLTEXT CATALOG FTS_Catalog WITH ACCENT_SENSITIVITY = OFF AS DEFAULT;", true);