Skip to content

Instantly share code, notes, and snippets.

View kenwoodjw's full-sized avatar
💭
I may be slow to respond.

kenwoodjw

💭
I may be slow to respond.
View GitHub Profile
@kenwoodjw
kenwoodjw / chatpdf-zh.ipynb
Created April 13, 2023 09:46 — forked from ninehills/chatpdf-zh.ipynb
ChatPDF-zh.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kenwoodjw
kenwoodjw / docker-load-and-push.sh
Created December 13, 2022 10:11 — forked from stefanvangastel/docker-load-and-push.sh
Bash scripts to pull, (optional) retag, save, load and push Docker images. Created to provide easy means to download an image, retag it to use a private registry and then save it to an external disk. In a offline or on-premise environment you can use the load and push script to load images and push them to a private registry.
#!/bin/bash
#### Functions ###
display_usage() {
echo "This script must be run with Docker capable privileges and you should login to your registry before pushing!"
echo -e "\nUsage:\n$0 <saved_image> [--push]\n"
echo -e " <saved_image>\t\t\tThe image file to load and push"
echo -e " [--push]\t\t\tPush to registry"
echo -e "\nExample: $0 /mydir/ubuntu.tar --push "
}
[root@ip-11-0-0-239 centos]# firewall-cmd --zone=trusted --add-source=94.204.104.194/32
success
[root@ip-11-0-0-239 centos]# firewall-cmd --zone=trusted --add-source=94.206.104.194/32
success
[root@ip-11-0-0-239 centos]# firewall-cmd --zone=trusted
success
[root@ip-11-0-0-239 centos]# firewall-cmd --list-sources
You're performing an operation over default zone ('public'),
but your connections/interfaces are in zone 'trusted' (see --get-active-zones)
You most likely need to use --zone=trusted option.
@kenwoodjw
kenwoodjw / parse_json_post.go
Created October 12, 2021 10:08 — forked from andreagrandi/parse_json_post.go
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string
@kenwoodjw
kenwoodjw / jinja_variables_types.yml
Created June 22, 2020 03:18 — forked from spiette/jinja_variables_types.yml
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1
@kenwoodjw
kenwoodjw / parse_dotenv.bash
Created November 16, 2018 06:44 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
jobs:
- bucky_deploy
- android_customer_deploy:
requires:
- bucky_deploy
- ios_customer_deploy:
requires:
- android_customer_deploy
- android_courier_deploy:
requires:
Command to run:
ssh -L 2222:localhost:8501 user@remoteserver.com
where 2222 is the local port mapping it can be any number above 1000
where localhost must be set to localhost and refers to your current connection
where 8501 is the port you will be opening up on the remote machine
where user@remoteserver.com is the first hop in your quest for internal access
#mtk caffe 模型转换
python scripts/caffe2pb_inference.py \
--model=models/resnet/ResNet-50-model.caffemodel \
--proto=models/resnet/ResNet-50-deploy.prototxt
python scripts/caffe2pb_inference.py \
--model=models/mobilenet/mobilenet_v2.caffemodel \
--proto=models/mobilenet/mobilenet_v2_deploy.prototxt
#华为 caffe 模型转换
#remove all exit
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm