童童爸的博客

爱老婆,爱童童,爱编程

爸爸的可爱Baby日记

永久链接

2011-12-14 Day 1

今天你从妈妈的肚子里出来了,你的眼睛真漂亮啊,刚出来就看着粑粑,虽然我们只见面了几分钟,但是这几分钟我印象深刻 你看了几眼爸爸,然后就将眼转到别的地方去了,是害羞了么?你还要在婴儿室呆几天,这些日子粑粑是多么担心你啊。

2011-12-23 Day 10

最近几天你老是晚上有精神,白天呼呼睡大觉。是不是诚心折腾巴巴妈妈啊。你妈妈还在作月子,不要折腾你麻麻了。你已经学会了 用小手抓奶瓶了,真聪明。早上给你听音乐,你的小脑袋还摇晃,喜欢啊。哈哈

2012-01-02 Day ?

今天你笑的时候发出咯咯的声音,把爸爸逗乐了。小丫头越来越漂亮了,越来越像我了,以后不要老折腾啊。 长大后,要像你爸爸,多读书,多掌握知识,别像你妈妈,不爱读书啊。

??-??-?? ??

出疹子了,

2012-08-05 Month 7

这周回家礼拜六9点睡着了, 睡了一会你又醒了, 然后就闹闹, 不睡啊… 爸爸把你放在爸爸肚子上,让你向床上扑啊.. 那个爽啊 十二点也不睡,后来必须要抱着你, 你坐着都不乐意, 哭, 后来爸爸怕了, 抱着你半天你睡着了, 宝宝千万别得病啊…爸爸爱你. 这周你学会再见了,晃着小手

童童的笑容

以后给你看这些:

  • 朵拉
  • 米奇妙妙屋
  • 天线宝宝
  • 巴布工程师
  • 花园宝宝
  • 巧虎

Linux记录

永久链接

问题

  • xfce的图标快捷方式的proxy不能用.zshrc的,需要在.xinitrc中定义。狗血。。。
  • wget只改singleuser是否可以?

常用命令

  • usermod -a -G ftp tony

samba

sudo mount //localhost/public /mnt/tmp -o users=jinleileiking, /etc/samba/smb.conf中的public会变成public

让terminator不滚动

取消scroll on output

sshd & mount

sshd_config一定submodule用 internal-sftp. 就好使了.

It’s ChrootDirectory ownership problem, sshd will reject sftp connections to accounts that are set to chroot into any directory that has ownership/permissions that sshd doesn’t consider secure. sshd’s apparently strict ownership/permissions requirements dictate that every directory in the chroot path must be owned by root and only writable for the owner. So, for example, if the chroot environment is in a user’s home directory both /home and /home/username must be owned by root and have permissions along the lines of 755 or 750 ( group ownership should allow user to access ).

sudo mount -t ntfs -o uid=0,gid=1002,umask=0022 /dev/sda5 /home/ssh/base

好长时间不好使, 我把/etc/fstab去掉自动mount, 我自动mount是rw的,就好使了

1
2
sudo mount -t ntfs -o uid=0,gid=100,umask=0022 /dev/sda5 /mnt/share
sudo mount --bind -o uid=0,gid=100,umask=0022 /mnt/share/movie /home/ssh/base

cdrom 相关

  • 没有/dev/cdrom:

rm /etc/udev/rules.d/70-persistent-cd.rules

  • mount 显示 no media

把盘放进去就可以了…!! 怎么打开? eject /dev/cdrom

sudo mount -t iso9660 /dev/cdrom /mnt/tmp

  • cdrom -> iso

dd if=/dev/cdrom of=./1.iso

设置时间

  • 设置硬件时间clock –set –date=”07/05/12 11:22”
  • 硬件时间 同步到 系统时间 sudo hwclock –hctosys

free 缓存

  • echo 3 > /proc/sys/vm/drop_caches # free ..

windows时间和linux时间不一致.

  • gentoo 用的是utc时间, windows用的local
  • gentoo 改
1
2
3
/etc/conf.d/hwclock 
"UTC" -> "local"
/etc/init.d/hwclock restart

vbox

  • vbox ctrl+cv 原因是没有加入vbox组

  • 扩大vbox分区:

VBoxManage modifyhd xxx.vdi –resize 40000

用gentoodisk启动

fdisk 改分区大小

