Skip to content

Instantly share code, notes, and snippets.

View skyscribe's full-sized avatar
🏠
Available

Fei skyscribe

🏠
Available
View GitHub Profile
@skyscribe
skyscribe / Dockerfile
Last active March 16, 2023 16:39
Build slim rust with alpine and cargo chef
FROM docker-registry-remote.artifactory-espoo1.int.net.nokia.com/rust:1.66-alpine as chef
RUN apk add --no-cache musl-dev
RUN cargo --version
RUN cargo install cargo-chef
WORKDIR /app
FROM chef as planner
COPY Cargo.toml Cargo.lock ./
RUN cargo chef prepare --recipe-path recipe.json
@skyscribe
skyscribe / validate_sphinx_build_error_warnings
Created January 7, 2023 08:25
Filter out errors generated by sphinx build, and filterout those accepted problems, support color print based on parsed problems.
#!/usr/bin/env bash
function cecho(){
RED="\033[0;31m"
GREEN="\033[0;32m" # <-- [0 means not bold
YELLOW="\033[1;33m" # <-- [1 means bold
CYAN="\033[1;36m"
# ... Add more colors if you like
NC="\033[0m" # No Color
*********************************( LOCAL_2_CELL_RES_MAP_TO_ANTENNAS_REQ_MSG )*********************************
API header: to board : 0x13
API header: to CPU : 0x52
API header: to task : 0x1080
typeOfAntennaBus :0x1
rocModeOn :0
numOfLocalCells :0x1
@skyscribe
skyscribe / generate_boost_tags.sh
Last active August 29, 2015 13:56
Generate boost ctag files
find /usr/local/include/boost -type f |egrep -v "boost/(typeof|spirit|phoenix|gil)" > boost-filelist
ctags --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/tagfiles/boost/tags -L boost-filelist
bkup=_tmp
tagFile=~/.vim/tagfiles/boost/tags
tagFileTmp=$tagFile$bkup
ignored=""
tagOut=$tagFile.test
cat $tagFile | sed -n "/detail/\!p" > $tagFileTmp
@skyscribe
skyscribe / CMakeLists.txt
Last active December 25, 2015 08:29
CMakeLists.txt for Boost template
cmake_minimum_required(VERSION 2.6)
set(Boost_DEBUG 1)
set(Boost_ADDITIONAL_VERSIONS "1.54" "1.54.0")
find_package( Boost 1.45.0 COMPONENTS
date_time
filesystem
regex
thread
system)
@skyscribe
skyscribe / gdb_backtrace.txt
Last active December 15, 2015 02:08
boost regex crash during startup
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000601ad0 in strlen@@GLIBC_2.2.5 ()
(gdb) bt
#0 0x0000000000601ad0 in strlen@@GLIBC_2.2.5 ()
#1 0x00000000004012b9 in std::char_traits<char>::length (__s=0x401498 "\"http:\\\\/\\\\/localhostr.com\\\\/files\\\\/.+?\"")
at /opt/gcc/linux64/ix86/gcc_4.3.2-7p3/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/char_traits.h:262
#2 0x00000000004012d0 in boost::cpp_regex_traits<char>::length (p=0x401498 "\"http:\\\\/\\\\/localhostr.com\\\\/files\\\\/.+?\"")
at /var/fpwork/boost/include/boost/regex/v4/cpp_regex_traits.hpp:876
#3 0x000000000040131c in boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign (this=0x7fffc48312a0,
p=0x401498 "\"http:\\\\/\\\\/localhostr.com\\\\/files\\\\/.+?\"", f=0) at /var/fpwork/boost/include/boost/regex/v4/basic_regex.hpp:364
@skyscribe
skyscribe / set_man.bash
Created November 28, 2012 12:03
set colorful manpage variables
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;37m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
@skyscribe
skyscribe / .gitignore
Created November 27, 2012 14:35
test backtrace API on Linux/glibc
bld
@skyscribe
skyscribe / CMakeLists.txt
Created November 8, 2012 13:17
Detect stdcxx path for customized gcc installation
cmake_minimum_required(VERSION 2.6)
macro(get_link_libraries_path extra_path)
message("Actual parameter variable is:${extra_path}")
if (CMAKE_COMPILER_IS_GNUCXX)
string(REPLACE ";" ":" ${extra_path} ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
message("implicit link libraries dir:${${extra_path}}")
endif()
endmacro()
@skyscribe
skyscribe / filter.awk
Created November 3, 2012 08:58
To generate csv from text inputs
#!/usr/bin/awk -f
BEGIN{
RS="\.\s* \[[0-9]+\]";
FS="\n";
OFS=",";
}
function find_next_field_until_regex(regex, i, result){
result = "";
for (; i < NF; i++){