sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
chmod +x ./install.sh;./install.sh
import ctypes | |
from ctypes import * | |
string_raw = "char* args" | |
int_raw = 123 | |
args1 = c_char_p(string_raw.encode('utf-8')) | |
args2 = c_int(int_raw) | |
lib = ctypes.cdll.LoadLibrary("D:\\path\\to\\func.dll") |
--将数据去重后存入临时表,PostgreSQL会自动创建tmp_table以及表结构 | |
select distinct * into tmp_table from repeat_table; | |
--删除原记录 | |
delete from repeat_table; | |
--将临时表数据插入原表 | |
insert into repeat_table select * from tmp_table; | |
--删除临时表 | |
drop table tmp_table; |
import mercantile | |
import rasterio | |
from rasterio.session import OSSSession | |
from rasterio.warp import transform_bounds | |
from rio_tiler import constants | |
with rasterio.open(prefix) as src: | |
bounds = transform_bounds( | |
src.crs, constants.WGS84_CRS, *src.bounds, densify_pts=21 | |
) |
import pickle | |
import redis | |
class CACHE: | |
def __init__(self, host='127.0.0.1',password='123456'): | |
pool = redis.ConnectionPool(host=host, password=password) | |
self.conn = redis.Redis(connection_pool=pool) | |
def insert_image(self, frame_id, frame): | |
# 将图片序列化存入redis中 |
select setval('record_id_seq', (select max(id) from record)); |
#!/bin/bash | |
# ./hugox test-ok-dd title-of-post catalog | |
cd ~/repos/blog | |
zh=$2 | |
path=`hugo new posts/$1.md | cut -f1 -d" "` | |
echo $path | |
sed -i '' "s|\".*\"|\"${zh}\"|" $path | |
sed -i '' '5i\ | |
tags: [""] | |
' $path |