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
### Elasticsearch | |
sysctl -w vm.max_map_count=262144 | |
sudo sysctl -p | |
1. docker network create elastic | |
2. docker pull docker.elastic.co/elasticsearch/elasticsearch:8.16.0 | |
3. docker run -d --name es01 --net elastic -p 9200:9200 -it -m 2GB docker.elastic.co/elasticsearch/elasticsearch:8.16.0 | |
1. docker logs -f es01 | |
1. Đợi logs ra password và token | |
4. export ELASTIC_PASSWORD="your_password" |
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
mở command line trên windows | |
chạy dưới quyền administrator | |
wsl --install -d Ubuntu-22.04 | |
sau khi cài xong | |
nhấn nút windows | |
tìm kiếm Ubuntu rồi mở |
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
<script lang="ts" setup> | |
import { AliasListResponse, IAlias } from '@/interfaces/IAlias'; | |
import { t } from '@/plugins/i18n'; | |
import { ListAliasRequest } from '@/request/alias/request'; | |
import { AliasStore } from '@/stores/alias-store'; | |
import { ref } from 'vue'; | |
const route = useRoute(); | |
const aliasStore = AliasStore(); | |
const params = ref<{ nodeId: string }>(route.params as { nodeId: string }); |
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
package http | |
import ( | |
"embed" | |
"errors" | |
"io/fs" | |
"net/http" | |
"path/filepath" | |
"github.com/gin-contrib/static" |
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
#!/usr/bin/env python3 | |
""" | |
Compares output of URLFWD records to URL Redirects | |
$ python3 check_url_redirects.py <apikey> | |
Prerequisites: | |
Python 3 install | |
pip install requests pydig |
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
#!/usr/bin/env python3 | |
""" | |
Compares output of URLFWD records to URL Redirects | |
$ python3 check_url_redirects.py <apikey> | |
Prerequisites: | |
Python 3 install | |
pip install requests pydig |
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
<?php | |
function createField($H, $W) | |
{ | |
$field = array(); | |
for ($i = 0; $i < $H; $i++) { | |
$field[] = array_fill(0, $W, '.'); | |
} | |
return $field; | |
} |
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
<?php | |
function createField($H, $W) | |
{ | |
$field = array(); | |
for ($i = 0; $i < $H; $i++) { | |
$field[] = array_fill(0, $W, '.'); | |
} | |
return $field; | |
} |
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
<?php | |
function count_highlighted_letters($L, $N, $selections) | |
{ | |
// Initialize an array to keep track of highlighted status for each character in S | |
$highlighted = array_fill(0, $L, false); | |
// Process each selection | |
foreach ($selections as $selection) { | |
list($a, $b) = $selection; | |
// Convert to 0-based index |
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
import fs from 'fs'; | |
import path from 'path'; | |
import axios from 'axios'; | |
import FormData from 'form-data'; | |
// Path to the file you want to upload | |
const filePath: string = path.join(__dirname, 'yourfile.txt'); | |
// URL of the remote server | |
const url: string = 'https://example.com/upload'; |
NewerOlder