Skip to content

Instantly share code, notes, and snippets.

View aakbar5's full-sized avatar

asad akbar aakbar5

View GitHub Profile
@aakbar5
aakbar5 / enum as bitfield
Last active July 19, 2016 09:26
enum as bitfield
By default enum can't be as bitfield
typedef enum _type_ {
CAT = 0,
DOG,
UNKNOWN
} TYPE;
typedef struct _animal {
TYPE type : 2;
@aakbar5
aakbar5 / Filter lines starting with a specific keyword
Created July 19, 2016 09:28
Filter lines starting with a specific keyword
grep -Ev '^(X|Y|Z)' /path/to/your/file
-E is to use extended regular expressions.
^ matches the beginning of the line.
(X|Y|Z) means lines start with X or Y or Z.
- hardware is embedded linux
- Application is cross compiled
@aakbar5
aakbar5 / bootconsole[uart0] disabled
Created August 9, 2016 09:21
bootconsole[uart0] disabled
- linux boot hanged after showing "bootconsole[uart0] disabled".
- Make sure that boot args are having console=ttySX,115200n8
- where X in ttySX is the number of the device. It can be ttyS0, ttyS1 and so on.
@aakbar5
aakbar5 / error: couldn't mount as ext3 due to feature incompatibilities
Created August 9, 2016 09:22
error: couldn't mount as ext3 due to feature incompatibilities
- Use menuconfig to enable options in FileSystem to match filesystem of your storage device where rootfs is placed
@aakbar5
aakbar5 / error: couldn't mount because of unsupported optional features (240)
Created August 9, 2016 09:23
error: couldn't mount because of unsupported optional features (240)
- Add rootfstype=ext4 to bootargs to get rid of this
@aakbar5
aakbar5 / kernel panic
Created August 9, 2016 09:25
kernel panic
- Make sure that you got /sbin/init (A bash script) onto your rootfs.
- Make sure that /sbin/init is placed after chmod +x.
@aakbar5
aakbar5 / Check shared library dependencies of a program executable
Last active August 11, 2016 11:09
Check shared library dependencies of a program executable
objdump -p /path/to/program | grep NEEDED
ref: http://ask.xmodulo.com/check-library-dependency-program-process-linux.html
@aakbar5
aakbar5 / Mount ssh folder
Last active December 7, 2016 10:22
Mount ssh folder
on local host install sshfs via sudo apt-get install sshfs
mkdir /folder/on/local/machine/used/for/mounting
sshfs <user-name>@<machine-name>:/<path/to/folder/to/be/mounted> /folder/on/local/machine/used/for/mounting
@aakbar5
aakbar5 / Ubuntu 14.04 sound problem
Created December 7, 2016 10:47
Ubuntu 14.04 sound problem
Problem: Ubuntu 14.04 was playing noise alonwith mp3 file.
Solution: Add 'options snd-hda-intel vid=8086 pid=8ca0 snoop=0' at the end of file /etc/modprobe.d/alsa-base.conf.