Thursday, December 1, 2011


stolen from here


Google Interview Questions

Some time back I interviewed with Google, and a number of other well known software development companies. I've written up a number of questions very similar to the ones I was asked, changing them enough so that I'm not breaking my NDA.

Monday, November 28, 2011

git server on non standard ssh port

Some time ago I think about how to connect to a git server if it's on non standard ssh port. This case can occurs when you make port forwarding with ssh inside your network (look at -L key in man ssh), or if you want to avoid scanning your hosts by dumb bots.

At first I think about .git/config file and how can I force git to ask server on another port. But next I realized that's not question about git it's the question about ssh. And solution was really simple - put a host description into ~/.ssh/config


Host myhost.xxxx
    user imauser
    Port 31337

Tuesday, November 8, 2011

I looked through book about writing kernel modules in Linux (actually it's in russian lang). It's oriented on x86 architecture. I fount some not so real but interesting sample with syscall from inline assmebler code and port it to arm architecture. I used codesourcery toolchain.

Some information about arm syscalls in linux. According ARM EABI one use r7 register for syscall number and swi 0 (or svc 0, codesourcery gcc generate the same code) for syscall. One can use also r0-r5 registers for 32 bit parameters (or r0...r6 for 64 bit parameters, but them must be aligned to even number of registers)

Wednesday, October 19, 2011

=) After 4 weeks while I was off from trainings I return to a climbing gym.



But geek part of me still alive) I found very useful archive of articles of the section GNSS Solutions in the InsideGNSS magazine. It's real usefull for everyone who works with GPS SDR. They have articles about theory and practice as well.

Now I have some tasks. TODO:
1) understand how to intercept a voice in android like this GSM-intercepter-speaker/microphone

2) investigate ability of implementing GPS SDR on python with GUI as reference receiver.

3) Finish book about neuro networks and start "Hacker delights"

Friday, October 7, 2011

Software Defined Receiver (SDR) for GPS

SDR it's a very popular thing today. I have one project with GPS and need reference SDR for compare. I have git repo with some

Many of them on C/C++ (not so cool to implement POC code on C/C++). But I found one on python

The main idea on python that you can use multithread application with pretty GUI with good library scipy (matrix operation, filters and many other tasty things). You cant get all this things on Octave or Scilab. If you have Matlab you need multithread toolbox aswell. It's very interesting to have tool where one can relatively simple implement his/her idea and integrate it in the current project. I need some time to investigate this project on python and maybe I'll write some more words about this. I want also reimplement my Octave sources with python. It's very interesting to have working SDR with UI and module structure to change modules from one to another (acquire module or tracking module, etc)

BTW if you have some more, plz write me few lines with email or in comments.

Sunday, September 25, 2011

Include into assembler files .h files with definitions

This very general question how to incorporate C and Assembler. Bcoz sometimes you have many C sources and headers and you need rewrite something on assembler. Everybody knows about inline assembler in gcc. But not many knows that you can write into assembler and include some of required .h files. Linux kernel has some examples, but they not easy to look. I found some good explanation on ARM site [1] and adopt it for gcc


Friday, August 26, 2011

Laptop battery status in a prompt

I found sometime ago very usefull script for showing laptop battery status in a terminal. As I dont like huge xmanagers (KDE and Gnome and...) and using fluxbox this script was real for me. But time run fast and now all acpi things are moved from procfs to sysfs. I bought used laptop on ebay and found this old script in my old hdd backup directory. Fix it for a little add bashrc sample and it's run again.


Monday, August 15, 2011

custom malloc

link for me)
http://altdevblogaday.com/2011/02/12/alternatives-to-malloc-and-new/

Wednesday, August 10, 2011

one week vacation

I spent my vacation near the Finland border, 60 km from Vyborg - Triangular lake. It's very famous place for Russian climbers. Few days in a tent with camping cooking. It was fine and I made some good ascent, I made my first 6b+ flash and some other. Not so much, but I more bouldering climber than sport routes climber. Try to solve it in next season. Dont have any pic with my on a route, add pic with my friend on 6c, he made it onsight.







Thursday, July 28, 2011

Real Signal Complex Noise (RSCN) - SNR estimation algorithm

I found one very cool article about SNR estimation in the GPS (BPSK DS-SS signals).

I implemented the RSCN algo (code in octave it may changes bcoz it's link to the my work vcs and this realisation is test, I'll stabilize the code later). The description of this algo you can find in [1, 2, 3]. The [1] is the simplest article from all others ([2, 3]). And in the [3] authors tell that this algo is very sensitive to phase. And it's pretty simple to look. For example we have GPS fronend MAX2769, 16.368Mhz is sampling freq.


Wednesday, June 29, 2011

comments

I found sometime ago that comments like an art. It's really something new. It's like a backstage of programmer mind.

Some text in russian, but it's meaningless
http://www.dataved.ru/2010/09/top-funny-source-code-comments.html

lets look =)
nika@nika-u:~/work/distros_os/linux_kernels/linux-2.6.38.y$ egrep -R "[Ff]uck" * | wc -l
31

it's like a sign on a picture from somebody genius and dont tell me that programming is not a new art. yup it's not a classical art like music or painting, but it's definitely.

Monday, June 20, 2011

Multithreaded data structures for parallel computing

Not stupid explanation. In the start a little bit boring, but then good enough... I can recommend to threads newbie.

Part 1

Part 2

Thursday, June 16, 2011

embedded libc hell

Sometimes embedded world is a real hell place. Lets look

# cd /bin/
# ./lscgroup
-sh: ./lscgroup: not found
# ls -la lscgroup
-rwxr-xr-x 1 65534 65534 23138 May 27 2011 lscgroup

wtf??? it's executable but some strange error message. Let's look deeply

# ldd ./lscgroup
.......
libc.so.0 => /lib/libc.so.0 (0x4000e000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
.......
libc.so.6 => not found (0x00000000)
.......
#

I compiled libcgroups with glibc and try to run under uClibc. I spent to investigate this issue whole day(( I dont have crosslaform with uClibc and I cant change board environment to glibc. And what we can do??? I found (my friends told me that it's the common way to solve problem like this). We can chroot into a new envornment. For example from uClibc chroot to glibc. Ok.
Download fedore core rootfs
http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/fc6-arm-root-with-gcc.tar.bz2
it contains gcc!!! very usefull sometimes when all crash with cross building. Setup NFS server, unpack arch into dir, export dir (restart NFS server and check it with the command exportfs) and mount fedore core root to the device folder. After that you must mount /dev /proc /sys into chroot environment and chroot

mount -o bind /proc/ /root_fc/proc
mount -o bind /dev/ /root_fc/dev/
mount -o bind /sys/ /root_fc/sys/
chroot /root_fc/ /bin/sh

And....

# lscgroup
cgroups can't be listed: Cgroup is not mounted
#

it's working, check with ldd that all works fine.

Monday, June 13, 2011

Wednesday, June 8, 2011

Linus and C++

Linus and C++
http://drdobbs.com/blogs/cpp/229700143


Herb Sutter: C++ Questions and Answers

http://channel9.msdn.com/Shows/Going+Deep/Herb-Sutter-C-Questions-and-Answers

Friday, May 27, 2011

выбор свободной лицензии

только студент не задумывается под какой лицензией релизить свои курсовые. достаточно толковый тред на slashdot

http://yro.slashdot.org/story/11/05/26/2225227/FSF-On-How-To-Choose-a-License