Skip to content

Instantly share code, notes, and snippets.

zxkletters zxkletters

Block or report user

Report or block zxkletters

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View direct access memory location in java
import java.lang.reflect.Field;
import sun.misc.Unsafe;
public class Direct {
public static void main(String... args) {
Unsafe unsafe = null;
try {
View vimrc-实用设置
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""实用设置
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set sw=4
set ts=4
set et
set smarttab
set smartindent
set lbr
set fo+=mB
View vimrc-显示相关
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"显示相关
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set cul "高亮光标所在行
"set cuc
set shortmess=atI " 启动的时候不显示那个援助乌干达儿童的提示
set lines=40 columns=155
set go= " 不要图形按钮
"set guifont=Courier_New:h10:cANSI " 设置字体
autocmd InsertLeave * se nocul " 用浅色高亮当前行
View vimrc-新建文件自动插入title
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""新文件标题
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"新建.c,.h,.sh,.java文件,自动插入文件头
autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java,*.py exec ":call SetTitle()"
""定义函数SetTitle,自动插入文件头
func SetTitle()
"如果文件类型为.sh文件
if &filetype == 'sh'
call setline(1,"\#!/bin/bash")
View vimrc-键盘映射
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"键盘命令
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" keyboard shortcuts
let mapleader = ','
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
map <C-w> <C-w>w
@zxkletters
zxkletters / decorator.py
Created Sep 30, 2013
demo of decorator in python
View decorator.py
"""
Created on 2013-4-8
@author: xiaoke.zhangxk
"""
def blue_box(func):
def wrapped():
print "~~ blue ~~~"
func()
View python随机生成大写字母和数字组成的字符串
### 随机生成大写字母和数字组成的字符串
6U1S75
4Z4UKK
U911K4
解决:
import string, random
''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(N))
@zxkletters
zxkletters / 循环宏
Last active Dec 23, 2015
定义for循环宏
View 循环宏
#include <stdio.h>
#define foreach_range10 int i; \
for(i=0;i<10;i++){\
printf("%d\n",i);\
}
main() {
foreach_range10;
@zxkletters
zxkletters / vimrc配置-新建文件时自动生成文件头
Created Sep 11, 2013
.vimrc配置, 新建文件时,如果autocmd匹配文件类型成功,则根据模版自动生成文件头
View vimrc配置-新建文件时自动生成文件头
" auto add file header
autocmd BufNewFile *.py 0r /home/zxkletters/.vim/vim_template/vim_header_for_python
autocmd BufNewFile *.py ks|call FileName()|'s
autocmd BufNewFile *.py ks|call CreatedTime()|'s
autocmd BufNewFile *.sh 0r /home/zxkletters/.vim/vim_template/vim_header_for_sh
autocmd BufNewFile *.sh ks|call FileName()|'s
autocmd BufNewFile *.sh ks|call CreatedTime()|'s
fun FileName()
View README.md

替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"

You can’t perform that action at this time.