Skip to content

Instantly share code, notes, and snippets.

View Shengliang's full-sized avatar

Shengliang Song Shengliang

  • ByteDance
  • Fremont, CA
View GitHub Profile
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 2
# Now, you can easily switch to any version with the following commands.
sudo update-alternatives --config python
https://blog.jcole.us/innodb/
Flame graphs are a visualization of profiled software, allowing the most frequent code-paths
to be identified quickly and accurately.
http://www.brendangregg.com/Slides/LISA13_Flame_Graphs.pdf
http://www.brendangregg.com/flamegraphs.html
git clone https://github.com/brendangregg/FlameGraph.git
# example 1
https://gorails.com/setup/osx/10.12-sierra
git clone https://github.com/Shengliang/rails.git
cd rails
git remote -v
git remote add upstream https://github.com/rails/rails.git
git remote -v
git fetch upstream
export EDITOR=vim
git rebase -i upstream/master
yum commands:
yum info package-name
yum install package-name
rpm -ql package-name
yum search libudev
g++
From https://gist.github.com/craigminihan/b23c06afd9073ec32e0c
153 g++ --version
# Ref: https://www.unixmen.com/how-to-enable-core-dumps-in-rhel6/
# sudo vi /etc/security/limits.conf
#* soft core 0
* soft core unlimited
# sudo vi /etc/sysctl.conf
kernel.core_pattern = /tmp/core-%e-%s-%u-%g-%p-%t
Source Code of the Programs in The Linux Programming Interface
http://man7.org/tlpi/code/index.html
@Shengliang
Shengliang / gdbinit
Created January 20, 2017 17:46 — forked from CocoaBeans/gdbinit
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
//Ref: http://www.slideshare.net/gkumar007/bits-next-higher-presentation
/*
x CAFE01F0
-x 3501FE10
smallest:x &-x 00000010
ripple:x+ (x&-x) CAFE0200