Posts

Setting up a new mac

I finally updated my Mac, which means I need to do some setup that I haven't had to bother with in like five years. I'm collecting my notes here, in case I have to set yet another Mac in five years or less. Emacs I used to have carbon emacs or even Aquamacs in the past. But now emacs for Mac seems to live in  GNU Emacs For Mac OS X . Emacs keyboard And with scandinavian keyboard, there's always a bit of a hassle to get things right: osx - How can I write braces, { and }, in Emacs on Mac OS X with a ... (setq mac-option-modifier nil mac-command-modifier 'meta x-select-enable-clipboard t) Emacs and cscope Install the tool from macports and setup emacs: (add-to-list 'load-path "/opt/local/share/emacs/site-lisp") (custom-set-variables  ;; custom-set-variables was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If the...

OS X IP alias

To avoid reconfiguring interfaces for repeated router setups, decided to find out how to add an IP alias in Mac OS X: sudo ifconfig en1 alias 192.168.1.195 netmask 255.255.255.0 aplawrence.com

gdb tricks

Excellent gdb examples at ksplice.com blog. gdb --args directory set substitute path -ggdb3 to gdb optimized debug symbols; macro expand

Linux SPI

My notes while reading about Linux and SPI. De facto - no standardization like i2c/smbus. Master/slave like i2c Faster clock 10MHz vs 400kHz i2c Full duplex, unlike i2c. Daisy chaining (in addition to / instead of) wired-AND bus like i2c. Dedicated chip select signals instead of i2c addressing. Linux software support only applies to master side, like i2c. Four clocking modes (?) - CPOL - clock starts low(0)/high(1) - CPHA - sample data on leading(0)/trailing(1) edge Signals - SCK - clock, idle when not used like in i2c - MOSI: Master Out, Slave In - MISO: Master In, Slave Out - nCSx: Chip select(s) - device specific signals Generally no interoperability above bit-level - word lengths vary. - endianness varies - no discovery or enumeration mechanism Subsets - MicroWire: half duplex - Synchronous serial protocl SSP - Programmable serial protocol PSP - three wire SPI with single data signal MOMI/SISO SPI slave chips - DataFlash driver name - probed based spi_board_info associated to spi...

Filter selection through pipe in Emacs

Emacs has this wonderful feature of filtering a selection through a unix pipe. It's just a bit hard to remember how to invoke. C-u M-| command RET

RPM cheat sheet

list installed packages, dpkg -l rpm -qa info on an installed package, dpkg -s rpm -qi contents of an installed package, dpkg -L rpm -q -l package where a file belongs to, dpkg -S rpm -q -f extract package contents without installing, dpkg -x rpm2cpio file.rpm | cpio -idv

debugging makefile variables

To debug makefile variable assigments. Use make -p (--print-data-base) to see which values get assigned to variables and where. Need to add to reading list: Managing projects with GNU make.