resize2fs…. done… so easy

linux访问共享的win文件夹

  • sudo mount -t vboxsf d_drive /mnt/win7, 犯了个错误,vboxfs…..

nfs

/etc/init.d/rpcbind start ip 地址别错了.. mount -v -t nfs 192.168.1.102:/c/Codes /mnt/tmp 如果显示超时,关闭windows防火墙,fuck!!!

查找大文件夹

du -s * | sort -nr | head

安装haskell的pandoc

首先编译遇到内存溢出问题, 是ghc7.4.1以前有bug,用7.4.1能编过.

然后遇到说network依赖的ghc版本不对的问题,pasace 用3 network用2. 这个执行haskell-updater, unmask安装不成功的package就可以.

然后遇到latex问题,报错,装了texlive-fontsrecommands也不好使.中文乱码.

然后原来需要xelex, 且指定中文名.

pandoc srs.md -o srs.pdf --latex-engine=xelatex -V mainfont=WenQuanYi\ Micro\ Hei\ Mono

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
➜  r2000 git:(master) ✗ eix ghc -I       
[I] dev-lang/ghc
     Available versions:  (~)6.10.4-r1 6.12.3 6.12.3-r2 (~)7.0.4 (~)7.4.1 (~)7.4.1-r1 {bash-completion binary doc ghcbootstrap llvm}
     Installed versions:  7.4.1-r1(10:52:48 PM 07/29/2012)(-binary -doc -ghcbootstrap -llvm)
     Homepage:            http://www.haskell.org/ghc/
     Description:         The Glasgow Haskell Compiler

➜  r2000 git:(master) ✗ eix pandoc -I
[I] app-text/pandoc
     Available versions:  (~)1.8.1.1-r1!t ~1.9.1.2 ~1.9.2 ~1.9.3 (~)1.9.4.1-r2!t {doc highlight hscolour pdf profile test}
     Installed versions:  1.9.4.1-r2!t(05:04:51 PM 08/01/2012)(-doc -hscolour -profile -test)
     Homepage:            http://johnmacfarlane.net/pandoc
     Description:         Conversion between markup formats

[D] dev-haskell/pandoc-types
     Available versions:  (~)1.8 ~1.9.1 {doc hscolour profile}
     Installed versions:  1.9.1(10:39:31 AM 07/30/2012)(-doc -hscolour -profile)
     Homepage:            http://johnmacfarlane.net/pandoc
     Description:         Types for representing a structured document

Found 2 matches.
➜  r2000 git:(master) ✗ eix texlive -I
[I] app-text/texlive-core
     Available versions:  2011-r6 ~2011-r7 ~2012 {X cjk doc source tk xetex}
     Installed versions:  2011-r6(09:18:07 PM 08/01/2012)(X xetex -cjk -doc -source -tk)
     Homepage:            http://tug.org/texlive/
     Description:         A complete TeX distribution

