Sungju's Slow Life

Personal journal


  • vmware-tools installation failure in Fedora 18?

    If you are failing installing vmware-tools in Fedora 18 with the following message, it might be caused of the changes in Fedora 18 kernel-revel package. The path “” is not a valid path to the …. Here’s the simple command that will resolve the issue. It also works for latest Fedora 17 issue. $ cp… Continue reading

  • Use colours in your Mac terminal

    To use colours in your Mac terminal, you just need to put below in your ~/.bash_profile export CLICOLOR=1 export LSCOLORS=ExFxBxDxCxegedabagacad export GREP_OPTIONS=’–color=auto’ alias ls=’ls -GFh’ For the vim, below would be work by put in ~/.vimrc set nocompatible ” must be the first line set tabstop=4 shiftwidth=4 softtabstop=4 filetype on filetype indent on filetype plugin… Continue reading

  • Installing RHEV Hypervisor on VMWare Fusion

    If you are interested in Red Hat Virtualization and couldn’t afford to buy machines for the hypervisor, using VMWare would be one possible cheaper way to achieve it. By using nested virtualisation technology, you can easily build an environment. Only thing you need to before the installation is making some changes in the vmx file… Continue reading

  • Tracing a function with jprobes

    One problem with kprobes is that you can’t check validity of the arguments passed to the function you are monitoring. For that matter, jprobes comes in. It’s basically make a wrapper for the existing function and will be called instead without make any changes to the existing function. jprobes is an extention to the kprobes… Continue reading

  • Tracing an instruction or a function with kprobes

    As the kernel is running on top of all other services, it’s hard to debug it in a live system. You can use ‘gdb’ on a live system, but you only can check the current values of some exported symbols. You can’t use breakpoint on a running kernel. If you set a breakpoint, it’ll stop… Continue reading

  • Extending SysRq

    Basics about SysRq During the kernel debugging, you can use SysRq to get some details about the system status at some point or to execute some commands without typing the command. We can use one of the below method to trigger the operation. Method 1. $ echo 1 > /proc/sys/kernel/sysrq Press ‘Alt-SysRq-[key]’ combination to trigger… Continue reading

  • Check IP address of a virtual guest

    There’s a time you want to check virtual guest’s IP, but no way to access the machine as you only have text terminal. You can retrieve IP address by using the following script. #!/bin/bash macaddress=`virsh dumpxml $1 | grep “mac address” | awk ‘BEGIN { FS = “=” }; {print $2}’ | sed ‘s//>/ /’`… Continue reading

  • How to keep record the commands executed by root

    If you want to keep record of the commands executed by root account, you can achieve that by using audit rules. First, add the below line in /etc/audit/audit.rules -a entry,always -S execve -F uid=0 And restart auditd to apply the changes $ chkconfig auditd on $ service auditd restart Continue reading

  • How many threads are in the system

    If you want to check how many threads are in the system to compare it with the maximum allowed threads by the system (kernel.threads-max), you can use one of the below two methods. $ cat /proc/loadavg 0.74 0.93 1.04 3/393 31977 4th column in the above output is related to the current threads number. In… Continue reading

  • How to build a module with source codes in separate directories.

    If you want to use separate directories for source files and target modules, you can use below scheme. mod_main.c #include #include MODULE_LICENSE(“GPL”); static int __init mod_entry(void) { return 0; } static void __exit mod_exit(void) { return; } module_init(mod_entry); module_exit(mod_exit); sub_mod.c #include #include int sub_func(int i) { printk(“Hello %d”, i); return 0; } EXPORT_SYMBOL(sub_func); Makefile… Continue reading

  • Check how much is used up by a specific user

    You can use below command to check how much space is consumed by a specific user (‘testuser’ in this case). $ cd / $ find . -user testuser -type f -exec du -k {} ; | awk ‘{ s = s + $1 } END { print “Total used: “, s }’ Total used: 5322333… Continue reading

  • How to debug an application

    If you want to debug an application that is shipped with the fedora, you can use the following command. [root@localhost ~]# debuginfo-install gedit-3.4.2-1.fc17.x86_64 Loaded plugins: langpacks, presto, refresh-packagekit enabling fedora-debuginfo enabling updates-debuginfo –> Running transaction check —> Package atk-debuginfo.x86_64 0:2.4.0-1.fc17 will be installed —> Package cairo-debuginfo.x86_64 0:1.10.2-7.fc17 will be installed —> Package enchant-debuginfo.x86_64 1:1.6.0-4.fc17 will… Continue reading

About Me

A software engineer who loves any technologies that makes life easier. That’s why I love Linux and Mac at the same time.