Skip to content

Instantly share code, notes, and snippets.

Masanori Ogino omasanori

Block or report user

Report or block omasanori

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View launch-tmux.sh
if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ] && [[ $- =~ i ]]; then
tmux attach-session -t "$USER-ssh" 2> /dev/null || tmux new-session -s "$USER-ssh" || exit $?
exit
fi
@omasanori
omasanori / cpuinfo-after.log
Created Feb 24, 2019
Comparing the content of /proc/cpuinfo with Debian 9 and Coreboot 1f83e9d592f6be5a4fc36c7d21ae1410a2fbbdfe on ThinkPad X60s before and after installing intel-microcode package.
View cpuinfo-after.log
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Genuine Intel(R) CPU U1300 @ 1.06GHz
stepping : 8
microcode : 0x39
cpu MHz : 800.000
cache size : 2048 KB
physical id : 0
@omasanori
omasanori / monitor_temp.py
Last active Jun 22, 2018
Monitor the temparture of processors on Linux
View monitor_temp.py
#!/usr/bin/env python3
def get_temp(socket_id):
thermal_zone = '/sys/class/thermal/thermal_zone' + socket_id
with open(thermal_zone + '/temp') as temp:
return int(temp.read()) / 1000.0 # + 273.15
if __name__ == '__main__':
import json
import sys
@omasanori
omasanori / alibuild.log
Created Jul 10, 2017
Building Configuration with flpproto fails on CC7 when libcurl-devel is not installed
View alibuild.log
aliBuild can take the following packages from the system and will not build them:
FreeType
The following packages cannot be taken from the system and will be built:
Python-modules, sqlite, CMake, protobuf, Python, GCC-Toolchain, nanomsg, libpng, ZeroMQ, autotools, boost, GSL
Packages will be built in the following order:
- defaults-o2-daq@v1
- autotools@v1.5.0
- sqlite@v3.15.0
- GCC-Toolchain@v6.2.0-alice1
- ZeroMQ@v4.1.5
View test.tex
\documentclass[unicode]{beamer}
\usepackage[no-math,ipaex]{luatexja-preset}
\renewcommand{\kanjifamilydefault}{\gtdefault}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\begin{document}
View REPORT.txt
src/api/fcntl.c: In function 'f':
src/api/fcntl.c:30:3: error: 'O_TTY_INIT' undeclared (first use in this function)
C(O_TTY_INIT)
^
src/api/fcntl.c:5:21: note: in definition of macro 'C'
#define C(n) switch(n){case n:;}
^
src/api/fcntl.c:30:3: note: each undeclared identifier is reported only once for each function it appears in
C(O_TTY_INIT)
^
@omasanori
omasanori / predef.sh
Last active Mar 31, 2016
An utility to check the name of predefined preprocessor macros and their values.
View predef.sh
echo | gcc -E -xc -dM - | sort | uniq
View should-this-ulgy-cast-be-punished-or-not.log
$ gcc --version | head -n1
gcc (Gentoo 4.9.3 p1.2, pie-0.6.3) 4.9.3
$ gcc -dumpmachine
x86_64-pc-linux-gnu
$ clang --version | head -n1
clang version 3.7.1 (tags/RELEASE_371/final)
$ clang -dumpmachine
x86_64-pc-linux-gnu
$ cat > test.c
#include <stdio.h>
@omasanori
omasanori / x86_64-gentoo-linux-musl.log
Last active Mar 9, 2016
An experiment for the size of hello world.
View x86_64-gentoo-linux-musl.log
$ gcc --version | head -n1
gcc (Gentoo Hardened 4.9.3-r99 p1.2, pie-0.6.3) 4.9.3
$ gcc -dumpmachine
x86_64-gentoo-linux-musl
$ cat hello.c
#include <stdio.h>
int main(void)
{
puts("hello, world");
return 0;
View error.log
top: 30
before: 30
top: #<proc 0x7feb29328de0>
before: #<proc 0x7feb29328de0>
top: #<proc 0x7feb29328a20>
before: #<proc 0x7feb29328a20>
top: #<proc 0x7feb2932baf8>
before: #<proc 0x7feb2932baf8>
top: #<proc 0x7feb2932b738>
before: #<proc 0x7feb2932b738>
You can’t perform that action at this time.