Skip to content

Instantly share code, notes, and snippets.

@dbbbit
dbbbit / bootmsg
Created September 21, 2017 00:09
kernel
dbbbit@ubuntu:~/red/linux-2.6.39$ ../lk-tester-maker/debug2_6.sh
rm: cannot remove 'arch/x86/boot/initrd.img-2.6.39': No such file or directory
[sudo] password for dbbbit:
W: plymouth: The plugin label.so is missing, the selected theme might not work as expected.
W: plymouth: You might want to install the plymouth-themes and plymouth-label package to fix this.
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.39 (dbbbit@ubuntu) (gcc version 4.9.3 (Ubuntu 4.9.3-13ubuntu2) ) #7 SMP Mon Sep 18 23:08:53 CST 2017
@dbbbit
dbbbit / recover.go
Created March 28, 2017 14:31
golang panic recover
package main
import (
"fmt"
"runtime/debug"
)
func f() (ret interface{}, err error){
var x interface{}
defer func() {
@dbbbit
dbbbit / b.py
Last active March 16, 2017 08:35
from heimdall_client import X
X.setRule('''<?xml version="1.0"?><data><production><lhs><has identifier="spu:1" attribute="quantity" value="$quantity"/></lhs><rhs kind="quota:order:spu" quota="1" spu_id="1"/></production></data>''')
X.getRule()
class Field(object):
def __init__(self, value=None):
self.value = value
def __get__(self, instance, owner):
print("getting")
return self.value
def __set__(self, instance, value):
fn main() {
let mut a = String::from("hello");
{
let b = &mut a;
&&&&&&&&&&&&&&&&&&&&&&&b.push('b');
}
a.push('a');
println!("{}", a);
}
# -*- coding: utf-8 -*-
# 嵌套式事务
class OriginStore(object):
cache = []
success = []
def transaction_begin(self):
if len(self.cache):

deb http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse

from origin import A
A.p = "test"