selfjungle Just another WordPress weblog

24Mar/150

generic linux youcompleteme install

# install vundle[1]
mkdir -p ~/.vim/bundle
cd  ~/.vim/bundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# edit your ~/.vimrc [2]
# open vim, and enter :PluginInstall
# YCM will be pulled but not installed:
cd ~
mkdir ycm_build
cd ycm_build
cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp -DUSE_SYSTEM_BOOST=ON -DUSE_SYSTEM_LIBCLANG=ON
make ycm_support_libs

# edit your global ~/.vim/.ycm_extra_conf.py [3]

[1] vundle: https://github.com/gmarik/Vundle.vim
[2] https://gist.github.com/cs0rbagomba/a06452fe7bd50cb39c8f
[3] https://gist.github.com/cs0rbagomba/49ded0d74042e95d74d1

Original YCM guide: https://github.com/Valloric/YouCompleteMe#full-installation-guide

Filed under: Uncategorized No Comments
20Mar/150

gdb command line history

edit ~/.gdbinit and add:

set history save
set history filename ~/.gdb_history
Filed under: Uncategorized No Comments
18Mar/150

gcov

# usual gcov run:
rm -rf COVERAGE_DIR && mkdir COVERAGE_DIR
lcov --directory BUILD_DIR -z
RUN_EXECUTABLE
lcov --directory BUILD_DIR --capture -b SOURCE_DIR -o lcov.info
genhtml --frames --legend -o COVERAGE_DIR lcov.info


# gcc  & gcov version mismatch:
geninfo: ERROR: PATH/FILE.gcno: reached unexpected end of file

# executable and *.gcda files are created in the different build runs
# graph file has been compiled again after binaries built.
Processing FILE.gcda
PATH/FILE.gcda:stamp mismatch with graph file

$ hexdump -e '"%x\n"' -s8 -n4 myclass.gcda
7ef26ee7
$ hexdump -e '"%x\n"' -s8 -n4 myclass.gcno
7ef26ee7

Filed under: Uncategorized No Comments
13Mar/150

format drive

parted -a optimal DEV
  rm NUM
  mkpart primary 0 -1
  set 1 boot on
  quit

mkfs.ext3 DEV1
Filed under: Uncategorized No Comments
11Mar/150

nvidia libGL trouble

if
ldd $(which glxinfo)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f3dd494f000)

instead of
ldd $(which glxinfo)
libGL.so.1 => /usr/lib64/opengl/nvidia/lib/libGL.so.1 (0x00007f2fbc62a000)

then
rm /usr/lib/libGL.so.1.2.0
ln -s /usr/lib64/opengl/nvidia/lib/libGL.so.1 /usr/lib/libGL.so.1.2.0

Filed under: Uncategorized No Comments
10Mar/150

sytem information/monitoring

# sys-apps/pciutils
lspci -k

# app-admin/sysstat
iostat -dm 2

# sys-process/htop
htop

# sys-apps/util-linux
lsblk

# sys-apps/usbutils
lsusb -v

# sys-process/iotop
iotop -o

#sys-power/acpi
acpi

# app-admin/mcelog

emerge -avq sys-apps/pciutils app-admin/sysstat sys-process/htop sys-apps/util-linux sys-apps/usbutils sys-process/iotop sys-power/acpi
Tagged as: No Comments
2Mar/150

intel 7265 wifi, iwlwifi and systemd

compile your kernel to support:
CONFIG_IWLWIFI=y
CONFIG_IWLMVM=y

# check which firmware version suits your kernel [1]
emerge -av iwl7265-ucode iw wpa_supplicant
# or maybe not. If your kernel want's another version, (see dmesg) (3.19 wanded the D: iwlfiwi-7265D.12.ucode) just download the correct version, unpack and move the ucode file to /usr/lib/firmware

# iwconfig is deprecated, use iw to check the wifi iface
iw dev
# ... interface wlp2p0

# manual:
wpa_supplicant -B -i wlp2p0 -c /etc/wpa_supplicant/wpa_supplicant.conf
dhcpcd wlp2p0

# or by systemd. Do not enable wpa_supplicant, it will be started by dhcpcd
#systemctl enable wpa_supplicant@wlp2p0
cat "env wpa_supplicant_driver=nl80211" >> /etc/dhcpcd.conf
systemctl enable dhcpcp@wlp2p0

# my wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1
network={
ssid="MY ESSID"
psk="MY PASS"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

[1] https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi

Tagged as: No Comments
1Mar/150

update gentoo

emerge --update --newuse --deep --with-bdeps=y @world -av
emerge --depclean -av
emerge @preserved-rebuild -av
perl-cleaner --all
python-updater
revdep-rebuild -pv
rm -rf /usr/share/man/??
rm -rf /usr/share/man/??_*
eix-test-obsolete
glsa-check -t all

https://wiki.gentoo.org/wiki/Gentoo_Cheat_Sheet

Tagged as: No Comments
1Mar/150

migrating from openrc to systemd

# remove blocking package, systemd provides the functionality.
emerge -C sys-fs/udev openrc netifrc virtual/service-manager sysvinit
# comment out service manager and openrc from your @system set, defined in /usr/portage/profiles/base/packages 

# add systemd to use flags
emerge -av systemd
emerge -av virtual/udev virtual/libudev

# set kernel options& recompile
Gentoo Linux --->
  Support for init systems, system and service managers --->
    [*] systemd


# to kernel command line:
init=/usr/lib/systemd/systemd

hostnamectl set-hostname 
cat /etc/locale.conf
# LANG="en_US"
localectl set-locale LANG=en_US
localectl set-keymap us


http://wiki.gentoo.org/wiki/Systemd

http://forums.gentoo.org/viewtopic-p-7656898.html

Tagged as: No Comments
28Feb/150

install gentoo from liveCD

suppose we booted up for a liveCD/USB

#mount the destination device, DEV
mount DEV /mnt/gentoo
cd /mnt/gentoo
wget http://mirror.mdfnet.se/gentoo/releases/amd64/autobuilds/current-stage3-amd64-nomultilib/stage3-amd64-20150226.tar.bz2
tar xjpf stage3*

cd /
mount -t proc proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
mount --rbind /sys /mnt/gentoo/sys
cp -L /etc/resolv.conf /mnt/gentoo/etc/ 
chroot /mnt/gentoo /bin/bash
source /etc/profile
emerge-webrsync

eselect profile list
passwd

#timezone
cp /usr/share/zoneinfo/Europe/Oslo /etc/localtime
echo "Europe/Oslo" > /etc/timezone
emerge --config timezone-data

# glibc will generate lang files according to:
nano locale.gen
locale-gen
eselect locale list

# check /etc/fstab
Tagged as: No Comments