日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

学习笔记【2010/09/20-2010/11/27】

發(fā)布時間:2023/12/15 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 学习笔记【2010/09/20-2010/11/27】 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

gdb

list 24,65 顯示24-65行代碼
list 24??? 顯示24附近10行代碼
list *1000 顯示1000地址附近10行代碼
list?????? 顯示當前行后面的源程序。
list -???? 顯示當前行前面的源程序。
list ,24?? 顯示當前行到24行代碼。
list +20?? 往后顯示20源代碼。
list +20?? 往前顯示20源代碼。
set listsize <count>??? 設置一次顯示源代碼的行數(shù)。
show listsize?????????? 查看當前l(fā)istsize的設置。
set args -l /test?????? 再run命令之前設置運行參數(shù)。
b XXX XXX可以是行數(shù)或函數(shù)名? 設置斷點
c 表示繼續(xù)運行
finish 表示結(jié)束執(zhí)行本次函數(shù)。
n 表示next 繼續(xù)下一步。
s 表示step 如果在函數(shù)出,則表示進入函數(shù),如果不在則和next意義相同。
bt 查看棧情況。
p 打印某個變量
x 顯示內(nèi)存值??

調(diào)試core文件。
gdb a.out --core=core

指定源文件的路徑
某些時候,用-g編譯過后的執(zhí)行程序中只是包括了源文件的名字,沒有路徑名。GDB提供了可以讓你指定源文件的路徑的命令,以便GDB進行搜索。
directory <dirname ... >
dir <dirname ... >
加一個源文件路徑到當前路徑的前面。如果你要指定多個路徑,UNIX下你可以使用“:”,Windows下你可以使用“;”。
directory?? 清除所有的自定義的源文件搜索路徑信息。
show directories??? 顯示定義了的源文件搜索路徑。

源代碼的內(nèi)存
你可以使用info line命令來查看源代碼在內(nèi)存中的地址。info line后面可以跟“行號”,“函數(shù)名”,“文件名:行號”,“文件名:函數(shù)名”,這個命令會打印出所指定的源碼在運行時的內(nèi)存地址,如:
(gdb) info line tst.c:func
Line 5 of "tst.c" starts at address 0x8048456 <func+6> and ends at 0x804845d <func+13>.

還有一個命令(disassemble)你可以查看源程序的當前執(zhí)行時的機器碼,這個命令會把目前內(nèi)存中的指令dump出來。

?

ip命令修改網(wǎng)卡邏輯號
ip link set dev <OLD_NAME> name <NEW_NAME>

virbr0 虛擬網(wǎng)卡卸載方法
http://wscyza.blog.51cto.com/898495/286615

xen網(wǎng)絡結(jié)構(gòu)
http://wiki.xensource.com/xenwiki/XenNetworking

/etc/xen/scripts/network-bridge stop
modprobe.conf,hwconf,ifcfg
lsmod|grep e1000e
modprobe e1000e
alias eth0 e1000e

ethtool
http://www.cublog.cn/u2/71257/showart_1001540.html

ethtool ethX????? //查詢ethX網(wǎng)口基本設置
ethtool –h??????? //顯示ethtool的命令幫助(help)
ethtool –i ethX??? //查詢ethX網(wǎng)口的相關信息
ethtool –d ethX??? //查詢ethX網(wǎng)口注冊性信息
ethtool –r ethX??? //重置ethX網(wǎng)口到自適應模式
ethtool –S ethX??? //查詢ethX網(wǎng)口收發(fā)包統(tǒng)計
ethtool –s ethX [speed 10|100|1000]/???????? //設置網(wǎng)口速率10/100/1000M
[duplex half|full]/?????????? //設置網(wǎng)口半/全雙工
[autoneg on|off]/??????????? //設置網(wǎng)口是否自協(xié)商
[port tp|aui|bnc|mii]/???????? //設置網(wǎng)口類型

/etc/rc.d/rc.inet1.conf
dmesg|grep eth0
uname -a
/etc/udev/rules.d


卸載rmmod 驅(qū)動名
redhat
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/s2-sysconfig-i18n.html


ssh vim 配色
export TERM=dtterm
下載.vimrc(:syntax enable)

http://code.google.com/p/vimcolorschemetest/

?

ethtool :
http://www.cublog.cn/u2/71257/showart_1001540.html

?

corefile:

echo "/corefile/core-%e-%p-%t" > core_pattern
proc/sys/kernel/core_pattern

core位置
http://dev.firnow.com/course/6_system/linux/Linuxjs/20090308/159805.html


ip命令修改網(wǎng)卡邏輯號
ip link set dev <OLD_NAME> name <NEW_NAME>

virbr0 虛擬網(wǎng)卡卸載方法
http://wscyza.blog.51cto.com/898495/286615

xen網(wǎng)絡結(jié)構(gòu)
http://wiki.xensource.com/xenwiki/XenNetworking


卸載rmmod 驅(qū)動名
redhat
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/s2-sysconfig-i18n.html

vim 配色
1:export TERM=dtterm

2:從網(wǎng)絡中找個寫好的.vimrc (:syntax enable)

chroot
# mount /dev/hda3 /mnt/gentoo
# mount /dev/hda1 /mnt/gentoo/boot
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev

字節(jié)對齊:
http://blog.chinaunix.net/u3/98822/showart.php?id=2335795
  
這里面有四個概念值:

  1.數(shù)據(jù)類型自身的對齊值:就是上面交代的基本數(shù)據(jù)類型的自身對齊值。

  2.指定對齊值:#progma pack (value)時的指定對齊值value。

  3.結(jié)構(gòu)體或者類的自身對齊值:其成員中自身對齊值最大的那個值。

  4.數(shù)據(jù)成員、結(jié)構(gòu)體和類的有效對齊值:自身對齊值和指定對齊值中小的那個值。


locate命令更新緩存。
updatedb
locate XXXX

?

刪除rpm數(shù)據(jù)庫
rm -f /var/lib/rpm/__db*
rpm --rebuilddb

?

網(wǎng)卡錯誤
1、首先確認MAC所對應的是那塊網(wǎng)卡。
2、貼出/etc/sysconfig/hwconf???? /etc/modprobe.conf文件的內(nèi)容。
3、貼出ls /etc/sysconfig/network-script的內(nèi)容。

?

重命名數(shù)據(jù)庫
rename table A to B

清空表
delete from MYTABLE

更改auto_increment
alter table tablename auto_increment=1;

刪除主鍵
alter table tablename drop primary key;

增加auto_increment
alter table tablename add id int(11) not null auto_increment primary key;

修改auto_increment
alter table tablename auto_increment=1;

修改表名
alter table oldtable rename newtable;

修改表列名
alter table tablename change columnname columnname int(11) auto_increment;

增加主鍵
alter table tablename add primary key (dnid,languae);

插入數(shù)據(jù)
insert into table A(first,third) values ('test','test');

更新數(shù)據(jù)
update table A set first = '1';

加用戶
grant all privileges on *.* to 'username'@'%' identified by 'xxx';
flush privileges;

?

cannot restore segment prot after reloc: Permission denied
是SELinux原因,解決辦法有兩個
1. 使用chcon 命令
示例: chcon -t texrel_shlib_t /usr/local/rsi/idl_6.1/bin/bin.linux.x86/*.so
2. 禁止掉SELinux
更改/etc/sysconfig/selinux 文件的內(nèi)容為 SELINUX=disabled

總結(jié)

以上是生活随笔為你收集整理的学习笔记【2010/09/20-2010/11/27】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。