jfo planet

Hope is the best gift that tomorrow gives.

  • 首页
  • 分类
  • 归档
  • 标签
  • 搜索
close

解决Linux下连接Cisco VPN后局域网不能访问

发表于 2014-08-06   |   分类于 Network
在Linux下使用Cisco Anyconnect客户端连接VPN后,局域网无法访问,无论如何设置路由,路由表始终无法改变网上搜了一下,原因是Anyconnect客户端监听路由表,一旦改变,通过一个回调再改回去 解决办法:Anyconnect监听路由表的回调代码位于一个so共享库,可以通过LD_PRELOAD阻止Anyconnect加载原来的监听回调 创建hack.c #include <sys/socket.h> #include <linux/netlink.h> int _ZN27CInterfaceRouteMonitorLinux20routeCallbackHandlerEv() { int fd=50; // max fd to try char buf[8192]; struct sockaddr_nl sa; socklen_t len = sizeof(sa); while (fd) { if (!getsockname(fd, (struct sockaddr *)&sa, &len)) ...
阅读全文 »

使用make-kpkg生成linux-header

发表于 2014-08-01   |   分类于 Arduino/OpenWrt
$ sudo apt-get install kernel-package 生成linux-headers$ export ARCH=arm$ export DEB_HOST_ARCH=armhf$ export CONCURRENCY_LEVEL=4$ make-kpkg –rootcmd fakeroot –arch arm –cross-compile arm-linux-gnueabihf- –revision 1.0 –append-to-version -sunxi kernel_headers 生成linux-source$ make-kpkg –rootcmd fakeroot –arch arm –cross-compile arm-linux-gnueabihf- –revision 1.0 –append-to-version -sunxi kernel_source一定要指定export DEB_HOST_ARCH=armhf 如果要生成内核image deb包,可以make-kpkg kernel_image,会自动build内核并生成kernel的deb 产 ...
阅读全文 »

uEnv.txt的使用

发表于 2014-08-01   |   分类于 Arduino/OpenWrt
Cubieboard2 A20制作SD启动卡时使用了boot.cmd,然后生成boot.scr拷贝至sd卡第一个分区,这种方法有个坏处就是每次更改boot参数都需要重新生成一次boot.scr,比较麻烦,其实uBoot提供了uEnv.txt,可以直接在里面添加参数,启动时会先读取uEnv.txt,然后再执行boot.scr 在为Cubieboard添加小米wifi支持时,就可以利用uEnv.txt添加一个额外参数coherent_pool=6M,而不用重新生成boot.scr boot.cmd内容如下: $ cat boot.cmd setenv bootargs console=ttyS0,115200 noinitrd disp.screen0_output_mode=EDID:1280x1024p60 init=/sbin/init root=/dev/mmcblk0p2 rootfstype=ext4 rootwait panic=10 ${extraargs} fatload mmc 0 0x43000000 boot/script.bin fatload mmc 0 0x4 ...
阅读全文 »

Cubieboard2使用小米wifi

发表于 2014-08-01   |   分类于 Arduino/OpenWrt
下载MT7601U驱动和linux-sunxi源码$ git clone https://github.com/jfojfo/MT7601U.gitcommon/rtusb_dev_id.c文件修改如下:#ifdef MT7601U {USB_DEVICE(0x148f,0x6370)}, / Ralink 6370 / {USB_DEVICE(0x2955,0x1001)}, / xiaodu wifi / {USB_DEVICE(0x148f,0x7601)}, / MT 6370 / {USB_DEVICE(0x148f,0x760b)}, / 360 wifi 2 / {USB_DEVICE(0x2717,0x4106)}, / XiaoMi wifi /#endif / MT7601U /或者下面git库(支持AP模式)$ git clone https://github.com/jfojfo/MT7601U-1.git该驱动源码已经加入了xiaomi wifi支持修改Makefile,在export LINUX_SRC CROSS_COMPIL ...
阅读全文 »

Cubieboard2 A20 Building your own android-4.2.2 firmware

