- Install XCode if you do not have it. (XCode 3.2.6 is recommended for building this plugin, because the source code is configured to used Mac OS 10.5 sdk, which is included in XCode 3.2.6, but it is dropped by later version XCodes. However, the later version e.g. xcode 4.3, can also be used with a few modifications on the configuration.)
- To download XCode go to: https://developer.apple.com/downloads. (You need to sign up and login.)
- Here is a guide on how to install xcode on Mac OS X 10.7 Lion
- Check out the source code:
svn checkout http://google-web-toolkit.googlecode.com/svn/trunk/plugins gwt/plugins svn checkout http://google-web-toolkit.googlecode.com/svn/plugin-sdks/gecko-sdks/gecko-17.0.0 plugin-sdks/gecko-sdks/gecko-17.0.0
- If you have xcode 3.2.6 installed, you can try to build it:
cd gwt/plugins/xpcom && make BROWSER=ff170
- If you have later xcode version, e.g. xcode 4.3, installed, the command above will fail with errors finding cstdio.h. To make it work, you need to
- modify plugins/config.mk,
vi ../config.mk
changeBASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -D__mac -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -std=c++11
toBASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -D__mac -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -std=c++11
- modify gwt/plugins/xpcom/Makefile,
vi Makefile
changeDLLFLAGS += -bundle $(ALLARCHCFLAGS) -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
toDLLFLAGS += -bundle $(ALLARCHCFLAGS) -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
- modify plugins/config.mk,
- run
make BROWSER=ff170
(in gwt/plugins/xpcom directory.) to build. - the result plugin file will be gwt/plugins/xpcom/prebuilt/wt-dev-plugin.xpi
Search This Blog
How to build Google Web Toolkit DevMode plugin for Firefox 17.0 on Mac OS X
Install XCode 3.2.6 on Mac OS X 10.7 Lion
I was trying to compile GWT DevMode Plugin for Firefox on Mac OS, found the source code is configured to use mac os 10.5 sdk, which is included in xcode 3.2.6 but dropped by the later versions of xcode. The follow steps are what I did to install xcode 3.2.6 on Mac OS X 10.7 Lion:
- Download XCode 3.2.6 from https://developer.apple.com/downloads. (You need to sign up and login.)
- Mount xcode_3.2.6_and_ios_sdk_4.3.dmg
- Open /Applications/Utilities/Terminal.app and run the following command:
export COMMAND_LINE_INSTALL=1; open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"
GWT Developer's Plugin for Firefox 17
Update
The latest official google gwt devmode plugin for firefox has been updated to support Firefox 17. Upgrading to Firefox 17 should automatically update the gwt plugin as well.See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Ubuntu 12.04 Precise LTS: Install ModEvasive for Apache 2 web server
sudo apt-get install libapache2-mod-evasive
sudo mkdir /var/log/mod_evasive; sudo chown -R www-data:www-data /var/log/mod_evasive
sudo vi /etc/apache2/mods-available/mod-evasive.conf
<ifmodule mod_evasive20.c> DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 DOSLogDir /var/log/mod_evasive DOSEmailNotify EMAIL@DOMAIN.com DOSWhitelist 127.0.0.1 </ifmodule>
sudo a2enmod mod-evasive; sudo /etc/init.d/apache2 restart
Ubuntu 12.04 Precise LTS: Install ModSecurity for Apache 2 web server
- Install ModSecurity:
sudo apt-get install libxml2 libxml2-dev libxml2-utils libaprutil1 libaprutil1-dev libapache-mod-security
If your Ubuntu is 64bit, you need to fix a bug:sudo ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2 /usr/lib/libxml2.so.2
- Configure ModSecurity:
sudo mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf; sudo vi /etc/modsecurity/modsecurity.conf
Enable the rule engine:SecRuleEngine On
Increase the request body size limit to 10Mb(Optional, only if your site accepts uploads):SecRequestBodyLimit 10000000 SecRequestBodyInMemoryLimit 10000000
- Check the ModSecurity version:
dpkg -s libapache-mod-security | grep Version
The installed ModSecurity version is:Version: 2.6.3-1ubuntu0.2
- Install OWASP ModSecurity Core Rule Set:
- Download the rule set(version 2.2.5 because the latest version requires ModSecurity 2.7.0+):
wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/v2.2.5 -O /tmp/owasp.tar.gz
- Extract the package:
cd /tmp; tar -zxvf owasp.tar.gz; rm owasp.tar.gz
- Copy the directory to /etc/modsecurity, and set the permissions:
sudo mv SpiderLabs-owasp-modsecurity-crs-5c28b52/ /etc/modsecurity/owasp-crs sudo chmod -R 644 /etc/modsecurity/owasp-crs
- Link the rules to /etc/modsecruity/owasp-crs/activated_rules directory:
sudo mv /etc/modsecurity/owasp-crs/modsecurity_crs_10_setup.conf.example /etc/modsecurity/owasp-crs/modsecurity_crs_10_setup.conf cd /etc/modsecurity/owasp-crs/activated_rules/ sudo ln -s ../modsecurity_crs_10_setup.conf for f in $(ls ../base_rules/); do sudo ln -s ../base_rules/$f; done for f in $(ls ../optional_rules/); do sudo ln -s ../optional_rules/$f; done
- Modify /etc/apache2/mods-available/mod-security.conf to include the rules:
sudo vi /etc/apache2/mods-available/mod-security.conf
Add the following line:Include "/etc/modsecurity/owasp-crs/activated_rules/*.conf"
- Enable headers module:
sudo a2enmod headers
This to fix the following error:Syntax error on line 29 of /etc/apache2/conf.d/modsecurity/optional_rules/modsecurity_crs_49_header_tagging.conf: Invalid command 'RequestHeader', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. ...fail!
when restarting apache2.
- Download the rule set(version 2.2.5 because the latest version requires ModSecurity 2.7.0+):
- Enable ModSecurity module and restart apache2:
sudo a2enmod mod-security; sudo /etc/init.d/apache2 restart
See also
Mac OS: ssh tunnel issue 'bind: Cannot assign requested address'
I was trying to make a ssh tunnel using the following command:
Check the System Preferences -> Security & Privacy, found Firewall is On and in Firewall Options, Blocking all incoming connections was ticked. Deselect it and retry the ssh command, it works fine.
ssh -L 127.0.0.1:8000:remotehost.mycompany.com:3128 wilson@gateway.mycompany.com -f -NIt gives an error: "bind: Cannot assign requested address"
Check the System Preferences -> Security & Privacy, found Firewall is On and in Firewall Options, Blocking all incoming connections was ticked. Deselect it and retry the ssh command, it works fine.
Mac OS: commands to find my computer's ip address
ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'
Get the pid of a command running background
sleep 100 & echo $!Note: $! holds the pid of the command.
Run SSH Tunnel in background
I. start the tunnel in background
To open a SSH tunnel (port forwarding) in background, the following options for ssh command will be used:- -L [bind_address:]port:host:hostport
- Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port hostport from the remote machine.
- -N
- Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only).
- -f
- Requests ssh to go to background just before command execution.
Suppose I want to access the intranet site at work from home, and I have ssh access to the gateway host at work.
ssh -L 127.0.0.1:8000:intranet.mycompany.com:80 wilson@gateway.mycompany.com -f -NThe command above will start the tunnel (and the ssh process is running)in background.
II. kill the ssh process running in background
To kill the ssh process running in background, we can run ps aux to find the pid but that is not an elegant solution. ssh has -M -S and -O options to control the ssh process. It is ideal for this purpose.- -M
- Places the ssh client into "master" mode for connection sharing.
- -S ctl_path
- Specifies the location of a control socket for connection sharing, or the string ``none'' to disable connection sharing. Refer to the description of ControlPath and ControlMaster in ssh_config(5) for details.
- -O ctl_cmd
- Control an active connection multiplexing master process. When the -O option is specified, the ctl_cmd argument is interpreted and passed to the master process. Valid commands are: ``check'' (check that the master process is running), ``forward'' (request forwardings without command execution) and ``exit'' (request the master to exit).
# starts the tunnel ssh -L 127.0.0.1:8000:intranet.mycompany.com:80 -f -N -M -S ~/.ssh-tunnel.gateway.mycompany.com wilson@gateway.mycompany.com # checks the ssh process (pid) ssh -S ~/.ssh-tunnel.gateway.mycompany.com -O check wilson@gateway.mycompany.com # exits the ssh process (stops the tunnel) ssh -S ~/.ssh-tunnel.gateway.mycompany.com -O exit wilson@gateway.mycompany.com
III. A example shell script
The following shell script (Tested on Mac OS X) starts the ssh tunnel in background, then open the intranet web site, when the browser application is closed, it stops the ssh tunnel.#!/bin/bash GATEWAY_HOST=gateway.mycompany.com GATEWAY_USER=wilson REMOTE_HOST=172.23.33.10 REMOTE_PORT=80 LOCAL_HOST=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}') LOCAL_PORT=8000 SSH_CTRL_PATH=~/.ssh-tunnel-${GATEWAY_HOST} ssh -L ${LOCAL_HOST}:${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} ${GATEWAY_USER}@${GATEWAY_HOST} -N -f -M -S ${SSH_CTRL_PATH} open -W http://${LOCAL_HOST}:${LOCAL_PORT}/ ssh -S ${SSH_CTRL_PATH} -O exit ${GATEWAY_USER}@${GATEWAY_HOST}
See also
Java: convert between List and Array
I. List to Array
List<String> list = new ArrayList<String>(Arrays.asList(new String[]{"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus"})); // NOTE: the following line can be // String[] array = list.toArray(new String[0]); String[] array = list.toArray(new String[list.size()]);
II.Array to List
String[] array = new String[]{"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus"}; List<String> list = Arrays.asList(array);
III. A complete example
package arc; import java.util.Arrays; import java.util.List; public class Test { public static void main(String[] args) { String[] array = new String[] { "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus" }; for (String a : array) { System.out.println(a); } List<String> list = toList(array); System.out.println(list); array = toArray(list); for (String a : array) { System.out.println(a); } } public static String[] toArray(List<String> list) { return list.toArray(new String[0]); } public static List<String> toList(String[] array) { return Arrays.asList(array); } }
NOTE
list.toArray(new String[0])
is ok because the method will create a new array with the actual size of the list and returns it.
Java: get disk usage of a file or directory
- Option 1:
import java.io.File; public class FileUtil { public static long getDiskUsage(File f) { if (f.isFile()) { return f.length(); } else { int total = 0; File[] fs = f.listFiles(); if (fs != null) { for (int i = 0; i < fs.length; i++) { total += getDiskUsage(fs[i]); } } return total; } } public static void main(String[] args) { System.out.println(getDiskUsage(new File("/tmp/1.png"))); } }
- Option 2:
import java.io.File; import java.io.FileFilter; public class DiskUsage implements FileFilter { private long _size = 0; public DiskUsage() { } @Override public boolean accept(File file) { if (file.isFile()) { _size += file.length(); } else { file.listFiles(this); } return false; } public long getSize() { return _size; } public static void main(String[] args) { DiskUsage du = new DiskUsage(); du.accept(new File("/tmp/1.png")); System.out.println(du.getSize()); } }
Stock Android SIP client set up
Native SIP clients available on some 2.3/4.0 phones. To enable it:
- Settings -> Internet call settings
- Click Accounts, then click "Add account" button
-
- User Name: 888XXXXXXX (Your VOIP account number given by you VOIP service provider)
- Password: XXXXX (Your VOIP password)
- Server: sip.pennytel.com (Your VSP's sip server)
- Tick set as primary account
Mac OS: How to use Java 6 after installed Oracle Java 7
Append the following command to your ~/.bashrc file (if you are using bash:
export JAVA_HOME=`/usr/libexec/java_home -v 1.6`
See also
Re-enable Apple's Java 6 applet plugin after applying Apple's Java Mac OS X 2012-006 Update
- Open Terminal, located in the Utilities folder.Enter this command, then press the Return or Enter key:
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
- Enter this command, then press the Return or Enter key:
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
- Enter this command, then press the Return or Enter key:
sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
- To re-enable Java SE 6 Web Start, enter this command, then press the Return or Enter key:
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
To disable Java SE 6 Web Start opening
Enter this command, then press the Return or Enter key:sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javaws /usr/bin/javawsWhen prompted, enter your administrator password, then press the Return or Enter key.
To re-enable the Java 7 applet plug-in
Download and re-install the Oracle Java 7 JRE from this website: http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.html.Eclipse on Mac OS: Use specific Java VM instead of the platform default version
After apply Apple's Java Mac OS X 2012-006 Update, it remove java plugin for browsers therefore the java applet and webstart applications no longer work. I downloaded Java 7 from Oracle. However, I wants my Eclipse use Java 6:
To specify the Java VM for eclipse, you can edit the file: /Applications/eclipse/Eclipse.app/Contents/Info.plist
<key>Eclipse</key> <array> <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java</string> ... ... ... ... ... </array>
Melbourne Home Visiting Doctors
http://www.mmds.com.au/home-visiting-doctor
When can I request a home visiting doctor?
Weekdays: From 4.00 pm to 8.00 am the next day (overnight)
Weekends: From 10.00 am Saturday until 8.00 am Monday
Public holidays: 24 hours
Please ring your own GP during surgery hours.
If your own GP is available after hours, we will contact him/her for you.
Booking a home visit is easy, either
1. Simply download our free mobile app, enter the patients details and submit the request. Save yourself the cost of a mobile call and possibly waiting on hold. One of our trained, friendly operators will call back quickly to confirm the request, or
2. Phone (03) 9429 5677. Your call will be triaged by our operator and request the following patient details:
When can I request a home visiting doctor?
Weekdays: From 4.00 pm to 8.00 am the next day (overnight)
Weekends: From 10.00 am Saturday until 8.00 am Monday
Public holidays: 24 hours
Please ring your own GP during surgery hours.
If your own GP is available after hours, we will contact him/her for you.
Booking a home visit is easy, either
1. Simply download our free mobile app, enter the patients details and submit the request. Save yourself the cost of a mobile call and possibly waiting on hold. One of our trained, friendly operators will call back quickly to confirm the request, or
2. Phone (03) 9429 5677. Your call will be triaged by our operator and request the following patient details:
- Full name, date of birth and address for the doctor to attend
- The patients regular GP. Please provide the clinics name and phone number. At the end of the consultation, a clinical record will be sent to your GP.
Special HTML codes for math symbols
Display | Friendly Code | Numerical Code | Hex Code | Description |
---|---|---|---|---|
− | − | − | Minus Sign | |
+ | + | + | + | Plus Sign |
± | ± | ± | ± | Plus or Minus Sign |
× | × | × | × | Multiplication Sign |
÷ | ÷ | ÷ | ÷ | Division Sign |
% | % | % | % | Percent Sign |
| ‰ | ‰ | Per Mille Sign (per thousand) | |
= | = | = | = | Equal Sign |
≠ | ≠ | ≠ | Not Equal To Sign | |
≈ | ≈ | ≈ | Approximately Equal Sign | |
≡ | ≡ | ≡ | Identical To Sign | |
< | < | < | < | Less Than Sign |
> | > | > | > | Greater Than Sign |
≤ | ≤ | ≤ | Less Than or Equal To Sign | |
≥ | ≥ | ≥ | Greater Than or Equal To Sign | |
∞ | ∞ | ∞ | Infinity Sign | |
⅛ | ⅛ | ⅛ | One Eighth Fraction | |
¼ | ¼ | ¼ | ¼ | One Quarter Fraction |
⅜ | ⅜ | ⅜ | Three Eighths Fraction | |
½ | ½ | ½ | ½ | One Half Fraction |
⅝ | ⅝ | ⅝ | Five Eighths Fraction | |
¾ | ¾ | ¾ | ¾ | Three Quarters Fraction |
⅞ | ⅞ | ⅞ | Seven Eighths Fraction | |
∫ | ∫ | ∫ | Integral Sign | |
∂ | ∂ | ∂ | Partial Differential Sign | |
∆ | ∆ | ∆ | Increment Sign | |
∏ | ∏ | ∏ | N-ary Product Sign | |
∑ | ∑ | ∑ | N-ary Sum Sign | |
√ | √ | √ | Square Root Sign | |
∟ | ∟ | ∟ | Right Angle Sign | |
∩ | ∩ | ∩ | Intersection Sign | |
∙ | ∙ | ∙ | Bullet Operator | |
| ƒ | ƒ | Function Sign | |
⁄ | ⁄ | ⁄ | Fraction Slash |
六年级小学生王乐乐的感人情书
当我在5.12只想拉着你手跑的时候,我就晓得,我这辈子当不了英雄的哈。
因为我不像那个啥子小英雄林浩那样,在那么害怕的时候还能想着别人,而我,只晓得往外头跑,只拉了你。
你就要去北京了,成都比起北京来说,太小了,楼没得那么高,车没得那么多,人没得那么挤,但感情也没得那么深。
你走了,我没什么好送给你,河边也捡不到像心一样的石头,我没得网银,所以上不了淘宝去买,表姐一天就晓得打游戏,这个忙都不帮我。
你成了我最熟悉的 四川话说的最好的北京人了,至少你屋头的户口本上是这样的,至少你考试的分数线是这样。你就像凤凰一样飞了撒,我很难受,一个暑假都好难受,没精打采的。付胖子经常装着不认识我,指着我对别人说“那个人好奇怪耶,看起来好像一条狗。”
你走了,有些事情不会变的撒,我还是得去读书,去吃东西,我还是会去广福桥吃冒菜,还是得去读书,去吃东西。我还是会点两个人吃的量,虽然有点多,但总有一天会吃完,因为会习惯没有你,因为我会长大。
你走了,我也会变,我会练字,我就是我自己的手机毒霸,管好我自己,少做傻事情的哈。其实聪明人也可以很听话的,至少在没有长大以前。
问你能不能不跟到你爸爸切北京啊,“我不切,一个人在成都你养我”,“我养你啊”,哎,想到就心酸,等着吧。
好了,我不写了。你要好好的,要切煮饭了。成都天气也凉了,北京也一样吧。多穿衣服,多喝热水好了。我们就到这。
以后再遇到起:
好久不见。
你好吗?
我很好!
因为我不像那个啥子小英雄林浩那样,在那么害怕的时候还能想着别人,而我,只晓得往外头跑,只拉了你。
你就要去北京了,成都比起北京来说,太小了,楼没得那么高,车没得那么多,人没得那么挤,但感情也没得那么深。
你走了,我没什么好送给你,河边也捡不到像心一样的石头,我没得网银,所以上不了淘宝去买,表姐一天就晓得打游戏,这个忙都不帮我。
你成了我最熟悉的 四川话说的最好的北京人了,至少你屋头的户口本上是这样的,至少你考试的分数线是这样。你就像凤凰一样飞了撒,我很难受,一个暑假都好难受,没精打采的。付胖子经常装着不认识我,指着我对别人说“那个人好奇怪耶,看起来好像一条狗。”
你走了,有些事情不会变的撒,我还是得去读书,去吃东西,我还是会去广福桥吃冒菜,还是得去读书,去吃东西。我还是会点两个人吃的量,虽然有点多,但总有一天会吃完,因为会习惯没有你,因为我会长大。
你走了,我也会变,我会练字,我就是我自己的手机毒霸,管好我自己,少做傻事情的哈。其实聪明人也可以很听话的,至少在没有长大以前。
问你能不能不跟到你爸爸切北京啊,“我不切,一个人在成都你养我”,“我养你啊”,哎,想到就心酸,等着吧。
好了,我不写了。你要好好的,要切煮饭了。成都天气也凉了,北京也一样吧。多穿衣服,多喝热水好了。我们就到这。
以后再遇到起:
好久不见。
你好吗?
我很好!
Free eBook: Programming Windows 8 Apps with HTML, CSS, and JavaScript
- Programming Windows 8 Apps with HTML, CSS, and JavaScript
- EPUB format is here: http://go.microsoft.com/FWLink/?Linkid=272592 (37.3 MB)
- MOBI format is here: http://go.microsoft.com/FWLink/?Linkid=272591 (69.5 MB)
- companion content
Subscribe to:
Posts (Atom)