这里简单介绍一个自己写的检测某个进程是否存在的bash小脚本。直接上代码。
Mac更改默认网络连接
使用了新的VPN,可以连接通过,但是访问Google还是不很慢,简直就是不生效.后来,运维同事帮忙解决了一下,解决方法就是将vpn设置网络连接第一个位置.
处理Python未捕获异常
###Talk Is Cheap
和Java一样,python也提供了对于checked exception和unchecked exception. 对于checked exception,我们通常使用try except可以显示解决,对于unchecked 异常,其实也是提供回调或者是钩子来帮助我们处理的,我们可以在钩子里面记录崩溃栈追踪或者发送崩溃数据.
下面代码可以实现python unchecked exception回调,并输出日志信息.
Octopress填坑日记
今日开始开始填Octpress在天朝的坑。
解决Octopress博客访问慢的问题
解决Octopress博客访问慢的问题 ##本博情况
- 前身为http://androidyue.github.io
- 新域名droidyue.com从Godaddy购买。
- DNS由DNSPod解析。
- 内容存放在Github Pages。
- 博客系统为Octopress
自定义Octopress404页面
刚刚在Octopress实现了自定义的404页面。参考别人的文章写的,很容易实现,谁知发现写完后,感觉自己掉进了一个坑,然后又爬了出来,所以,有必要自己写出来一个超级精简没有坑的帖子帮助别人。
Gmail垃圾邮件过滤器文件分享
Gmail垃圾邮件过滤器文件。
A filter file for Gmail to auto-delete spams.
工作后,一直使用Gmail邮件托管工作邮箱,收到的反馈很多,其中垃圾邮件,SEO,推销等邮件亦很多。还好Gmail提供了强大了过滤功能。以下是自己整理的一些垃圾邮件过滤文件,现在分享以下,以后会不断更新。
快速高效调试移动端前端代码
通常,前端调试输出一些日志信息可以使用alert或者console, 当然在Desktop机器上很容易,很多浏览器都支持,如果是在手机上,可能比较麻烦,怎么得到输出的console信息呢.
程序实现自己管理数据清理工作
How to disable system clear button and replace it with self application Manage Space?
Android在处理清楚数据时,会在系统的设置选项应用中,有一个清除数据的按钮,点下这个按钮之后,该应用的几乎所有数据都会被清除。具体清除了哪些数据,请参考这篇文章。http://droidyue.com/blog/2014/06/15/what-will-be-removed-if-you-click-clear-data-button-in-system-application-item/
Android中系统设置中的清除数据究竟会清除哪些数据
What will be removed If you click Clear Data Button in the System Application
今天中的一个story突然提到了系统设置中的清理数据,后来开始思考究竟系统的应用的这个清理功能,究竟会清理那些数据。 于是开始研究,以com.mx.browser为例,思路大概为首先为/data/data/com.mx.browser下的每一个文件夹下建立一个标志文件,这里为1.txt,然后执行清理数据操作,最后对比结果。 首先,进行清楚数据之前的的各个文件夹的情况。
检查Android是否具有摄像头
通常我们进行摄像头操作,如扫描二维码需要判断是否有后置摄像头(Rear camera),比如Nexus 7 一代就没有后置摄像头,这样在尝试使用的时候,我们需要进行判断进行一些提示或者处理。
去除mysql连接时的报警音
在使用命令行进入mysql时如果没有进行设置会有报警音很是吓人,使用这个命令可以去掉吓人的声音。
1
|
|
起作用的就是-p。
###Others
Load URL With Extra HTTP Headers Using WebView in Android
As we know, Webview will add the referer into the reqeust if we click a hyperlink to navigate to another one. But if we want to add a referer when a hard loading starts, What can we do to make it?
Check if a Thread Is Main Thread in Android
How to check a certain thread is the main one or not in Android? You may say it could be determined by checking the name. Yes, It may resolve the problem. However I think it’s not reliable.
Quickly Find Content in Files
Although Eclipse does provide a lot of facilities for Finding content is Workspace files, it maybe less efficient for find something such as a certain package or class usage. Actually we could do it more efficient and geeky.
How to Summarize Folder Size in Terminal
In this post, we will use the du command. This command does estimate file space usage; and It will summarize disk usage of each FILE, recursively for directories.
Android NinePatch Attention
I have got many crash report data about using NinePath Drwable. I put a .9.png file into the drawable-xhdpi folder and the file did not exist in any other folder. And I got ResourceNotFoundException. I got this following sayings.
Install Lsusb in Mac OSX
To continue doing as the following, make sure you have installed homebrew in your Mac OSX.
1
|
|
###Others
Revert a Certain File Back to a Certain Commit
1 2 3 4 |
|
###Others
Auth Password Cannot Be Read From a File
I am facing this problem which leaves the error message
Use Vim in StackEdit
StackEdit is really great online editor. It could connect with Google Drive. And what’s more, you can even use Vim in this editor.
Now add the following snippet into Settings–Extensions–UserCustom extension javascript area.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
##Others
Fix Notification Switching Position Issue
I once faced with a problem. I wrote a piece of code related with notifcation. Everything goes fine except one little issue. I found the ongoing notification switching order. My notification blinked each second. After Googling I found the reason and resolved the problem.
Fix No Sound Issue on Mac
Now I am dealing with Mac OSX. However I found sometimes this is no sound. People say it’s a bug. I have tried some methods. And found this goes for me every time.
1 2 3 |
|
Put the code into a shell script and run the script whenever the issue occurs.
###Others
Code Snippet for Media on Android
A few days ago,I have wrote down this post http://androidyue.github.io/blog/2014/01/19/scan-media-files-in-android/. Now I will paste my code snippet.
Scan Media Files in Android
I once tried to use MediaScanner to resolve problems; however it turned out to be a failure. Now I make it.This post is to write down why I failed and how I work it out now. I think it could be deeper that other posts.