POP Keywords: android apache sybase ...

unix – count number of files inside a folder

Simply run following command line: ll *.xml | wc -l in above example, we are counting number of files ending with .xml => feel free to adapt this query

Connect to Oracle DB from Excel

Steps to connect to oracle db using TNS on windows xp & excel 2010 [A. create and configure TNS] create file named tnsnames.ora under c:\oracle\tnsnames\ and store tns definition as per below (as example only): LOCALORCL11R2V = ( DESCRIPTION=( ADDRESS_LIST=(LOAD_BALANCE=ON)(FAILOVER=ON)( ADDRESS=(PROTOCOL=TCP)(HOST=<server1>)(PORT=1521) )( ADDRESS=(PROTOCOL=TCP)(HOST=<server2>)(PORT=1521) )( ADDRESS=(PROTOCOL=TCP)(HOST=<server3>)(PORT=1521) )( ADDRESS=(PROTOCOL=TCP)(HOST=<server4>)(PORT=1521) ) )( CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=<service_name>) ) ) set up global variable TNS_ADMIN to point to folder where tnsnames.ora file has been created click on start menu > right click on computer name > select “properties” as per below screenshot go to “Advanced” tab > click on “Environment Variables” > “New” and create variable TNS_ADMIN to make it […]

linux: search text in files matching specific name

Combination of “find” and “grep” as follows: find . -type f -name “*.xml” -exec grep -H “<needle>” {} \; notes: this example is searching for files in current folder (“.”) with name ending in “.xml” (“*.xml”) and looking having word “<needle>”, -H option will print names of files for which condition is matched sources http://stackoverflow.com/questions/21763904/linux-find-and-grep-command-together  

Sybase: list all tables with row counts

– sybase: list all existing tables with their rowcount select ob.name,st.rowcnt from sysobjects ob, systabstats st where ob.type=’U’and st.id=ob.id order by ob.name Pretty useful when filtering out empty tables, sorting by rowcount number and co sources: http://stackoverflow.com/questions/18195355/how-to-list-all-the-user-tables-in-sybase-along-with-their-rowcount

RTL8723BE realtek wifi chipset to work on ubuntu 14.04 [solved]

This wifi chipset is quite new and not working out of the box. Steps to get it work: ensure you have the appropriate chipset: lspci | grep RTL8723BE 02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter compile and load specific driver by running following commands: sudo apt-get install linux-headers-generic build-essential git git clone http://github.com/lwfinger/rtl8723be cd rtl8723be git checkout 604aa9058fb9e5bb1cf571c99989d081f8fc8b9 make sudo make install sudo modprobe rtl8723be That’s it! For me it worked like charm. sources http://ubuntuforums.org/showthread.php?t=2205497

run virtualbox on kimsufi server

Just bought a low-end kimsufi server (atom D425) and tried to run virtualbox on it. Host os is Ubuntu Desktop 14.02 Proceed as follow revert to Ubuntu stock kernel instead of tweaked ovh one: [UPDATE: ignore this section, rather simply use advanced mode when installing distribution and select to use native distribution kernel] sudo apt-get install linux-image-server mkdir ~/ovh.d/ sudo mv /etc/grub.d/06_OVHkernel ~/ovh.d sudo update-grub sudo apt-get install linux-headers-generic restart machine sudo shutdown -r -f now install virtualbox //sudo apt-get install virtualbox // update: do not do this since version in ubuntu repository is quite old, download from www.virtualbox.org instead […]

RMI local class incompatible

When loading external classes using RMI, it is key to compile against same jars as the ones used in target system. If not, RMi local class incompatible error can be thrown because class id between two jar compilations will be different. As such serialization and de serialization will not work properly, throwing this error. Re-mediation is to always fetch jars corresponding to the environment against which app is developed and place them in the classpath. sources http://craftingjava.blogspot.com.au/2012/06/javaioinvalidclassexception-local-class.html http://www.coderanch.com/t/571958/java/java/Invalid-Class-Exception-serialization http://docs.oracle.com/javase/tutorial/rmi/compiling.html

oracle 11g – load dump exported with expdp

Identifed steps to import dump on Oracle Database 11g Express Edition Release – 64bit Production Step 1. log in as sysadmin all steps below are to be done when logged as sysadmin (username: SYS, pwd:XXX) in case password is forgotten, log into oracle box with user used to install oracle and no password will be asked when connecting using below command line: sqlplus / as sysadmin note: if password for unix user used to install oracle is also forgottern, log in with any user then su to be root then su <user_used_to_install_oracle> Step 1. create same user as used […]

xml indentation in linux

XML beautifier in linux can be easily done using libxml tools. install xml library sudo apt-get install libxml2-utils Run the following command xmllint –format –output <path_to_output> <input_file> That’s it! Apparently this tool can be used for smooth integration within gedit but this made gedit crash on my computer. sources http://www.andrejkoelewijn.com/blog/2012/04/11/formatting-xml-documents-with-gedit-and-tidy/ http://andalinux.wordpress.com/2011/11/21/pretty-printer-de-xml-en-gedit/ http://andalinux.wordpress.com/2010/07/19/gedit-avanzado-ejecutar-scripts-desde-el-editor/

tips for easier development with java

Java is quite verbose and can be very frustrating when being used to more “efficient” languages. Fortunately some guys out there are trying to make things simpler… How-to list join / concatenate list of strings: StringUtils.join(List<String>, String join); // import org.apache.commons.lang3.StringUtils; split a string: StringUtils.split(String str, String sep);// import org.apache.commons.lang3.StringUtils; read entire file and store into a string (JDK 7): StringUtils.join(Files.readAllLines(Paths.get(“file”), StandardCharsets.UTF_8)); // import org.apache.commons.lang3.StringUtils; switch perspective in eclipse: CTRL+F8 CLI library: commons-cli // http://commons.apache.org/proper/commons-cli/ convert list of strings into list of integers: for(String s : strList) intList.add(Integer.valueOf(s)); list folder content: use FileUtils.listFiles from Apache commons get stack trace as […]