Skip to content

Instantly share code, notes, and snippets.

<?php
function createField($H, $W)
{
$field = array();
for ($i = 0; $i < $H; $i++) {
$field[] = array_fill(0, $W, '.');
}
return $field;
}
<?php
function createField($H, $W)
{
$field = array();
for ($i = 0; $i < $H; $i++) {
$field[] = array_fill(0, $W, '.');
}
return $field;
}
#!/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
@lechuhuuha
lechuhuuha / testdns2.py
Last active August 29, 2024 01:52
use mutil threading for calling socket request to domains, skip any domains that does not respond after 30 seconds
#!/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
package http
import (
"embed"
"errors"
"io/fs"
"net/http"
"path/filepath"
"github.com/gin-contrib/static"
<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 });
@lechuhuuha
lechuhuuha / text.txt
Created November 12, 2024 01:44
install collab office local
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ở
@lechuhuuha
lechuhuuha / setup.txt
Last active December 1, 2024 14:33
Setup minio + elasticsearch + apache tika + mongodb
### 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"