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
location ~ /(?:a|A)utodiscover/(?:a|A)utodiscover.xml {
root /var/www/;
try_files /autodiscover/autodiscover.php =404;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SERVER_ADDR "";
fastcgi_param REMOTE_ADDR $http_x_real_ip;
}
setuid = stunnel
setgid = stunnel
pid = /var/run/stunnel/stunnel.pid
;foreground = yes
debug = info
output = /var/log/stunnel.log
include = /etc/stunnel/conf.d
@xdtianyu
xdtianyu / mac.xml
Last active February 1, 2017 03:47
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>mac2</name>
<uuid>0f508506-75a7-44d0-9a75-e26a6de26082</uuid>
<title>mac2</title>
<description># echo 1 &gt; /sys/module/kvm/parameters/ignore_msrs</description>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-2.4'>hvm</type>

Go交叉编译环境

版本 android arm

环境变量

export NDK_ROOT=/opt/android-ndk-r13b
export APP_ABI=android-24
export NDK_TOOLCHAIN=${NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
@xdtianyu
xdtianyu / setup-android-ndk.sh
Last active January 2, 2017 07:10
setup android sdk and ndk script for docker image
#!/bin/bash
if [ ! -d "/opt/android-ndk-r13b" ];then
cd /opt
wget https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
unzip -qq android-ndk-r13b-linux-x86_64.zip
export ANDROID_NDK=/opt/android-ndk-r13b
export ANDROID_NDK_HOME=/opt/android-ndk-r13b
cd -
fi
@xdtianyu
xdtianyu / kernel-4.8.15-uml.config
Created December 31, 2016 09:03
User Mode Linux kernel 4.8.15 for ArchLinux running docer
#
# Automatically generated file; DO NOT EDIT.
# User Mode Linux/x86 4.8.15 Kernel Configuration
#
CONFIG_UML=y
CONFIG_MMU=y
CONFIG_NO_IOMEM=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
#!/bin/bash
DIR=/opt/install
MYSQL_USER=root
MYSQL_PASS=123456
# prepare repo list
cd $DIR
tar xf repo.tar.gz
[Unit]
Description=dhclient for sending DUID IPv6
Wants=network.target
Before=network.target
[Service]
Type=forking
ExecStart=/sbin/dhclient -cf /etc/dhcp/dhclient6.conf -pf /var/run/dhclient6.ens3.pid -6 -D LL -N -v ens3
PIDFile=/var/run/dhclient6.ens3.pid
ExecReload=/bin/kill -HUP $MAINPID
AUTHOR=MAKE_FOR_FUN
.DEFAULT:
@echo Make $@ great again!
install:
@echo Make Makefile great again!
clean:
@echo "America is great."
@xdtianyu
xdtianyu / README.md
Created June 23, 2016 07:02 — forked from ringe/README.md
KVM QCOW2 Live backup

Live backup of KVM virtual machines

This script will let you make backups of live VMs running on KVM, using libvirt.

The backup job will suspend the VM for the time it takes to copy the RAM to disk.

Credits: Luca Lazzeroni

I've made some minor adjustments.