openwrt command record

This commit is contained in:
JamesonHuang 2015-06-17 23:00:13 +08:00
parent e9f833d7f3
commit d29f6ce7d1
2 changed files with 564 additions and 0 deletions

282
openwrt命令记录.lua Normal file
View File

@ -0,0 +1,282 @@
openwrt配置命令
sudo minicom -D /dev/ttyUSB0
la /dev/ttyUSB0
cd /etc/config/
cat wireless
/etc/init.d/network reload
cat /etc/config/wireless
router_reset
ifconfig
r13: http://192.168.232.1
r10: http://192.168.233.1
zhengkl@meizu.com
ssh root@192.168.232.1
10.2.64.20
--------------------------------------------------------
git配置命令
git branch -a
git checkout
git log
HEAD
git diff
----------------------------------------------------------
gvim字体设置
DejaVu Sans Mono 12
cd /usr/bin/apcli_connect.sh
---------------------------------------------------------
Luci界面找到相应函数代码并修改
1
2luci/controller/admin/network.lua中找到相应函数
3
4r13的api/index.lua或meizu目录的相应lua文件中
5./build.sh
/
/usr/lib/lua/meizu/build.sh
logread -f
-----------------------------------------------------------
luci代码路径
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/luci
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/xiaoqiang
wifi开关
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/luci/controller/api/xqsystem.lua --line 1517
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/xiaoqiang/common/XQFunction.lua --line 89 & 29
------------------------------------------------------------
grep:
grep -F "bind_router" ./* -Rn --查找正文中含有bind_router的关键字
-F
-R
-n
ctags
使ctags ctags -R ./*
ctrl + ]
ctrl + t
taglist
Tlist Taglist
----------------------------------------------------------------
u盘 /media
cd sbin/
709 fuke uhbn
710 file uhbn
711 vi uhbn
tail -f /var/log/kern.log~
714 tail -f /var/log/kern.log
715 lsmod
716 ifconfig
717 lsusb -v
718 lsusb~
719 lsusb
720 lsusb |wc -l
721 ls /proc/net/~
722 ls /proc/net/
723 ls /proc/net/dev
724 ls /proc/net/dev -la
725 cd /proc/net/
726 ls -lr~
727 ls -lr
728 ls -lr|grep eth
729 cd /sys/class/net/~
730 cd /sys/class/net/
731 ls -lr|grep eth
732 ls -lr|grep -i wla
733 lsusb
734 lsusb -v |tee /tmp/usb.log
735 vi /tmp/usb.log
736 uname -r
737 uname -a
738 vi /tmp/usb.log
739 lsusb -v
740 ~
741 lsusb -v
742 tail -f /var/log/kern.log
743 uname -r
744 uname
745 uname -a
746 lsusb -v
ssh lcd@10.2.65.22
http://forum.ubuntu.com.cn/viewtopic.php?f=116&t=466756
http://my.oschina.net/cuilili/blog/374704
------------------------------------------------
r13测试路径 http://192.168.233.244/cgi-bin/luci/api/sip
luci.http.prepare_content("application/json")
echo "$@" > /tmp/log.txt
------------------------------------------------
r13编译: /meizu路径下: ./build.sh
r10编译 reboot or rm /tmp/ cache
rm /tmp/luci-modulecache/ -rf
openwrt交叉编译gcc *.c:
./mipsel-openwrt-linux-uclibc-gcc hello.c -o hello
~/my_code/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin
find -name
/home/rh/my_code/openwrt/bin/ramips
find -name "*up*.bin"
find -name "*dex*"
make V=s -j1
--------------------------------------------------
vim ctrl + f
ctrl + b
shell shift + up
shift + down
ctrl + up / down
ctrl +shift + t
grep -n "function" ./*
find -name "index" ./*
watchcat所在目录scp /home/rh/test/watchcat root@192.168.232.1:/usr/bin
--------------------------------------------------
linux内核方法
sudo apt-get remove linux-image-XXX-generic
sudo apt-get remove linux-headers-generic
dpkg --get-selections |grep linux
tail -f nebula.log
/etc/init.d/network restart
---------------------------------------------------
local lue = require("luci.util").exec
local t = lue([[date -d "2010-10-10 10:10:10" +%s]])
print(tonumber(t))
---------------------------------------------------
cat nebula.log |grep agai
sshpass -p mzszR10 scp old root@172.16.1.6:/usr/bin
./apcli_connect.sh disable a_rh a_5g_rh
./apcli_connect.sh restart
cnt=0;while [ $cnt -lt 100 ];do ./socket_client;((cnt++));echo "test:$cnt";done
sshpass -p mzszR10 ssh root@172.16.1.7
sshpass -p mzszR10 ssh root@192.168.36.249
killall watchcat
linux命令测试udp广播
echo sysinfo |ncat 10.16.1.2 51232 -v -u cnt=0;while [ $cnt -lt 100 ];do ./socket_client;((cnt++));echo "test:$cnt";done
ncat 10.16.1.2 51232 -v -u
searchctrl + r
cat /etc/openwrt_version
make menuconfig
--r13 lan口转wan口
1
cat /etc/config/network
/etc/init.d/network restart
2
uci set network.lan.eth_port=wan
uci commit
uci get network.lan.eth_port
/etc/lucinit.d/network restart
uci set network.lan.eth_port=wan
(3)interface选项 = connect
--apt search
apt-cache search ssl|grep -i python
--dd
dd if=abcdef of=2b bs=1 count=2 skip=1

282
openwrt命令记录.lua~ Normal file
View File

@ -0,0 +1,282 @@
openwrt配置命令
sudo minicom -D /dev/ttyUSB0
la /dev/ttyUSB0
cd /etc/config/
cat wireless
/etc/init.d/network reload
cat /etc/config/wireless
router_reset
ifconfig
r13: http://192.168.232.1
r10: http://192.168.233.1
zhengkl@meizu.com
ssh root@192.168.232.1
10.2.64.20
--------------------------------------------------------
git配置命令
git branch -a
git checkout
git log
HEAD
git diff
----------------------------------------------------------
gvim字体设置
DejaVu Sans Mono 12
cd /usr/bin/apcli_connect.sh
---------------------------------------------------------
Luci界面找到相应函数代码并修改
1
2luci/controller/admin/network.lua中找到相应函数
3
4r13的api/index.lua或meizu目录的相应lua文件中
5./build.sh
/
/usr/lib/lua/meizu/build.sh
logread -f
-----------------------------------------------------------
luci代码路径
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/luci
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/xiaoqiang
wifi开关
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/luci/controller/api/xqsystem.lua --line 1517
/home/rh/my_code/miwifi_package_rom/usr/lib/lua/xiaoqiang/common/XQFunction.lua --line 89 & 29
------------------------------------------------------------
grep:
grep -F "bind_router" ./* -Rn --查找正文中含有bind_router的关键字
-F
-R
-n
ctags
使ctags ctags -R ./*
ctrl + ]
ctrl + t
taglist
Tlist Taglist
----------------------------------------------------------------
u盘 /media
cd sbin/
709 fuke uhbn
710 file uhbn
711 vi uhbn
tail -f /var/log/kern.log~
714 tail -f /var/log/kern.log
715 lsmod
716 ifconfig
717 lsusb -v
718 lsusb~
719 lsusb
720 lsusb |wc -l
721 ls /proc/net/~
722 ls /proc/net/
723 ls /proc/net/dev
724 ls /proc/net/dev -la
725 cd /proc/net/
726 ls -lr~
727 ls -lr
728 ls -lr|grep eth
729 cd /sys/class/net/~
730 cd /sys/class/net/
731 ls -lr|grep eth
732 ls -lr|grep -i wla
733 lsusb
734 lsusb -v |tee /tmp/usb.log
735 vi /tmp/usb.log
736 uname -r
737 uname -a
738 vi /tmp/usb.log
739 lsusb -v
740 ~
741 lsusb -v
742 tail -f /var/log/kern.log
743 uname -r
744 uname
745 uname -a
746 lsusb -v
ssh lcd@10.2.65.22
http://forum.ubuntu.com.cn/viewtopic.php?f=116&t=466756
http://my.oschina.net/cuilili/blog/374704
------------------------------------------------
r13测试路径 http://192.168.233.244/cgi-bin/luci/api/sip
luci.http.prepare_content("application/json")
echo "$@" > /tmp/log.txt
------------------------------------------------
r13编译: /meizu路径下: ./build.sh
r10编译 reboot or rm /tmp/ cache
rm /tmp/luci-modulecache/ -rf
openwrt交叉编译gcc *.c:
./mipsel-openwrt-linux-uclibc-gcc hello.c -o hello
~/my_code/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin
find -name
/home/rh/my_code/openwrt/bin/ramips
find -name "*up*.bin"
find -name "*dex*"
make V=s -j1
--------------------------------------------------
vim ctrl + f
ctrl + b
shell shift + up
shift + down
ctrl + up / down
ctrl +shift + t
grep -n "function" ./*
find -name "index" ./*
watchcat所在目录scp /home/rh/test/watchcat root@192.168.232.1:/usr/bin
--------------------------------------------------
linux内核方法
sudo apt-get remove linux-image-XXX-generic
sudo apt-get remove linux-headers-generic
dpkg --get-selections |grep linux
tail -f nebula.log
/etc/init.d/network restart
---------------------------------------------------
local lue = require("luci.util").exec
local t = lue([[date -d "2010-10-10 10:10:10" +%s]])
print(tonumber(t))
---------------------------------------------------
cat nebula.log |grep agai
sshpass -p mzszR10 scp old root@172.16.1.6:/usr/bin
./apcli_connect.sh disable a_rh a_5g_rh
./apcli_connect.sh restart
cnt=0;while [ $cnt -lt 100 ];do ./socket_client;((cnt++));echo "test:$cnt";done
sshpass -p mzszR10 ssh root@172.16.1.7
sshpass -p mzszR10 ssh root@192.168.36.249
killall watchcat
linux命令测试udp广播
echo sysinfo |ncat 10.16.1.2 51232 -v -u cnt=0;while [ $cnt -lt 100 ];do ./socket_client;((cnt++));echo "test:$cnt";done
ncat 10.16.1.2 51232 -v -u
searchctrl + r
cat /etc/openwrt_version
make menuconfig
--r13 lan口转wan口
1
cat /etc/config/network
/etc/init.d/network restart
2
uci set network.lan.eth_port=wan
uci commit
uci get network.lan.eth_port
/etc/lucinit.d/network restart
uci set network.lan.eth_port=wan
(3)interface选项 = connect
--apt search
apt-cache search ssl|grep -i python
--dd
dd if=abcdef of=2b bs=1 count=2 skip=1