Skip to content

Instantly share code, notes, and snippets.

View vitran96's full-sized avatar

Chris vitran96

View GitHub Profile
param (
[Parameter(Position = 0, Mandatory = $true)]
[ValidateScript({Test-Path $_ -PathType 'Leaf'})]
[string]$originalPemPath
)
$fileName = (Get-Item -Path $originalPemPath).BaseName
# Get the current user's home directory
$homeDirectory = [Environment]::GetFolderPath("UserProfile")
@vitran96
vitran96 / copyResources.xml
Created April 17, 2023 02:40
Maven snippet
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>parentGroupID</groupId>
<artifactId>parentArtifactID</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
#!/bin/bash
set echo off
echo "Remove cmake if exist"
sudo apt remove -y --purge --auto-remove cmake
echo "Install required packaged"
sudo apt update -y
sudo apt install -y software-properties-common lsb-release
"cmd.exe" /c "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\Emotive\CMakeBuilds\rt7_inst_relwithdebuginfo_x86_32" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX86/x86/cl.exe" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX86/x86/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe"
@vitran96
vitran96 / FindXQilla.cmake
Last active November 13, 2020 04:24
Auto find XQilla. Please add XQilla root path into CMAKE_PREFIX_PATH before invoking find_package(...)
find_path(XQilla_INCLUDE_DIR
NAMES xqilla/xqilla-simple.hpp
DOC "XQilla include directory")
mark_as_advanced(XQilla_INCLUDE_DIR)
find_library(XQilla_LIBRARY
NAMES "xqilla"
"xqillad"
"xqilla${XQilla_VERSION_MAJOR}${XQilla_VERSION_MINOR}"
@vitran96
vitran96 / 01_Install_SSH.txt
Last active October 22, 2020 09:15
Debian_base_InstallOpenSSH.txt
# For Debian base Linux Distro
sudo apt install openssh-server
sudo systemctl status ssh
@vitran96
vitran96 / scanip.sh
Last active August 23, 2020 01:49
Scan local network ip address with NMap (Require sudo to do full mapping)
nmap -sP 192.168.1.0/24
@vitran96
vitran96 / InstallSSH0.0.1.0.bat
Last active August 23, 2020 01:42
Windows 10 OpenSSH with PowerShell (Admin)
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0