在64位Ubuntu中使用jd-gui反编译时出现错误:
error while loading shared libraries: libgtk-x11-2.0.so.0
此时,需要安装如下依赖包,即可:
(Ubuntu 13.04 x64)
(Ubuntu 13.10 x64)
在64位Ubuntu中使用jd-gui反编译时出现错误:
error while loading shared libraries: libgtk-x11-2.0.so.0
此时,需要安装如下依赖包,即可:
(Ubuntu 13.04 x64)
(Ubuntu 13.10 x64)
Rdesktop是Linux操作系统下的一款远程桌面工具,可以用来链接Windows系统
使用rdesktop来指定分辨率,让远程桌面刚好填充到空白区域:
在终端里敲:
其中-g 参数就是指定分辨率。因为我是1280*800 所以我使用1024*768的分辨率是正好的。你可以根据你的情况来调整分辨率,找到一个最佳值。
其中-a参数指定的是16色。
但这有个缺点,就是每次都要敲一堆参数,太麻烦。所以,我们可以使用别名来简化这个命令。
打开~/.bashrc 这个文件。在里面可以添加别名(写在最后面就可以了):
例如:
注意1024x768之间的x别写成*或其他,否则分辨率设置不起作用。
关闭终端。重新打开终端,此时只要敲 rdp ip地址 -u 用户名 -p 密码 就可以了。
而且你还可以把你常用的远程连接写成别名:
这样只要敲rdp就可以打开了。
PS:1、用户主目录下的.bashrc 文件会在终端启动的时候被终端读取。
2、此外,-g 还可以 以 百分比 的形式填写 如下:
These simple steps have been tested building Audacity 2.x on Ubuntu 11.04 (natty) and onwards including 13.04 (raring). The steps should also work with appropriate modification on most other Debian-based systems and for most legacy 1.3 versions of Audacity.
Open a terminal and type the following commands:
This should now give you the Audacity program at usr/local/bin and the plug-ins at usr/local/share/audacity.
On occasions, changes to latest Audacity HEAD may require you to regenerate the configure file before running it. To do this
看了下WxWidgets的官方文档,看来它对Mac的支持还不是很好,所以问题还是蛮多的。
先下的最新的2.9,结果解压出来差一个文件,错误:
cannot find sources (wx-config.in)
看到这个,我翻了下目录,还真没这个文件,所以暂时放下这个版本,然后搞2.8。
这个倒是简单,解压之后,在docs/cocoa下面有install文档,照着做就行了。
不过在lion下面可能会有这两个问题:
1.
这个问题的答案就是lion去掉了一些过去使用的API,所以需要让系统link更早的Library就好了,解决办法是在configure的时候加入命令行:
2.第二个错误来自官方的文档说明,应该和平台有关系,看官方的解释:
Building on Snow Leopard for Snow Leopard
When trying to build wx under 10.6 you might - on certain machines - end up with errors like this:
The reason is that the default compiler on 10.6 is gcc 4.2, and if you are on a Core 2 Duo which is 64-bit capable, you end up compiling Carbon-only 2.8 for 64 bits which fails, due to the lack of 64-bit Carbon support. If you want 64-bit wxWidgets on OS X you'll need 2.9+ and configure -with-osx_cocoa - see below; but remember that 2.9 is not an official, stable release and wxOSX/Cocoa is not yet complete.
So, to compile with 2.8 on a 64-bit Mac, you have to explicitly indicate the architectures you want:
This makes the library and samples build nicely for Intel 32-bit targets, and you can also add -arch ppc to the arch_flags so that you can build universal binaries.
因此,我最后的配置命令行是:
最后配置完成,使用make编译。
进入sample目录编译两个小demo,截图:
再来一个运行时候的样子:
转载自 http://hi.baidu.com/dbfr2011818/item/d26f6820dc80e08c6f2cc30e
First of all let's overview the structure of a typical Android app containing native code:
The app code is stored inside an .apk file that is essentially a ZIP archive containing the classes.dex file (with all the Java code) and one or more native libraries in lib\<EABI name> subdirectory. The typical lifecycle of an application with native code is the following:
Each native library exists in 2 versions:
While the Android device runs the smaller "stripped" version of the library, the GDB debugger needs the larger "non-stripped" version to map source files into addresses and vice versa:
When you set a breakpoint on a given line of a source file, the GDB debugger needs to perform certain computations before the breakpoint can be physically created and starts triggering. Assume libNative1 is loaded at address 0x10000 and the user is setting a breakpoint in line 24 of c:\main.cpp. GDB will do the following before it can set a breakpoint:
If any of the 3 steps fail, the breakpoint will not be created, or will be created wrongly and will never be hit. The next section explains how to diagnose and fix the related problems.
This section provides detailed instructions how to check for the most common problems with breakpoints caused by non-standard configurations or missing files:
First thing to do is to determine if the native library has been actually loaded and if GDB knows about it. It is done by running the "info shared" command in GDB:
The output from the info shared command should include 3 important lines:
Here's an example of those lines:
If some of the libraries are not present, you can force GDB to manually reload the symbols by running the following command in GDB:
The obj/local/armeabi directory of your project should be present among the reported directories and it should contain the .so file with symbols. If not, copy the correct .so file into a directory listed here and rerun the "sharedlibrary" command.
You can alternatively force GDB to search additional directories for the .so file using the set solib-search-path command.
If your .so library is not present in the list, it has not been loaded by the Java code yet. Please ensure that System.loadLibrary() is called from your Java code and that it succeeds without any Java exceptions.
A common cause of many breakpoint problems is a configuration when the directories using for building and debugging your project are different. E.g. if the library was compiled from c:\projects and then the sources were moved to d:\projects, setting a breakpoint in d:\projects\main.cpp will fail, as GDB will not accept c:\projects\main.cpp as a substitute.
Those problems can be diagnosed by looking into the source file lists and comparing them with the file used to set a breakpoint. First of all, remove your breakpoint, try setting your breakpoint again and watch what GDB command is issued by your IDE:
The -break-insert command used to set a breakpoint will specify a path to your source file.
Run the "info sources" command to see the source files discovered by GDB:
Copy the output of the command to the clipboard (Ctrl-A, Ctrl-C), paste it into a text editor and search for the source file you are trying to debug (e.g. MyAndroidApp.c):
If the file is not present in the list, you have loaded a wrong version of the .so file (see previous section). If the file is present, but the path is different from the one used in -break-insert command, you have found the cause of your problem. Rebuild your app using the new path, or move the file back to an old location so that the path used for creating breakpoints matches the path reported by the "info sources" command.
Note that GDB requires the file path to be EXACTLY the same as reported by "info sources", including double slash before "jni".
If your breakpoints are set, but never hit, there is probably a mismatch between the .so file version loaded into the Android application and the .so file version used by GDB to compute addresses from source lines. The most common cause for it is the bug in the Android loader that loads the armeabi library instead of the armeabi-v7a version. If you suspect this to happen, change your build configuration to build either armeabi, or armeabi-v7a platform, but not both at the same time and rebuild your application.'
引用自 http://www.codeproject.com/Articles/493043/Why-your-Android-NDK-breakpoints-might-fail-and-ho
1. 配置 Socks5 编译环境
2. 安装 Socks5 必要的包
3.下载,编译安装 Socks5
到此下载 http://sourceforge.net/projects/ss5/files/
http://ss5.sourceforge.net/
官方实例
http://ss5.sourceforge.net/examples.htm
有点 BUG 需要我们手工修正一下
# vi /etc/rc.d/init.d/ss5 找到38行
改为
# vi /etc/rc.d/init.d/ss5 找到40行
改成
看下我修改后的对比
4. 启动ss5服务
5. 添加 ss5 到服务中,并随机启动
6. 删除Socks V4模块
改名为 mod_socks4.so.bk
7. 添加 SS5 用户
ss5 默认使用1080端口,并允许任何人使用。
我们可以修改 /etc/opt/ss5/ss5.conf 中的
为
在 /etc/opt/ss5/ss5.passwd 中添加 用户名和密码如:
8. 设置允许范围
使用用户验证,重启ss5服务
8. 查看日志
ss5正常启动后,如果你使用的是10800(非默认端口),这时会发现1080和10800都开的了,
这时你需要去环境变量里手工指定端口:
Centos
Ubuntu
vsftpd
服务器Centos
OK
表示重启成功了.restart
改为start/stop
即可.start.sh
和shutdown.sh
文件,执行它们就可以了.
3.与vsftpd
服务器有关的文件和文件夹
vsftpd
服务器的配置文件的是: /etc/vsftpd/vsftpd.conf
如果系统是Ubuntu
,则配置文件在/etc/vsftpd.conf
vsftpd
服务器的根目录,即FTP
服务器的主目录:
在/var/ftp
如果你想修改服务器目录的路径,那么你只要修改/var/ftp
到别处就行了
4.添加FTP
本地用户
有的FTP
服务器需要用户名和密码才能登录,就是因为设置了FTP
用户和权限.
FTP
用户一般是不能登录系统的,只能进入FTP
服务器自己的目录中,这是为了安全.这样的用户就叫做虚拟用户了.实际上并不是真正的虚拟用户,只是不能登录SHELL
了而已,没能力登录系统.
这个命令的意思是:
使用命令(adduser
)添加test
用户,不能登录系统(-s /sbin/nologin
),自己的文件夹在(-d /opt/test_ftp
)),属于组ftp(-g ftp)
然后你需要为它设置密码 passwd test
这样就添加了一个FTP
用户了.下面的示例可以帮助你进入FTP
服务器了.
在Windows
中,只要在浏览器中输入 ftp://192.168.0.33 进入FTP
服务器,然后 右键 登录,输入用户名和密码就可以登录自己的目录了.
当然你要保证自己能读写自己的目录,就要在配置文件vsftpd.conf
里设置一下就可以读写了.
5.匿名上传下载
修改配置文件即可vsftpd.conf
,确定有以下几行,没有自己添加进去就可以了.
然后你可以新建一个文件夹,修改它的权限为完全开放,任何用户就可以登录这个文件夹,并上传下载文件:
6.定制进入FTP
服务器的欢迎信息
在vsftpd.conf
文件中设置:
然后进入用户目录建立一个.message
文件,输入欢迎信息即可(我这里写入的是Welcome to gxlinux's FTP!
):
7.实现虚拟路径
将某个目录挂载到FTP
服务器下供用户使用,这就叫做虚拟路径.
比如将gxl
用户的目录挂载到FTP
服务器中,供FTP
服务器的用户使用,使用如下命令即可:
8.打开vsFTPd
的日志功能
添加下面一行到vsftpd.conf
文件中,一般情况下该文件中有这一行,只要把前面的注释符号#去掉即可,没有的话就添加,或者修改:
9.限制链接数,以及每个IP
最大的链接数
修改配置文件中,例如vsftp
最大支持链接数100个,每个IP
能支持5个链接:
10.限制传输速度
修改配置文件中,例如让匿名用户和vsftd
上的用户(即虚拟用户)都以80KB=1024*80=81920
的速度下载
11.将用户(一般指虚拟用户)限制在自家目录
修改配置文件中,这样用户就只能访问自己家的目录了:
如果只想某些用户仅能访问自己的目录,其它用户不做这个限制,那么就需要在chroot_list
文件(此文件一般是在/etc/vsftpd/
中)中添加此用户.
编辑此文件,比如将test
用户添加到此文件中,那么将其写入即可.一般的话,一个用户占一行.
12.绑定某个IP
到vsFTPd
有时候要限制某些IP
访问服务器,只允许某些IP
访问,例如只允许192.168.0.33访问这个FTP
,同样修改配置文件:
虚拟用户其他设置
在/etc/vsftpd/vsftpd.chroot_list
文件中写入允许登陆的虚拟用户名称,每行一个
在/etc/vsftpd/vsftpd_user_conf
文件夹中创建一个以虚拟用户用户名命名的文件,
写入:local_root = /var/FTP/
子目录名
然后在/var/FTP
下创建一个对应的目录即可
13.Ubuntu
下开启SSL
支持,使用SFTP
来访问
在 /etc/vsftpd.conf
文件的
后面增加
然后重启vsftpd
此时使用的是系统默认的证书,如果要设置自己的证书,修改
为自己证书的路径就可以了。
FileZilla
在配置的协议中选择 “SFTP-SSH File Transfer Protocol
”就可以正常登陆了。
14.特别配置
如果在配置文件中,设置listen=NO
,并且开启设置chroot_local_user=yes
,那么可以使用SSH
的登录端口来使用FTP
功能,这样可以减少一个端口的暴露。如果设listen=YES
,则会增加一个端口专门来接受来自FTP
端口的请求。默认端口是21
。可以通过配置文件的listen_port
来修改。
首先,看 vbox的官方文档:
http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi
--compact
option, can be used to compact disk images, i.e. remove blocks that only contains zeroes. This will shrink a dynamically allocated image again; it will reduce the physical size of the image without affecting the logical size of the virtual disk. Compaction works both for base images and for diff images created as part of a snapshot.For this operation to be effective, it is required that free space in the guest system first be zeroed out using a suitable software tool. For Windows guests, you can use the sdelete
tool provided by Microsoft. Executesdelete -z
in the guest to zero the free disk space before compressing the virtual disk image. For Linux, use the zerofree
utility which supports ext2/ext3 filesystems.Please note that compacting is currently only available for VDI images. A similar effect can be achieved by zeroing out free blocks and then cloning the disk to any other dynamically allocated format. You can use this workaround until compacting is also supported for disk formats other than VDI.关键之处正在于 sdelete 应该使用 -c -z 两个选项 ,而网上所以的方法都说是使用 -c 选项。
Using SDelete
SDelete is a command line utility that takes a number of options. In any given use, it allows you to delete one or more files and/or directories, or to cleanse the free space on a logical disk. SDelete accepts wild card characters as part of the directory or file specifier.
所以,总结一下,正确的方法应该是这样:
- 在guest os 中清理系统, windows的话可以再硬盘碎片整理一下
- 在 guest os 中 Windows 执行
sdelete -z -c
; Linux/Debian/Ubuntu 启动到Recovery Mode执行zerofree /dev/sdaX
- VBoxManage modifyhd <uuid>|<filename> --compact
如果磁盘空间不足,使用如下命令调整(增大/加大)磁盘空间
Android 2.3起,新增加了一个新的类,叫StrictMode(android.os.StrictMode)。这个类可以用来帮助开发者改进他们编写的应用,并且提供了各种的策略,这些策略能随时检查报告开发者开发应用中存在的问题,比如可以监视那些本不应该在主线程中完成的工作或者其他的一些不规范和不好的代码。
StrictMode的策略和规则
目前,有两大类的策略可供使用
一类是关于常用的监控方面的
Disk Reads 磁盘读
Disk Writes 磁盘写
Network access 网络访问
Custom Slow Code 自定义的运行速度慢的代码分析
前面三种的意思读者应该很清楚,就是正如它们的名字所示,分别对磁盘的读和写,网络访问进行监控。而第四种的自定义慢代码分析,是仅当访问调用类的时后才触发的,可以通过这种
方法去监视运行缓慢的代码。当在主线程中调用时,这些验证规则就会起作用去检查你的代码。比如,当你的应用在下载或者解析大量的数据时,你可以触发自定义运行速度慢代码的查询分、
析,作用很大。StrictMode可以用于捕捉发生在应用程序主线程中耗时的磁盘、网络访问或函数调用,可以帮助开发者使其改进程序,使主线程处理UI和动画在磁盘读写和网络操作时变得更平
滑,避免主线程被阻塞的发生。
另一类是关于VM虚拟机等方面的策略
内存泄露的Activity对象
内存泄露的SQLite对象
内存泄露的释放的对象
其中,内存泄露的Activity对象和内存泄露的SQLite对象都比较好理解,而所谓对关闭对象的检查,主要是去监那些本该释放的对象,比如应该调用close()方法的对象
相关的违反情况可以记录在LogCat中或者存储在DropBox中(android.os.DropBox)服务中
如何使用:
放在activity的周期onCreate方法中