Skip to content

Instantly share code, notes, and snippets.

View kenee's full-sized avatar

Ken kenee

View GitHub Profile
@kenee
kenee / docker-registry-mirrors.md
Created June 20, 2023 10:46 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@kenee
kenee / run.tpl
Last active May 4, 2023 02:04 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@kenee
kenee / chatglm-openai-api.ipynb
Created April 21, 2023 08:03 — forked from ninehills/chatglm-openai-api.ipynb
chatglm-openai-api.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kenee
kenee / get_googlecache.py
Created March 29, 2016 13:06
get website googlecache
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import re
import socket
import os
import time
import random
import requests
@kenee
kenee / worpress_page_parser.php
Last active March 29, 2016 13:06
import wordpress page that crawl from googlecache to database
<?php
ini_set('display_errors',true);
error_reporting(E_ALL ^ E_NOTICE);
$obj = new HtmlImporter();
$obj->run();
class HtmlImporter {
# -*- coding: UTF-8 -*-
import XenAPI
import os
class XenController():
def __init__(self, URL, UserName, Password):
self.session = XenAPI.Session(URL)
self.session.xenapi.login_with_password(UserName, Password)
@kenee
kenee / xinnet_2_dnspod
Last active August 29, 2015 13:57
分析新网的域名解析列表页,生成符合dnspod导入格式的txt文件,这个txt文件可以用dnspod的[客户端](https://support.dnspod.cn/Support/api) 导入
<?php
define("DOMAIN_NAME", 'mydomain.com');
$dnspod_header = "主机|类型|线路|记录值|MX优先级|TTL|备注\n";
$dnspod_content = "";
$xinnet_html = file_get_contents("o.txt");
preg_match('/<!-- ADDRESS RECORDS -->([\s\S]+)tbccname/',$xinnet_html,$ret);
@kenee
kenee / facybox
Created August 15, 2013 13:36
facybox demon
<html>
<body>
<!-- Add jQuery library -->
<script type="text/javascript" src="http://cdn.staticfile.org/jquery/2.0.3/jquery.min.js"></script>
<!-- Add mousewheel plugin (this is optional) -->
<!--
<script type="text/javascript" src="http://cdn.staticfile.org/jquery-mousewheel/3.1.3/jquery.mousewheel.min.js"></script>
<!-- Add fancyBox -->
<link rel="stylesheet" href="http://cdn.staticfile.org/fancybox/2.1.4/jquery.fancybox.min.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://cdn.staticfile.org/fancybox/2.1.4/jquery.fancybox.min.js"></script>
@kenee
kenee / gist:6069320
Created July 24, 2013 09:56
根据满查询多少排序
grep "use shop" /var/lib/mysql/slow.log | awk '{print $2}' | awk -F\; '{print $1}' | sort | uniq -c | sort -nr
@kenee
kenee / php_daemon.php
Created June 26, 2013 16:41
double fork
<?php
/*
PHP forked daemon
Standalone PHP binary must be compiled with --enable-sockets and --enable-pcntl
Dave M. -2002
Online Services USA
*/
define(DEBUG,true);
require dirname(__FILE__)."/../../config/config.php";