[I] dev-texlive/texlive-basic
     Available versions:  2011-r1 ~2012 {doc source}
     Installed versions:  2011-r1(04:03:02 PM 07/27/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Essential programs and files

[I] dev-texlive/texlive-documentation-base
     Available versions:  2011 ~2012 {source}
     Installed versions:  2011(04:02:41 PM 07/27/2012)(-source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive TeX Live documentation

[I] dev-texlive/texlive-fontsrecommended
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(06:19:48 PM 08/01/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Recommended fonts

[I] dev-texlive/texlive-fontutils
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(04:03:12 PM 07/27/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Graphics and font utilities

[I] dev-texlive/texlive-genericrecommended
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(09:18:18 PM 08/01/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Recommended generic packages

[I] dev-texlive/texlive-latex
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(04:03:28 PM 07/27/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Basic LaTeX packages

[I] dev-texlive/texlive-latexextra
     Available versions:  2011-r2 ~2012 {doc source}
     Installed versions:  2011-r2(09:30:40 PM 08/01/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive LaTeX supplementary packages

[I] dev-texlive/texlive-latexrecommended
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(04:03:53 PM 07/27/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive LaTeX recommended packages

[I] dev-texlive/texlive-mathextra
     Available versions:  2011 ~2012 ~2012-r1 {doc source}
     Installed versions:  2011(09:18:26 PM 08/01/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Advanced math typesetting

[I] dev-texlive/texlive-pictures
     Available versions:  2011 ~2011-r1 ~2012 {doc source}
     Installed versions:  2011(09:18:40 PM 08/01/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Graphics packages and programs

[I] dev-texlive/texlive-xetex
     Available versions:  2011 ~2012 {X doc source}
     Installed versions:  2011(09:30:55 PM 08/01/2012)(X -doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive XeTeX packages

Found 12 matches.
➜  r2000 git:(master) ✗ eix latex -I
[I] dev-texlive/texlive-latex
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(04:03:28 PM 07/27/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive Basic LaTeX packages

[I] dev-texlive/texlive-latexextra
     Available versions:  2011-r2 ~2012 {doc source}
     Installed versions:  2011-r2(09:30:40 PM 08/01/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive LaTeX supplementary packages

[I] dev-texlive/texlive-latexrecommended
     Available versions:  2011 ~2012 {doc source}
     Installed versions:  2011(04:03:53 PM 07/27/2012)(-doc -source)
     Homepage:            http://www.tug.org/texlive/
     Description:         TeXLive LaTeX recommended packages

[I] virtual/latex-base
     Available versions:  1.0
     Installed versions:  1.0(04:03:58 PM 07/27/2012)
     Description:         Virtual for basic LaTeX bin

startx 显示 no proctol specified

删去.Xauth 和.servauth.

批量改扩展名

1
find . -type f -name '*.JPG' -exec rename 'JPG' 'jpg' {} \;

awesome支持polkit,consolekit

If you want to use the awesome menu to let your computer restart/shutdown/hibernate/suspend, You should do this:

gentoo:

  • You MUST emerge with use +polkit +pam :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
➜  ~ git:(master) ✗ epv dbus dbus-glib pambase shadow  upower polkit awesome consolekit
zsh: correct 'dbus' to '.dbus' [nyae]? n


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-apps/dbus-1.4.20  USE="X -debug -doc (-selinux) -static-libs -test" 0 kB
[ebuild   R    ] dev-libs/dbus-glib-0.98  USE="-debug -doc -static-libs -test" 0 kB
[ebuild   R    ] x11-wm/awesome-3.4.11  USE="dbus -doc" 0 kB
[ebuild   R    ] sys-auth/polkit-0.104-r1  USE="gtk introspection nls pam -debug -doc -examples -kde (-selinux) (-systemd)" 0 kB
[ebuild   R    ] sys-auth/consolekit-0.4.5_p20120320  USE="acl pam policykit -debug -doc (-selinux) -test" 0 kB
[ebuild   R    ] sys-power/upower-0.9.16  USE="introspection -debug -doc -ios" 0 kB
[ebuild   R    ] sys-auth/pambase-20101024-r2  USE="consolekit cracklib sha512 -debug -gnome-keyring -minimal -mktemp -pam_krb5 -pam_ssh -passwdqc (-selinux)" 0 kB
[ebuild   R    ] sys-apps/shadow-4.1.4.3  USE="cracklib nls pam -audit (-selinux) -skey" 1,762 kB

Total: 8 packages (8 reinstalls), Size of downloads: 1,762 kB
  • kernel MUST enable:
1
2
3
4
5
6
➜  ~ git:(master) ✗  grep audit -i  /usr/src/linux/.config  
CONFIG_AUDIT_ARCH=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
  • .xinitrc MUST have:
1
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome >> ~/.awesome_stdout 2>> ~/.awesome_stderr
  • dbus, consolekit MUST start:
1
2
3
4
➜  ~ git:(master) ✗ rc-update
                  
           consolekit |      default                   
                 dbus |      default                 
  • following the ARCH bash style do the auto login, here is my zsh config:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
➜  ~ git:(master) ✗ cat /etc/inittab 
#
# /etc/inittab:  This file describes how the INIT process should set up
#                the system in a certain run-level.
#
# Author:  Miquel van Smoorenburg, <miquels@cistron.nl>
# Modified by:  Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>
# Modified by:  Daniel Robbins, <drobbins@gentoo.org>
# Modified by:  Martin Schlemmer, <azarah@gentoo.org>
# Modified by:  Mike Frysinger, <vapier@gentoo.org>
# Modified by:  Robin H. Johnson, <robbat2@gentoo.org>
#
# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/files/inittab-2.87,v 1.1 2010/01/08 16:55:07 williamh Exp $

# Default runlevel.
id:3:initdefault:

# System initialization, mount local filesystems, etc.
si::sysinit:/sbin/rc sysinit

# Further system initialization, brings up the boot runlevel.
rc::bootwait:/sbin/rc boot

l0:0:wait:/sbin/rc shutdown 
l0s:0:wait:/sbin/halt -dhp
l1:1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
l6r:6:wait:/sbin/reboot -dk
#z6:6:respawn:/sbin/sulogin

# new-style single-user
su0:S:wait:/sbin/rc single
su1:S:wait:/sbin/sulogin

# TERMINALS
#c1:12345:respawn:/sbin/agetty 38400 tty1 linux
c1:5:respawn:/sbin/agetty  -a jinleileiking -8 -s 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux

# SERIAL CONSOLES
#s0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100
#s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100

# What to do at the "Three Finger Salute".
ca:12345:ctrlaltdel:/sbin/shutdown -r now

# Used by /etc/init.d/xdm to control DM startup.
# Read the comments in /etc/init.d/xdm for more
# info. Do NOT remove, as this will start nothing
# extra at boot if /etc/init.d/xdm is not added
# to the "default" runlevel.
x:a:once:/etc/X11/startDM.sh



➜  ~ git:(master) ✗ cat .zprofile

# New environment setting added by Sourcery CodeBench Lite for ARM EABI on Thu Jul 05 17:04:19 CST 2012 1.
# The unmodified version of this file is saved in /home/jinleileiking/.zprofile2131715756.
# Do NOT modify these lines; they are used to uninstall.
PATH="/home/jinleileiking/crosstools/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin:${PATH}"
export PATH
# End comments by InstallAnywhere on Thu Jul 05 17:04:19 CST 2012 1.


if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
  #exec startx -- vt01
  exec startx 
  # Could use xinit instead of startx
  #exec xinit -- /usr/bin/X -nolisten tcp vt7
fi
  • Modify your rc.lua:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local upower = [[dbus-send --print-reply \
--system \
--dest=org.freedesktop.UPower \
/org/freedesktop/UPower \
org.freedesktop.UPower.]]
local consolkit = [[dbus-send --print-reply \
--system \
--dest="org.freedesktop.ConsoleKit" \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.]]

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                    { "terminal", terminal },
                                    { "chromium", shell_cmd .. "chromium"},
                                    { "lock", "slock" },
                                    { "Suspend", function() awful.util.spawn(upower.."Suspend") end },
                                    { "Hibernate", function () awful.util.spawn(upower.."Hibernate") end },
                                    { "Restart", consolkit.."Restart", icon_path.."restart.png" },
                                    { "Shutdown", consolkit.."Stop", icon_path.."poweroff.png" },
                                  }
                        })

Git

永久链接

  • (use “git rm –cached …” to unstage)

  • 目录有东西,如何clone?

1
2
3
4
5
6
cd 
git init 
git remote add origin remote_machine:~brentg/my_setup.git 
git fetch 
git branch master origin/master 
git checkout master 

git pull http master 后,git log -p -n1 显示不出区别

git log –oneline 看commit号, git diff commit号

git ls-files

S3c2410板子上跑ruby

永久链接

  • tool-chain ** armlinux.org: arm-linux-gcc 2.95.0: cpp0: 只能放在usr/local

  • busybox ** make DOSTATIC=true TARGET_ARCH=arm CROSS=arm-linux- PREFIX=../root_china all install

  • vivi net tftp 10.87.42.26 0x30008000 root_china.cramfs net flash root

  • compile ruby 192

env ac_cv_func_setpgrp_void=yes ./configure --host=arm-linux --target=arm-linux --disable-pthread --enable-shared --prefix=/home/jinleileiking/tools/embeded/ruby192

  • chown -R root:root *

Vim遇到的问题

永久链接

  • ack ** -a, –all-types All file types searched;

  • 有几个插件和输入法冲突: acp, autoclose, delimate

  • cscope
1
2
3
4
!cscope -Rbq
:cscope add cscope.out
:cs find 3 <C-R><C-W>
遇到cscope add 不成功的问题,:目录不能有空格。。。。

Plugins

ack

  • :Ack ‘Item\d’ # 这样好使。。。。。

todo

  • 怎么让不好使的插件支持中文输入法
  • vimim
  • vundle