Sunday, January 19, 2014
Gerrit+LDAP
Here are the key note for gerrit.conf file
listenUrl = proxy-http://127.0.0.1:8180/
strings that match the following regular expression:
Saturday, January 18, 2014
Apache+openldap without SSL
sudo a2enmod ldap authnz_ldap authn_alias
Scribefire not working now
Tuesday, December 31, 2013
setup openwrt on Asus rt-n15 as wireless client with relayed(Pseudo-bridge)
- rt-n15
netsh interface ip set address name="Local Area Connection" static 192.168.1.2 255.255.255.0 |
root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install relayd
root@OpenWrt:~# opkg install luci-proto-relay
root@OpenWrt:~# /etc/init.d/relayd enable
- use luci to config routed client relayed.
- enable 802.11 bgn(radio0) and scan wireless network.
- join the wireless network and it will ask for passcode, name of the new network(wwan by default) and create/assign firewall zone(select "lan" here)
- create a new network interface (" "stabridge"), select relayed bridge and select connect lan and wwan.
- network firewall under zones, change the forwarding for and lan and wwan to "accept"
openwrt on tp-link wdr4300
the openwrt was installed and configured as routed client relayed, and I need to reset the openwrt to factory default to use it as a WAP, here are the steps
- Power the router up;
- After powering up track the SYS light when it starts to blink, when it does press and hold the WPS/reset button till SYS lights starts to blink faster – router goes to recovery mode;
- Telnet to the router on 192.168.1.1 – no password needed (if your computer doesn’t gets IP address from DHCP assign it manually for i.e. 192.168.1.200 with netmask of 255.255.255.0);
- In telnet terminal type `mtd -r erase rootfs_data` to reset OpenWRT to it’s defaults. then the router will reboot.
- after reboot, telnet in and passwd to set a password.
- use PUTTY to ssh to 192.168.1.1 with username root and the password.
Monday, October 14, 2013
Installation of 389 Directory Server on Ubuntu server 12.04.3 LTS
- sudo apt-get install python-software-properties
- sudo add-apt-repository ppa:ubuntu-389-directory-server/ppa
- sudo apt-get update
- sudo apt-get install 389-admin 389-ds-base 389-ds-console
then
- sudo /usr/sbin/setup-ds-admin
Saturday, October 05, 2013
mysql jdbc input Chinese
in glassfish
Edit JDBC Connection Pool Properties
add properties
Name: characterEncoding
Value: UTF-8
Name: useUnicode
Value: true
Monday, September 30, 2013
setup glassfish and roller
- in .30
- first disable jboss startup by "sudo update-rc.d -f jboss remove"
- create glassfish user and group
- mv glassfish to /usr/local/share/glassfish
- chown to glassfish:galssfish
- create a admin user and password: ./asadmin change-admin-password
- ./asadmin --host 30 --port 4848 enable-secure-admin to allow remote access to admin page
- login to admin and change default http listener port to another number
- copy mydql jdbc driver to /domains/domain1/lib/ext and roller-custom.properties to domain1/lib/classes.
- add jdbc connection pool for roller and jdbc resource for jdbc/rollerdb
- have to create the rollerdata dir in glassfish home and change the properties in roller-customer.properties
- .have to install java jdk7 instead of using jre(jdk-7u40-linux-i586.gz)
- sudo lsof -i tcp and found the job# for glassfish and kill it
- scp the jdk
- jdk-7u40-linux-i586.gz
- sudo mv ./jdk1.7.0_40 /usr/lib/jvm/jdk1.7.0
- sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
- sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
- sudo update-alternatives --install "/usr/bin/javac" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
- sudo chmod a+x /usr/bin/java
- sudo chmod a+x /usr/bin/javac
- sudo chmod a+x /usr/bin/javaws
- sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
- sudo update-alternatives --config java
- sudo update-alternatives --config javac
- sudo /etc/init.d/apparmor restart
- edit /etc/profile.d/java.sh and put
"export JAVA_HOME=/usr/lib/jvm/jdk1.7.0
export PATH=$JAVA_HOME/bin:$PATH"
- restart the server and cd to glassfish/bin sudo ./asadmin craete-srevice
- sudo chmod 755 /usr/local/share/glassfish/glassfish4/glassfish/lib/nadmin
- start the GlassFish-domain1 service.
Sunday, September 22, 2013
glassfish 4 and roller 5.0.1
- get tired of twisting apache roller for jboss EAP, decide to try glassfish 4.0
- downloaded and installed glassfish-4.0.zip full java EE platform
- unziped and copied mysql jdbc to the domain1/lib/ext
- copied roller-custom.properties to domain1/clases
- deployed the download roller-5.0.1-javaee.war
- woala!!, it works.
Lessons learned:
I am not a Java App server guru, but worked more than 2 years with glassfish(3 then 4) and 3 years with jboss EAP(5, then 6)
a lot of applications downloaded from the internet(roller, nexus, and others) will work with glassfish without modification
for jboss, the apps need spend some time painfully sniffing through the source code and a lot of time I have to give up and go back to use glassfish.
This is my first time use glassfish 4, and I did not notice a lot of change between 3 and 4, the speed is decent.
between jboss EAP 5 and EAP6, the change is radical and as a developer, a lot of things I did in EAP 5 are completely different in EAP6.
build roller 5.0.1 ro jboss eap 6.0
- download the roller source and import existing Maven projects into eclipse
- maven clean complie and install roller-project(parent)
- roller-core maven clean compile install with no problem
- roller-planet-business stopped, change pom for guice.
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
- have to copy droptables.sql to source/main/resource/sql
- here are the missing dependency modificaton for roller-weblogger-business
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.oauth.core</groupId>
<artifactId>oauth</artifactId>
<version>20100527</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.oauth.core</groupId>
<artifactId>oauth-provider</artifactId>
<version>20100527</version>
<scope>compile</scope>
</dependency>
- added the net.oauth dependency to roller-weblogger-webapp and roller-weblogger-web and compliled them.
- deployed roller-weblogger-webapp to jboss
- tried a lot of things and installed jboss eap6.10, still not working
Saturday, September 21, 2013
maven nexus, apache roller
- nexus on both 30 and 40.
- downloaded source for roller and will try to install roller in jboss eap 6.0
Wednesday, September 11, 2013
Restore Roller Mydql Database
- use ubuntu live cd and choose " fix broken installation"
- mount a usb to /media/external by choose the use from "sudo fdisk -l"
- installed new ubuntu server 12.04 LTS from burned cd(tried usb and DVD not working).
- installed mysql server after server started(LAMP won't work because of dns issue of home).
- mount usb and copy roller dir to /var/lib/mysql
- sudo service mysql stop
- sudo chmod -R 660 /var/lib/mysql/roller/
- sudo chmod 700 /var/lib/mysql/roller
- sudo chown -R -f mysql:mysql /var/lib/mysql/roller
- service mysql start
- mysqlcheck --repair --all-databases
- need to dump the roller db regularly, the weblogentry table is the most important.
mysql in ubuntu 12.04 LTS allow remote access
#Replace xxx with your IP Address
bind-address = xxx.xxx.xxx.xxx
bind-address = 0.0.0.0 if you don't want to specify the IPlsof -i -P | grep :3306
mysqld 1046 mysql 10u IPv4 5203 0t0 TCP xxx.xxx.xxx.xxx:3306 (LISTEN)
Before granting user access, you need to login MySQL.
$ mysql -u root -p
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';
GRANT ALL ON *.* TO 'myuser'@'localhost';
GRANT ALL ON *.* TO 'myuser'@'%';
Thursday, August 12, 2010
jsf, spring security and jstl
<--c:forEach items='${sessionScope}' var='p'>
<--ul>
<--li>Parameter Name: <--h:outputtext value="'${p.key}'/"><--/li>
<--li>Parameter Value: <--h:outputtext value="'${p.value}'/"><--/li>
<--/ul>
<--/c:forEach>
You logged in as <--h:outputtext value="${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}">
-->
Tuesday, June 02, 2009
I delete my glassfish by accident from netbeans, so,I tried to put it back by using add server in netbeans, but the add server wizard won’t show up.
It turns out to be there is a bug with jdk6 update12 and netbeans, so I have to download and install jdk6 update11. And start netbeans from command line with jdk6u11.
Here is the command \dir\NetBeans 6.5\bin>netbeans.exe --jdkhome "\dir\jdk1.6.0_11"
now I can add my glassfish server back to netbeans
Friday, February 22, 2008
Java vs Python (Random thought)
Java | Python |
Statically typed | Dynamically typed |
Not compact, (through class) | Compact (scripting like) |
GUI, swing, has a lot of nice widgets | Tkinter by default, |
Bracket and semicolon | Colon and space |
Javac compile into byte code | Command line interpreter |
Parameter pass by value ( a value of reference to an object) | Parameter pass by value( a value of reference to an object) |
Reference:
Thursday, March 01, 2007
我们先看LCD取景存在的弊端:
(1)LCD取景非常费电。
(2)LCD取景根据光线强弱自动调节感光度,使拍摄所得和实际所见不一致,特别是在光线较暗时。
(3)LCD取景要求机械快门一直打开,结果导致曝光动作繁琐,快门迟滞延长,不利于连拍和抓拍。 由于弊端(2)的存在,很多情况下不得不求助于光学取景器;但DC上的旁轴取景器又存在像差,这给拍摄带来了无法解决的难题。
所以从现在看来,保留反光取景还是很有必要的。
观点二、DSLR不是数码相机的终结者 这个观点笔者持同意态度。就是在目前,数码相机的种类也不是只有数码单反一种,还有DC和120数码后背等多种形态,只是众多不同类型的数码相机适用范围不同。它们有各自不同的市场定位。 再看DSLR的CCD(包括DC的),由于CCD对光线色彩没有识别能力,只能通过在一块CCD前增加低通滤波器来感应不同的颜色(R,G,B),红、绿、蓝三种颜色紧密排列,CPU再很据插值算法来还原得到图像,所以数码相机只是对外界模拟信号的数字化,并不是完整的记录,因此数码相机目前和传统相机的成像差距仍然存在。
有没有更好的办法改进提高数码相机模仿外界模拟信号的精度呢?答案是肯定的,比如应用于专业摄像机的3CCD技术。3CCD技术就是用3块CCD来分别感知如射光线的RGB三种色彩,再根据套色算法合成全彩图像。但要实现3CCD技术,目前的DSLR和DC的内部结构都不能满足(镜头后截距的限制),应此相机结构将发生彻底的改变,而先前的单反镜头也将不再适用。至于CCD/CMOS将来朝哪个方向发展,现在就不得而知了。或许现在盼望的135满画幅的尺寸到那时已经远不能满足需求。
新结构带来的不只是机身上的参数变更,影响更多的恐怕在于镜头生产商的镜头群。尼康,佳能,腾龙,适马等各镜头生产厂家,花费数十年到目前形成了规模庞大的通用镜头群,如果一旦单反相机由新机型取代,那么意味着,各镜头生产厂家必修更换生产线内容,重新开发一系列适用于新机型的镜头群,这个时间需要多久呢?2年?5年?10年?还是更长的时间?
我们玩摄影,应该从“利己”出发,而不应该从“不利他”出发。所谓“利己”和“不利他”就是说,选择有利于我们创作使用的相机,为我们所利用,而不是因为目前相机技术不够成熟而不用(如DSLR),更有甚者,认为购买使用DSLR是为DLSR生产商做试验,从思想上抵制DSLR;有这样想法的人最终只能是终日等待。俗话说,“临渊羡鱼,不如退而结网”,说的就是这个道理。
I am looking for a DSLR. This is something I find useful