function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| const fetchTimeout = (url, ms, {signal, ...options} = {}) => { | |
| const controller = new AbortController() | |
| const promise = fetch(url, {signal: controller.signal, ...options}) | |
| if (signal) signal.addEventListener('abort', () => controller.abort()) | |
| const timeout = setTimeout(() => controller.abort(), ms) | |
| return promise.finally(() => clearTimeout(timeout)) | |
| } |
cukup taruh ini pada controller base pada fungsi init:
public function init()
{
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization');
header("Access-Control-Allow-Credentials: true");Cara menghubungkan 2 node yang berbeda IP Address. misalnya terdapat 2 node yang berbeda 192.168.1.10 dan 192.168.1.20.
caranya dengan menggunakan nama --name saat terhubung dengan iex.
node 1:
iex --name ali@192.168.1.10 --cookie rahasia
Buka file di neovim kemudian pada mode normal ketikan command ini
:set filetype?
maka neovim akan mencetak tipe file saat ini misalnya typescriptreact
lsusb
akan didapat seperti ini:
Bus 001 Device 013: ID 1a2c:9df4 China Resource Semico Co., Ltd USB Gaming Keyboard
path devicesnya dari perangkat di atas yaitu:
/dev/bus/usb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::ffi::OsString; | |
| use std::env; | |
| use std::sync::{Arc, Mutex, mpsc}; | |
| use std::time::Duration; | |
| use tokio::{ | |
| net::TcpListener, | |
| io::{ | |
| AsyncReadExt, AsyncWriteExt | |
| }, | |
| }; |