Connecting to Nook Color from LMDE

September 19, 2011
sudo gedit /etc/udev/rules.d/51-android.rules

SUBSYSTEM==”usb”, ATTR{idVendor}=”2080″, MODE=”0666″(2080 is from lsusb)

sudo service udev stop && sudo service udev start
sudo sh -c “mkdir -p ~/.android; echo 0×2080 > ~/.android/adb_usb.ini; adb kill-server; adb devices”
Maybe we need to run “mkdir -p ~/.android; echo 0×2080 > ~/.android/adb_usb.ini” as a regular user as well.
Then `adb kill-server; adb start-server; adb devices’ from a regular user (not root) also show the Nook Color.

6 words that make your resume suck

December 14, 2009
A good place to play with jQuery & html
Buy this Technocel Ear Vibe Headset

here

25 maybe-useful Linux commands

December 1, 2009
sshfs name@server:/path/to/folder /path/to/mount/point: install SSHFS from http://fuse.sourceforge.net/sshfs.html
!!:gs/foo/bar: run previous command replacing foo with bar
sudo !!: run the last command as root
mount | column -t: nice layout for mount
<space> command: execute a command without saving it in the history
dig +short txt <keyword>.wp.dg.cx: query Wikipedia via console over DNS (the keyword must be single word)
netstat -tlnp: lists all listening ports together with the PID of the associated process. The PID will only be printed if you’re holding a root equivalent ID.
echo “ls -l” | at midnight
curl -u user:pass -d status=”Tweeting from the shell” http://twitter.com/statuses/update.xml
ssh -N -L2001:localhost:80 somemachine: start a tunnel from some machine’s port 80 to your local post 2001. Now you can acces the website by going to http://localhost:2001/
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg: Capture video of a linux desktop
> file.txt: empty a file
$ssh-copy-id user@host: Copy ssh keys to user@host to enable password-less ssh logins. To generate the keys use the command ssh-keygen
ctrl-x e: Rapidly invoke an editor to write a long, complex, or tricky command. Next time you are using your shell, try typing ctrl-x e (that is holding control key press x and then e). The shell will take what you’ve written on the command line thus far and paste it into the editor specified by $EDITOR.
mtr google.com: mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool
cp filename{,.bak}: quickly backup or copy a file with bash
cd -: change to the previous working directory

Non-singleton (prototype) Spring beans

November 18, 2009
I have Spring beans A and B. I’d like to have a new instance of B on each method invocation on A.
- First, A should be a singleton bean and B is a prototype bean.
- Bean A can be made to be aware of the container by implementing BeanFactoryAware like this:
public class BeanA implements BeanFactoryAware {
  private BeanFactory beanFactory;
  // setter for beanFactory
  public void needNewInstanceOfB() {
    (BeanB) beanFactory.getBean("beanB");
  }
}

Note: not a desirable solution since the business code is aware of and coupled to the Spring framework. So, use method injection.

public abstract class BeanA {
  public void needNewInstanceOfB() {
    BeanB newB = createNewB();
  }
  protected abstract BeanB createNewB();
}

<bean id=”beanB” class=”BeanB” scope=”prototype”/>
<bean id=”beanA” class=”BeanA”>
  <lookup-method name=”createNewB” bean=”beanB”/>
</bean>

Spring 3.0 & JUnit 4 test suites

tmp

November 9, 2009
discoverbank belylun
wowebookjoinebook
f346500@uggsrock
http://db.tt/pKsJwmK
dvbhet@nexasinc
http://db.tt/nYCXlmg
  1. Acrobat X Pro (thethingy)
  2. Adobe Photoshop Lightroom 3.4 (thethingy)
  3. windows XP SP3 Mar 11
  4. TurboTax 2010
  5. MS Office 2010 Word, Excel, Powerpoint x86 x64 (thethingy)
    look for thethingy’s activator
dbxxx001@yahoo
http://db.tt/UMksMPu
dbxxx002@yahoo
http://db.tt/gt4HG2Y
  1. Ly’s movies & pix (end of kinder garten class)
dbxxx003@yahoo
http://db.tt/FxkRCVx
  1. ABBYY Fine Reader Corporate Edition v10.0.102.130 Multilang
heyman@nexasinc
http://db.tt/UxCFii8
  1. MP3
  2. Xmas 2010 Pix
dbxxx004@yahoo
http://db.tt/iFbnSR3
dbxxx005@yahoo
http://db.tt/Uw7ugJj
dbxxx006@yahoo
http://db.tt/MopVApm
Google Map Icon Marker
IDM UltraEdit v16.00 be Ly Lun – FHBKI-NIHOC-IVGXU-SIFNB-LPLIK-BFMHJ-QJGKY-QKJNN
My IP: 192.168.1.184 – jupiter: 192.168.1.15 – insite: 192.168.1.16 – repository: 192.168.1.26 (username: tdangvu)
sudo openconnect -u thaidangvu webvpn.dovetailsystems.com
sudo route add -net 192.168.1.0 netmask 255.255.255.0 dev tun0
rdesktop -u tdangvu -d dovetail.net -p P@ssw0rd -k en-us -z -P -g 1676×1000 192.168.1.184

smbmount is deprecated:

sudo smbmount //192.168.0.99/shm /tmp/shm -o username=ly,password=abc123,domain=WORKGROUP,rw

mount -t cifs //SERVER/SHARENAME MOUNTPOINT -o user=USERNAME,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP
Dropping connected DB users as a DBA:
select sid, serial# from v$session where username = ‘your_schema
alter system kill session ‘sid,serial#

Brilliant Adobe Photoshope CS5 tutorials from 2010
Reverse Engineering a Data Model (tables, stored procedures, functions…) using Oracle data dictionary.
Restarting NetworkManager

sudo service network-manager stop; sudo rm -f /var/lib/NetworkManager/NetworkManager.state; sudo service network-manager start
How to find invalid functions/procedures/packages:

select OBJECT_NAME from USER_OBJECTS where STATUS = 'INVALID' and (OBJECT_TYPE like '%FUCNTION%' or OBJECT_TYPE like '%PROCEDURE%' or OBJECT_TYPE like '%PACKAGE%')

How to re-compile a function/procedure/package:

alter OBJECT_TYPE OBJECT_NAME compile







Convert pdf to jpeq using gs
gs -sDEVICE=jpeg -o bar_%03d.jpg -dJPEGQ=95 -r600x600 -g4960x7016 foo.pdf
    * -o: determines output path+filename (and saves usage of -dBATCH -dNOPAUSE)
    * -dJPEGQ: sets JPEG quality to 95%
    * -r: sets resolution to 600dpi
    * -g: sets image size to 4960x7016px
    * -sDEVICE: sets output as JPEG
Jetty Maven Plugin for Jetty 7 which supports Servlet 2.5 (not 3.0)
Amazon offers free web services for a year
Andy Gibson is also an interesting name in the JavaEE world.
Upload an image of your font here then use this to find the font (it has images of all the characters in different sizes)
Bad solution:

<div style="clear:both;"></div>

Perfect cross browser solution: apply the clearfix class to any container that needs to be cleared.

.clearfix:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
}
* html .clearfix             { zoom: 1; } /* IE6 */
*:first-child+html .clearfix { zoom: 1; } /* IE7 */
Avoid switch, Use enum

Java EE 5 & 6 web app archetypes

<dependency>
  <groupId>org.codehaus.mojo.archetypes</groupId>
  <artifactId>webapp-jee5</artifactId>
  <version>1.3</version>
</dependency>
<dependency>
  <groupId>org.codehaus.mojo.archetypes</groupId>
  <artifactId>webapp-javaee6</artifactId>
  <version>1.5</version>
</dependency>
<dependency>
  <groupId>org.jboss.spec.archetypes</groupId>
  <artifactId>jboss-javaee6-webapp-ear-archetype</artifactId>
  <version>7.0.2.CR2</version>
</dependency>
3 free audiobooks + $20 credit
1. Click here to sign up to get free 2 credits for new customers only.
2. Confirm that you have two credits by looking at the top right corner of the page. It should say “Credits: 2″
3. Go to “Account Details” and click on “Change My Membership”
4. Scroll down to the bottom of the page and click “Cancel Membership” (don’t worry, we are not canceling the membership)
5. When they ask for a reason, select something like “I’m trying to reduce expense” and continue.
6. They will offer you 50% discount for first three months on membership. Take that discount and stay a member.
7. Start at step 3 and this time for Step 6, they will offer you a $20 credit. Take the credit and stay a member.
8. Start at step 3 and at step 5, select “I did not like what I listened to” and continue.
9. They will offer you 1 more free credit. Take the credit and stay a member.
jQuery File Upload on GitHub
Logging for Hibernate
log4j.logger.org.hibernate.type = trace

Hibernate: INSERT INTO t (ID, VAL) VALUES (?, ?)
13:33:07,253 DEBUG FloatType:133 - binding '10.0' to parameter: 1
13:33:07,253 DEBUG FloatType:133 - binding '1.1' to parameter: 2
tmpfs /run/lock tmpfs nodev,noexec,nosuid,size=52428800,mode=1777 0 0
tmpfs /run/shm tmpfs nosuid,nodev,size=70%,mode=1777 0 0
IntelliJ Idea 10 Linux be Ly 20014-FTWNV-I1VEB-RSAK5-45PY5-CH735
IntelliJ Idea 11 Linux be Ly 44763-JGT3G-YWC50-5OPN1-OL8D4-H67Y4
To start the listener LISTENER: /u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER

Marat Safin – The World’s Greatest

November 8, 2009

Permutation

November 5, 2009
List<String> permute(String s) {
        if (s == null) {
        return null;
    }
    final List<String> result = new ArrayList<String>();
    if (s.length() == 0 || s.length() == 1) {
        result.add(s);
        return result;
    }
    for (int i = 0; i < s.length(); i++) {
        String news = s.substring(0, i) + s.substring(i+1);
        for (String t : permute(news)) {
            result.add(s.charAt(i) + t);
        }
    }
    return result;
}
List<List<Integer>> permute(List<Integer> list) {
    if (list == null) {
        return null;
    }
    final List<List<Integer>> result = new ArrayList<List<Integer>>();
    if (list.isEmpty() || list.size() == 1) {
        result.add(list);
        return result;
    }
    for (Integer x : list) {
        List<Integer> newList = new ArrayList<Integer>();
        newList.addAll(list);
        newList.remove(x);
        for (List<Integer> subList : permute(newList)) {
            subList.add(x);
            result.add(subList);
        }
    }
    return result;
}

Export & Import with Oracle 10g data pump

November 4, 2009
If you want to export to a file, create a database DIRECTORY object for the output directory and grant access to whoever doing the exports and imports:
create or replace directory dumpdir as 'c:\';
grant read, write on directory dumpdir to scott;
For user whose schema will be exported:
expdp userschema/password@xe directory=dumpdir dumpfile=file.dmp
impdp userschema/anotherpassword@xe schemas=userschema directory=dumpdir dumpfile=file.dmp
And this is the conventional way (using exp/imp):
exp fusionapp/fusionapp_fp07@TID102B file=quantum.dmp owner=fusionapp grants=y rows=y compress=y
imp fusionapp/fusionapp_fp07@TID102B FROMUSER=fusionapp TOUSER=fusionapp FILE=blake.dmp
Oracle 11g R2 to solve sudoku with 1 sql statement link or here

Seamania

November 2, 2009
This topic shows a way to start a conversation when a page is requested and end that conversation when we leave the page.
<page id="/*">
    <action execute="#{conversation.begin}" postback="true"/>
    <action execute="#{conversation.end}" postback="false"/>
</page>
@Asynchronous: call methods annotated with @Asynchronous when an event happens on the client (search for it in the Seam reference guide).

Gonna rent a car?

November 2, 2009
mousesavers.com/rentalcar.html
carrentalsavers.com

Follow

Get every new post delivered to your Inbox.