Skip to content

Instantly share code, notes, and snippets.

View Jimmy-Xu's full-sized avatar

Jimmy Xu Jimmy-Xu

  • Ant Group
  • Beijing, China
View GitHub Profile
@Jimmy-Xu
Jimmy-Xu / test-hyper-sg-win10.md
Last active September 20, 2016 08:54
Test hyper sg sub-command in Windows 10

【测试步骤】

1. 创建jenkins-server-no-sg容器(无sg),分配fip,可以访问8080
2. 创建sg-50000
3. 创建jenkins-server-with-sg容器(带sg-50000),分配fip,无法访问8080
4. 创建sg-8080,添加到jenkins-server-with-sg容器上,可以访问8080
5. 从jenkins-server-with-sg移除sg-8080,无法访问8080
6. 用sg-jenkins-create.yaml创建sg-jenkins,添加到jenkins-server-with-sg容器上,无法访问8080
7. 用sg-jenkins-update.yaml更新sg-jenkins,可以访问8080
8. 从容器jenkins-server-with-sg移除sg-jenkins,无法访问8080
@Jimmy-Xu
Jimmy-Xu / codefresh-integration-test.log
Last active September 26, 2016 16:40
codefresh run integration test result
Pulling cf-integration image...
Creating machine
zone: us-central1-a
type: n1-standard-4
Creating CA: /root/.docker/machine/certs/ca.pem
Creating client certificate: /root/.docker/machine/certs/cert.pem
Running pre-create checks...
(cf-integration-201609261611-050151665) Check that the project exists
(cf-integration-201609261611-050151665) Check if the instance already exists
Creating machine...
@Jimmy-Xu
Jimmy-Xu / codefresh-compose-up.log
Created September 26, 2016 16:18
codefresh compse up log
stop all
Gathering containers information
sessionId rkinjsit, self.session.sessionId rkinjsit
[list method] detected 0 containers
Pulling xjimmyshcn/hyperkins:be0232ac35d96b4cbb0113e1444165882a3b9051
Starting to pull from local registry
Layer '6a5a5368e0c2' already exists
...
Layer 'eccda1695d2b' already exists
Image pull took: 953 ms
@Jimmy-Xu
Jimmy-Xu / interfaces.groovy
Created September 27, 2016 16:50 — forked from djKianoosh/interfaces.groovy
List out network interfaces
def interfaces = NetworkInterface.getNetworkInterfaces()
while (interfaces.hasMoreElements()) {
def addresses = interfaces.nextElement().getInetAddresses()
while (addresses.hasMoreElements()) {
println addresses.nextElement().getHostAddress()
}
}
@Jimmy-Xu
Jimmy-Xu / README.md
Created October 24, 2016 12:08 — forked from julianxhokaxhiu/README.md
How to install OSX 10.11 El Capitan on VMWare

How to install OSX 10.11 El Capitan on VMWare

To accomplish this tutorial you already need a previous copy of OSX installed on VMWare Player or Workstation.

0) Acquire a copy of OSX 10.11 El Capitan

First of all you need to acquire a legal copy of OSX El Capitan from the App Store. This tutorial will not cover this part. Sorry :)

1) Unlock OSX option on VMWare

Download the latest version of VMWare Unlocker and use the relative binary to unlock it ( based on your Host OS ).

@Jimmy-Xu
Jimmy-Xu / hyper-cron-test.md
Last active November 12, 2016 16:13
hyper cron test

command line help

$ hyper cron

/usr/bin/hyper: "cron" requires a minimum of 1 argument.
See '/usr/bin/hyper cron --help'.

Usage:	hyper cron [OPTIONS] COMMAND [OPTIONS]

Commands:
@Jimmy-Xu
Jimmy-Xu / Install-SysinternalsSuiteNano.ps1
Created November 25, 2016 06:22 — forked from janegilring/Install-SysinternalsSuiteNano.ps1
This script will download the Nano Server version of the Sysinternals Suite and extract it to the specified target directory.
#requires -Version 5
<#
NAME: Install-SysinternalsSuiteNano.ps1
AUTHOR: Jan Egil Ring (@JanEgilRing)
COMMENT: This script will download the Nano Server version of the Sysinternals Suite and extract it to the specified target directory.
@Jimmy-Xu
Jimmy-Xu / github-proxy-ssh-tunnel-howto.md
Created January 11, 2017 13:05 — forked from Kagami/github-proxy-ssh-tunnel-howto.md
Using github through SSH tunnel
# Prerequisites: netcat-openbsd (BSD version of netcat)
$ ssh -fND 127.0.0.1:8081 user@<your-vps>
$ git config --global url."https://github".insteadOf git://github
$ git config --global http.proxy 'socks5://127.0.0.1:8081'
$ echo -e 'Host github.com\nProxyCommand nc -x 127.0.0.1:8081 %h %p' >> ~/.ssh/config

Alternative solutions:

@Jimmy-Xu
Jimmy-Xu / mb_substr_replace.php
Created January 19, 2017 05:18 — forked from stemar/mb_substr_replace.php
Multibyte substr_replace(). The mbstring library doesn’t come with a multibyte equivalent of substr_replace(). This function behaves exactly like substr_replace() even when the arguments are arrays.
<?php
function mb_substr_replace($string, $replacement, $start, $length=NULL) {
if (is_array($string)) {
$num = count($string);
// $replacement
$replacement = is_array($replacement) ? array_slice($replacement, 0, $num) : array_pad(array($replacement), $num, $replacement);
// $start
if (is_array($start)) {
$start = array_slice($start, 0, $num);
foreach ($start as $key => $value)
@Jimmy-Xu
Jimmy-Xu / windows10qemu.sh
Created February 8, 2017 13:49 — forked from Manouchehri/windows10qemu.sh
Running Windows 10 in a UEFI enabled QEMU environment with KVM.
# Installing
qemu-system-x86_64 -bios /usr/share/ovmf/ovmf_x64.bin -enable-kvm -cpu host -smp 4 -m 2048 -cdrom ~/Downloads/Win10_English_x64.iso -net nic,model=virtio -net user -drive file=~/vm/win10.hd.img.raw,format=raw,if=virtio -vga qxl -drive file=~/Downloads/virtio-win-0.1.105.iso,index=1,media=cdrom
# Running
qemu-system-x86_64 -bios /usr/share/ovmf/ovmf_x64.bin -enable-kvm -cpu host -smp 4 -m 4096 -net nic,model=virtio -net user -drive file=~/vm/win10.hd.img.raw,format=raw,if=virtio -vga qxl -usbdevice tablet -rtc base=utc