Skip to content

Instantly share code, notes, and snippets.

@loveyu
loveyu / comments-ajax-8Lxhzl32Y243.php
Created September 8, 2020 03:56
wordpress 自定义评论提交
<?php
header("Content-Type: text/html; charset=utf-8");
function err($error){
header('HTTP/1.1 405 Method Not Allowed');
echo $error;
comment_error_record($error);
exit;
}
function is_black_author($author){
@loveyu
loveyu / wget-SVG_sovereign_state_flags.php
Last active September 30, 2018 08:17
主权国家国旗下载
<?php
/**
* 主权国家国旗下载
* @see https://commons.wikimedia.org/wiki/Category:SVG_sovereign_state_flags
* @datetime 2018/09/30
*/
$obj = [
"https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Afghanistan.svg",
"https://upload.wikimedia.org/wikipedia/commons/3/36/Flag_of_Albania.svg",
"https://upload.wikimedia.org/wikipedia/commons/7/77/Flag_of_Algeria.svg",
@loveyu
loveyu / kvm-network-restart.php
Last active September 16, 2018 06:38
KVM Network Restart PHP Shell Script
#!/usr/bin/php
<?php
$shell_get_network_list = "virsh net-list | tail -n +3 | head -n -1 | awk '{ print $1; }'";
$shell_destroy_network = "virsh net-destroy %s";
$shell_start_network = "virsh net-start %s";
$shell_get_runing_kvm = "virsh list | tail -n +3 | head -n -1 | awk '{ print $2; }'";
$shell_get_kvm_domif = "virsh domiflist \"%s\" | tail -n +3 | head -n -1";
$shell_domif_detach = "virsh detach-interface \"%s\" %s --mac \"%s\"";
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loveyu
loveyu / gadm.china.geojson
Created June 30, 2018 18:06
Gadm 中的中国边界数据
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loveyu
loveyu / guangzhou.geojson
Created June 30, 2018 17:15
广州市区Geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loveyu
loveyu / dnspod.sh
Created October 13, 2014 15:09
纯 Shell 实现DNSPOD 域名动态更新
#!/bin/bash
#########################################
# author : loveyu #
# url : http://www.loveyu.org #
#########################################
function post()
{
#提交域名更新请求
if [ "" = "$1" ]
then