Skip to content

Instantly share code, notes, and snippets.

mine260309 / libpldm (including oem) test on Big Endian system
Last active March 17, 2020 09:09
Run OpenBMC Jenkins jobs in Shanghai Lab
View libpldm (including oem) test on Big Endian system
#Environment to be set in Jenkins
# USER=<USER> (setup by ssh-copy-id)
set -xe
rm -rf ${TMP_LOCAL_REPO}
View test_on_bmc
# Put the binaries on BMC
### Test test_sdbusplus_emit_object
root@romulus:/tmp# ./test_sdbusplus_emit_object&
[1] 445
### By default, the object has 4 interfaces
root@romulus:/tmp# busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper GetObject sas /xyz/openbmc_project/leiyu 0
a{sas} 1 "xyz.openbmc_project.LeiYu.Test" 4 "org.freedesktop.DBus.Introspectable" "org.freedesktop.DBus.ObjectManager" "org.freedesktop.DBus.Peer" "org.freedesktop.DBus.Properties"
mine260309 / Makefile
Last active February 11, 2019 04:52
Demo of bug about init priority in both gcc and clang
View Makefile
CFLAGS=-c -Wall -fpic
SOURCES=main.cpp bar.cpp
all: main
main: main.o
$(CC) -o main main.o -ldl
mine260309 /
Last active August 2, 2018 03:39
Download from youku and convert it to aac, as a podcast
# Depends:
# you-get
# ffmpeg
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <url>"
exit 1
mine260309 /
Last active May 9, 2017 08:53
A single util to upload and update OpenBMC image
#!/usr/bin/env python
Usage: <--file tarball>
<--tftp user@tftp-ip:/path/to/tftproot>
--bmc <bmc-ip>
This scripts copies OpenBMC tarball to TFTP server,
and uses REST APIs to update the tarball to BMC.
View testEventManager.cpp
#include "message.hpp"
#include <gtest/gtest.h>
namespace {
static uint8_t p[] ={0x3, 0x32, 0x34, 0x36};
constexpr auto eventspath = "./events";
event_record_t build_event_record(
const char* message,
const char* severity,
mine260309 / gist:70da43f6799efb9277c12172c65f8940
Last active March 8, 2019 08:15
Permissions used in Alipay 9.6.6
View gist:70da43f6799efb9277c12172c65f8940
APK is pulled from Nexus6p and dumped with `aapt dump permissions base.apk`
uses-permission: name=''
uses-permission: name=''
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.CHANGE_WIFI_STATE'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS'
mine260309 /
Last active September 13, 2018 09:24
Script to get Zhangjian, Shanghai's AQI, take a picture and tweet the status
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import re
import requests
from datetime import datetime
from twython import Twython
mine260309 / Example_2_so_loading_1_a
Last active July 26, 2017 11:53
Sample code for dynamic libraries loadling a static library
View Example_2_so_loading_1_a
This is the sample code for dynamic libraries loadling a static library, the behavior could be different with different compile/link options and dlopen() options.