Skip to content

Instantly share code, notes, and snippets.

View xdtianyu's full-sized avatar
🏠
Working from home

tianyu xdtianyu

🏠
Working from home
View GitHub Profile
function color(A, R, G, B) {
var color = (A & 0xff) << 24 | (R & 0xff) << 16 | (G & 0xff) << 8 | (B & 0xff);
console.log(color);
}
NOTE: These are updated to Android 5.0.1
#!/bin/sh
ping -c 1 10.200.0.1
if [ "$?" -eq 0 ];then
echo "$(date) --> OK"
else
echo "$(date) --> ERROR"
/etc/init.d/shadowvpn-cn restart
fi
#!/bin/sh
ping -c 1 10.200.0.1
if [ "$?" -eq 0 ];then
echo "$(date) --> OK"
else
echo "$(date) --> ERROR"
/etc/init.d/shadowvpn-cn restart
fi

Android 开发人员自动化测试

[TOC]

​ 编写测试的目的是为了验证程序是否正确执行、行为无误及是否稳定可用。同时,拥有充分测试代码的项目易于维护,便于交接、团队协作。

@xdtianyu
xdtianyu / vm-backup.sh
Created May 15, 2017 12:17 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
find * -type f -print0 | xargs -0 stat -c "%20s %n"

Keybase proof

I hereby claim:

  • I am xdtianyu on github.
  • I am xdtianyu (https://keybase.io/xdtianyu) on keybase.
  • I have a public key whose fingerprint is EAB3 35E1 67A6 7396 77E1 8796 0929 5FD1 F1C6 8AB4

To claim this, I am signing this object:

#!/bin/bash
#
# vlmcsd - this script starts and stops the vlmcsd-server daemon
#
# Run level information:
# chkconfig: 2345 99 99
# description: KMS Emulator in C
# processname: vlmcsd
# Source function library
# $Id: PKGBUILD 289024 2017-02-15 21:13:17Z bpiotrowski $
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Sébastien Luttringer
# Contributor: Drew DeVault
pkgname=nginx-mainline
pkgver=1.11.10
pkgrel=1
pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release'
arch=('i686' 'x86_64')