thalib.in

Linux

How to Add Audio sound card support in Android

- This notes explains how to add audio sound card support in Android OS. It is assued that you have a working ALSA driver for your sound card and it is getting listed as a alsa sound card. Here is the output of registed card in a IMX6 SBC. # cat /proc/asound/cards 0 [imxaudiobtlsr ]: imx-audio-btlsr - imx-audio-btlsr imx-audio-btlsr 1 [wm8750audio ]: wm8750-audio - wm8750-audio wm8750-audio 2 [imxhdmisoc ]: imx-hdmi-soc - imx-hdmi-soc imx-hdmi-soc My aim is to integrate the wm8750audio sound card with Android OS and get it working. Read More


My bash prompt

- I used below entry in ~/.bashrc file PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u @ \h\[\033[0;36m\]\[\e[1;91m\]$(__git_ps1)\[\033[0;32m\] \[\033[0;36m\][\w]\n\[\033[0;32m\] └─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] ' The output is simiplar to below, inside the bracket is the branch name and followed by the current path. mohamed @ turnip (master) [~/project/vagrant] └─ $ ▶ Read More


Calculate the size of directory in Linux

- Here is simple bash script to find how much size a directory take in the hard drive. Here we combine simple bash for loop with ls and du command to compute the size. for i in `ls`; do du -sh $i done Read More


How To create a image from Linux commandline

- Linux provides an convert command to add any text on an image. In order to use this command you need to install ImageMagick package on your system. To create a image with a white background: convert -size 640x480 xc:white empty.jpg Here the size of the imge is specified using -size To create a 32x32 image with a transparent background: convert -size 32x32 xc:transparent empty.jpg Add Text to image convert -pointsize 20 -fill blue -draw 'text 200,460 "Here is the TEXT"' empty. Read More


Building GCC toolchain for PowerPC

- Building GCC toolchain for PowerPC Download the latest sources from ftp://ftp.gnu.org . I tested the build with binutils-2.14, gcc-3.3.2, glibc-2.3.2, glibc-linuxthreads-2.3.2 and (optionally gdb-6.0). Binutils As most of the sites suggest, start by building the toolchain in separate directories from where you downloaded and unzipped the sources. So, I do build-binutils, build-gcc and so on… Also, you can specify the PATH you want the cross-compiled binaries to go with –prefix option. Read More


Creating target images (ramdsik, ext2 image, cramfs, dtb)

- Working with Uncompressed image Mounting via ramdisk: mkdir mnt cat init-ramdisk-2-35 > /dev/ram1 mount /dev/ram1 mnt Or via loopback: mount -o loop init-ramdisk-2-35 mnt Working with ext2 Image Creating a new ext2 filesystem image # dd if=/dev/zero of=init-ramdisk.img bs=1k count=8k # mke2fs -i 1024 -b 1024 -m 3 -F -v init-ramdisk.img # mkdir temp # mount -o loop init-ramdisk.img temp # cd temp # (Do what you need to do. Read More


Enabling IPv4 Forwarding

- Enable IP forwarding, using /proc entry echo 1 > /proc/sys/net/ipv4/ip_forward Set the IP address ifconfig lo 127.0.0.1 netmask 255.0.0.0 ifconfig eth0 10.1.1.1 netmask 255.255.255.0 up ifconfig eth1 10.1.2.1 netmask 255.255.255.0 up Read More


How to Create Live CD

- Below is the steps to create live cd $ mkisofs -o /tmp/bootcd.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 8 -boot-info-table . Test the image with emulator $ qemu -cdrom /tmp/bootcd.iso -serial stdio Read More


How to Creating a GRUB boot floppy

- To create a GRUB boot floppy, you need to take the files stage1 and stage2 from the image directory, and write them to the first and the second block of the floppy disk, respectively. Caution: This procedure will destroy any data currently stored on the floppy. On a UNIX-like operating system, that is done with the following commands: # cd /usr/lib/grub/i386-pc # dd if=stage1 of=/dev/fd0 bs=512 count=1 1+0 records in 1+0 records out # dd if=stage2 of=/dev/fd0 bs=512 seek=1 153+1 records in 153+1 records out Read More