Skip to content

Instantly share code, notes, and snippets.

@vunb
vunb / addLoadEvent
Last active December 16, 2015 11:39
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function' ) {
window.onload = func;
else {
window.onload = function() {
oldonload();
func();
}
}
@vunb
vunb / shared_folder_centos_virtualbox.txt
Created June 26, 2013 17:09
Error when install VBox Guest Additions in CentOs 5.5 .. 6.4 I found this solution to complete installation and access shared folder
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
@vunb
vunb / rdesktop-remote-command
Created October 8, 2013 03:17
Shell thực hiện remote desktop
#rdesktop -u [username] -p [password] [ip host server] -g [resolution]
rdesktop -u vunb -p 123456a@ 10.2.4.34 -g 1280x800
@vunb
vunb / sqldeveloper-jdk-profile
Created October 9, 2013 08:54
Cài sqlDeveloper nhưng không thể start được do chưa thiết lập đường dẫn java jdk
[vi@Manlab java-openjdk]$ mkdir ~/.sqldeveloper
[vi@Manlab java-openjdk]$ echo "/usr/lib/jvm/java-openjdk" > ~/.sqldeveloper/jdk
[vi@Manlab java-openjdk]$ sqldeveloper
Oracle SQL Developer
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
@vunb
vunb / oracle-create-a-diagram-database
Created October 9, 2013 09:16
Tạo Db diagram Oracle
To create a diagram for existing database schema or its subset:
File → Data Modeler → Import → Data Dictionary → select DB connection (add if none) → Next → last few steps intuitive.
(SQL Developer version 3.2.09.23.)
@vunb
vunb / applicationContext-resources-tr069-adapter.xml
Last active December 25, 2015 18:39
Lỗi xảy ra khi load 2 file config xml có khai báo beans trùng nhau (conflict Beans): - Thông báo lỗi: org.hibernate.HibernateException: merge is not valid without active transaction hoặc lỗi: org.hibernate.HibernateException: No Session found for current thread <br/> Ref: http://stackoverflow.com/questions/15488701/spring-3-with-hibernate-4-unit…
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<import resource="classpath*:applicationContext-service.xml"/>
<import resource="classpath*:applicationContext-dao.xml"/>
<import resource="classpath*:applicationContext.xml"/>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true"/>
@vunb
vunb / pocketsphinx_continuous.sh
Created October 17, 2013 16:50
Command to recognize speech
pocketsphinx_continuous.exe -hmm hub4wsj_sc_8k -jsgf hello.gram -dict hub4.5000.dic
pocketsphinx_continuous.exe -hmm an4.cd_cont_1000 -lm an4.ug.lm.DMP -dict an4.dic
@vunb
vunb / Cấu hình Centos đi ra ngoài mạng sử dụng nhiều gateway
Created October 21, 2013 05:03
Cấu hình Centos sử dụng 2 gateway và đi ra ngoài mạng
1. Sao chép cấu hình interface theo thứ tự, ifcfg-eth0:0
[root@Manlab network-scripts]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
2. cấu hình các tham số cấu hình file ifcfg-eth0:0 phù hợp với mong muốn
- NAME
- DEVICE
- IPADDR
- GATEWAY
- DNS1/DNS2
@vunb
vunb / Audio Script note
Last active December 26, 2015 06:59
Các công cụ hỗ trợ ghi âm + đồng bộ văn bản scripts
Windows phone
http://www.windowsphone.com/en-us/store/app/anynote/cb7112e1-5bc1-400c-85f2-95adaf35a677
Android
https://play.google.com/store/apps/details?id=com.luminant.audionote&hl=en
https://play.google.com/store/apps/details?id=com.khymaera.android.listnotefree
https://play.google.com/store/apps/details?id=com.flufflydelusions.app.enotesclassic&hl=en
[vi@Manlab snmp-poller]$ mvn install:install-file -Dfile=lib/snmp4j-2.1.0.jar -DgroupId=org.snmp4j -DartifactId=snmp4j -Dversion=2.1.0 -Dpackaging=jar
Ref: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html