发表于 2014-07-31   |   分类于 Arduino/OpenWrt
系统环境Ubuntu-12.04 x86_64源码下载地址:http://pan.baidu.com/s/1dDGPnXZ 编译步骤: $ cd lichee/linux-3.4 $ make clean $ cp arch/arm/configs/cubieboard2_config .config //note:if you want to complie cubietruck, please copy cubietruck_config. $ cd .. $ ./build.sh -p sun7i_android $ cd ../android $ source build/envsetup.sh $ lunch //note:select sugar-cubieboard2 or sugar-cubietruck $ extract-bsp $ make -j8 注意:需要unset NDK_ROOT,否则build过程可能出错: In file included from external/webrtc/src/modules/audio_processing ...
阅读全文 »

Cubieboard2 A20 SD卡启动及根文件系统制作

发表于 2014-07-31   |   分类于 Arduino/OpenWrt
系统环境Ubuntu-12.04 x86_64安装arm-linux-gnueabihf-gcc编译环境 $ apt-get install arm-linux-gnueabihf-gcc$ arm-linux-gnueabihf-gcc –versionarm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 源码下载: $ git clone http://github.com/linux-sunxi/u-boot-sunxi.git$ git clone http://github.com/cubieboard/linux-sunxi -b cubie/sunxi-3.4.91$ git clone http://github.com/linux-sunxi/sunxi-tools.git$ git clone http://github.com/linux-sunxi/sunxi-boards.git其中linux内核去cubieboard的github下载(注:未使用文档中说的cubieboard2的github ...
阅读全文 »

Win7开启Wifi热点

发表于 2014-07-28   |   分类于 Network
开启windows 7的隐藏功能:虚拟WiFi和SoftAP(即虚拟无线AP),让电脑变成无线路由器的方法 netsh wlan set hostednetwork mode=allow ssid=myWiFi key=12345678 打开“网络和共享中心”–“更改适配器设置”,可以看到多出一项“Microsoft Virtual WiFi Miniport Adapter”,重命名为“虚拟WiFi”,如果没有,可能需要更新无线网卡驱动 设置Internet连接共享:在“网络连接”窗口中,右键单击已连接到Internet的网络连接,选择“属性”→“共享”,勾上“允许其他······连接(N)”并选择“虚拟WiFi” netsh wlan start hostednetwork 这样其他设备就可以连接刚才建立起来的热点了   参考:http://jingyan.baidu.com/article/5d368d1e3e499b3f61c05762.html
阅读全文 »

USBIP Share USB-Device On Ubuntu 12.04

发表于 2014-07-28   |   分类于 Linux App
文档下载:《USB_IP Share USB-Device On Ubuntu 12》 原文地址:http://jerry2yang.wordpress.com/2013/01/18/usbip-share-usb-device-on-ubuntu-12-04/ 完全参照文档来做就可以了,注意修改config.h中的USBIP_VERSION为106,否则windows客户端报错: windows客户端下载地址:usbip_windows_v0.2.0.0_signed   Usage: To install the virtual usb bus driver on Windows XP: Uncompress the downloaded binary package to a directory. Double-click the ‘Add Hardware’ wizard in Control Panel. At the ‘Welcome to the Add Hardware Wizard’, click ‘Next’. Select ‘Yes, I have ...
阅读全文 »

动态实例化Interface

发表于 2014-06-10   |   分类于 Java
Example: package com.example; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; public class Test { public interface A { void hello(); } private static void test(A a) { a.hello(); } public static void main(String[] args) { try { Class<?> AIntf = Class.forName("com.example.Test$A"); Object proxy = Proxy.newProxyInstance(AIntf.getClassLoader(), ...
阅读全文 »

Android InputEvent框架实现及传递过程(app端)

发表于 2014-05-22   |   分类于 Android
ActivityThread调用handleLaunchActivity > handleResumeActivity r.window = r.activity.getWindow(); View decor = r.window.getDecorView(); decor.setVisibility(View.INVISIBLE); ViewManager wm = a.getWindowManager(); WindowManager.LayoutParams l = r.window.getAttributes(); a.mDecor = decor; l.type = WindowManager.LayoutParams.TYPE_BASE_APPLICATION; l.softInputMode |= forwardBit; if (a.mVisibleFromClient) { a.mWindowAdded = true; wm.addView(decor, l ...
阅读全文 »
1…456…61
jfo

jfo

605 日志
38 分类
4 标签
RSS
GitHub 微博
友情链接
  • 收藏夹
  • 网络剪贴板
  • 爱逛吧
© 2007 - 2018 jfo
由 Hexo 强力驱动
主题 - NexT.Pisces