Skip to content

Instantly share code, notes, and snippets.

View qinshulei's full-sized avatar
🎯
Focusing

Qin Shulei qinshulei

🎯
Focusing
View GitHub Profile
This document describes about installation and configuration of IPMI simulator.
We need: qemu-kvm, OpenIPMI, OpenIPMI-tools
1) Install the qemu-kvm. We need the qemu, which have the IPMI pacthes.
Use the source https://github.com/cminyard/qemu/tree/stable-2.2-ipmi
./configure, make and make install
2) Download the OpenIPMI libraries, from http://sourceforge.net/projects/openipmi/
Follow the process documented in lanserv/README.vm
./configure --prefix=/opt/openipmi/usr --sysconfdir=/opt/openipmi/etc \
--with-perlinstall=/opt/openipmi/usr/lib/perl \
@qinshulei
qinshulei / ubuntu-xenial-armfh-qemu.md
Created March 23, 2017 02:43 — forked from takeshixx/ubuntu-xenial-armfh-qemu.md
Running Ubuntu 16.04.1 armhf on Qemu

Running Ubuntu 16.04.1 armhf on Qemu

This is a writeup about how to install Ubuntu 16.04.1 Xenial Xerus for the 32-bit hard-float ARMv7 (armhf) architecture on a Qemu VM via Ubuntu netboot.

The setup will create a Ubuntu VM with LPAE extensions (generic-lpae) enabled. However, this writeup should also work for non-LPAE (generic) kernels.

The performance of the resulting VM is quite good, and it allows VMs with >1G ram (compared to 256M on versatilepb and 1G on versatile-a9/versatile-a15). It also supports virtio disks whereas versatile-a9/versatile-a15 only support SD cards via the -sd argument.

Get netboot files

@qinshulei
qinshulei / Description.md
Created March 8, 2017 03:18 — forked from juanje/Description.md
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }
@qinshulei
qinshulei / gist:b36c7e9b3672e2e0c04891b6cd934483
Last active December 20, 2016 06:49
query gerrit id by project
We couldn’t find that file to show.
We couldn’t find that file to show.
@qinshulei
qinshulei / getAllFriday.py
Last active September 23, 2016 06:55
get all friday by python.
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import date, timedelta as td
d1 = date(2015, 1, 2)
d2 = date(2016, 12, 31)
delta = d2 - d1
for i in range(0, delta.days + 1, 7):
@qinshulei
qinshulei / getHoliday.py
Last active September 23, 2016 06:45
get holiday
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json, urllib
from urllib import urlencode
#----------------------------------
# 万年历调用示例代码 - 聚合数据
# 在线接口文档:https://www.juhe.cn/docs/api/id/177
#----------------------------------
@qinshulei
qinshulei / mysql_restore.sh
Created September 19, 2016 03:15
restore mysql dump
#!/bin/bash
mysql helpdesk -uhelpdesk -p123456 < helpdesk_20160908_190555.sql
We couldn’t find that file to show.
@qinshulei
qinshulei / replaceSelectWithSelect2.js
Last active August 29, 2016 10:25
js replace select with select2
$().ready(function() {
$('head').append('<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>');
$('head').append('<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css">');
setTimeout(function(){
$('select').select2();
},1000);
})