loadYOURSELF

loadYOURSELF

Browsing Posts in Tip

I am generally writing linux drivers for embedded systems for three years, and I am using this sample driver interface for the startup. In this blog entry I will give steps for sample linux driver implementation and sample files.
First of all we need a “mydriver.h” for header definitions,

#ifndef __LOADYOURSELF_MYDRIVER__
#define __LOADYOURSELF_MYDRIVER__

///@file mydriver.h
///@brief mydriver header file for mydriver.

#ifndef __KERNEL__
# define __KERNEL__
#endif
#ifndef MODULE
# define MODULE
#endif

Default wordpress category listing in the right bar doesn’t show categories’ items count.

Categories Without Numbers
Categories Without Numbers

To see how many elements which the category has, there is a solution for that via php code editing of wordpress files.

First of all you have to connect your web site (with your ftp browser or another web based file editing system). And find the file named classes.php under the wp-includes folder. Download this file and open with an editor (ex. wordpad). Find the line

First change ls commands color attribute to auto

alias ls=’ls –color=auto’

then add this to /$HOME/.bashrc

then create a file /$HOME/.dircolors

extract this to that file (which must be one line after export command there is a space)

export LS_COLORS=”no=00:fi=00:di=01;35:ln=01;36:pi=40;33:so=01;35:do=01;35:

bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:

tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:

*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:

*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:

*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:

*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:

*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:

*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:

*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:

*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:

*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:

*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:

*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:”

Some definitions for abbreviations

Needed program:
Iptables

PC 1

system gateway = 192.168.2.1 (eth1)

Eth1: (connected to internet with configuration) 192.168.2.2 netmask 255.255.255.0

Eth0: (other PC connected to this port) 192.168.1.1 netmask 255.255.255.0  (with cross cable maybe)

other PC configuration : 192.168.1.2 netmask 255.255.255.0 gateway 192.168.1.1 dns 192.168.1.1

If system is configured to start with defined script below then second PC can be access to internet if it’s network address equals to 192.168.1.x and gateway is 192.168.1.1 and dns is 192.168.1.1

you can use watch command directly like this
watch –interval=1 “ps aux|grep xinetd”
to watch xinetd at a 1 second interval.
or you can define a script like this,
vi /bin/wh
press i to enter insert mode. And write

watch –interval=1 $1

then write :wq to save file
change executable attribute with chmod 755 /bin/wh
use it like this

wh “ps uax|grep xinetd”

Buy me a beer

Assign new ip =   ifconfig eth0 192.168.1.10

Assign IP/Subnet =  ifconfig eth0 192.168.1.10 netmask 255.255.255.0

Assign Default Gateway=  route add default gw 192.168.1.1

Assign multiple IP’s =  ifconfig eth0:0 192.168.1.10 netmask 255.255.255.0

Assign second IP =  ifconfig eth0:1 10.1.10.20 netmask 255.255.0.0

Buy me a beer

vi ~/testdoc
<now editing in vi>

[esc] :%!xxd

Buy me a beer

ata2.01: qc timeout (cmd 0xa0)
ata2.01: exception Emask 0×0 SAct 0×0 SErr 0×0 action 0×2 frozen
ata2.01: cmd a0/00:00:00:00:20/00:00:00:00:00/b0 tag 0 cdb 0×25 data 8 in
res 51/20:03:00:00:00/00:00:00:00:00/b0 Emask 0×5 (timeout)
ata2: port is slow to respond, please be patient (Status 0xd1)
ata2: device not ready (errno=-16), forcing hardreset
ata2: soft resetting port
ata2.00: configured for UDMA/100
ata2.01: configured for UDMA/33

ata2: EH pending after completion, repeating EH (cnt=4)
ata2: EH complete
sd 1:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA
sd 1:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA

ata2.01: qc timeout (cmd 0xa0)
ata2.01: exception Emask 0×0 SAct 0×0 SErr 0×0 action 0×2 frozen
ata2.01: cmd a0/00:00:00:00:20/00:00:00:00:00/b0 tag 0 cdb 0×25 data 8 in
res 51/20:03:00:00:00/00:00:00:00:00/b0 Emask 0×5 (timeout)
ata2: port is slow to respond, please be patient (Status 0xd1)
ata2: device not ready (errno=-16), forcing hardreset
ata2: soft resetting port
ata2.00: configured for UDMA/100
ata2.01: configured for UDMA/33
ata2: EH pending after completion, repeating EH (cnt=4)
ata2: EH completesd 1:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA
sd 1:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA