mount error(1)

After reinstalling ubuntu 10.04.3, I couldn’t remount to the share drive unless using sudo. I kept getting the error message: mount error(1): Operation not permitted. After a little bit digging, this post solved the problem perfectly!

August 9, 2011 at 10:57 pm Leave a comment

Reinstalling GRUB

Lots of post mentioned that before. I recently reinstalled Ubuntu and I had three drives in my computer. After installation, I wanted to remove one of the drive since it appears that the system was extremely slow and unstable with all three drives plugged in. I suspect that it was a power problem since I had a power hungry NVidia video card installed also.

Unfortunately, GRUB was not installed in the “right drive” but exactly the drive I wanted to remove. Anyway, the command to save the day is

dpkg-reconfigure grub-pc

Just run it after getting into Ubuntu.

August 9, 2011 at 10:37 pm Leave a comment

Ubuntu installation on nvidia computer

My harddrive died recently and so I reinstalled ubuntu. I got fed up with new release breaking tiny things often. So I tried to stick with LTS this time (10.04 when I wrote this).

I have an NVidia  graphic card and dual monitor. I recalled troubles already from my previous experience of installing Ubuntu. I was sorry that I didn’t drop down some notes. This would have saved me lots of time.

First, desktop installation CD doesn’t work because of the video driver problem. It actually can’t even boot to the installation screen (more video problem discussion later on).

So I tried the alternate CD. But somehow ubuntu kept complaining the disk was bad. Even though it passed the integrity test. After wasting two disks, I decide to use USB installation instead.

USB installation is okay. But then I still have problem with the video driver. The system was “frozen” (I could moved my mouse) after I tried to login. I finally was able to get into Gnome through failsafe graphic mode (select recovery in Grub and then failsafeX in recovery menu).  After get into Gnome, pick Hardware Drivers from Administration. After activating NVidia driver, I finally was able to get into Gnome in normal mode.

August 9, 2011 at 6:20 pm Leave a comment

Invite people in google plus who are already in your circle

I love google plus so far. I don’t use facebook as much as I wanted to because I don’t like the idea of sharing photos indifferently to both true friends, and well…, friends. The idea of “circle” in google plus is ingenious. And yet, it is so obvious that I really don’t know why until now someone thinks of that.

Anyhow, about the title problem, I didn’t pay attention that I should always invite my friends after putting like 100 or so contacts into different circles. If you are just like me that forgetting to click the “Invite so and so to google +” button at the lower left bottom before closing the page, how should you invite the names again? Send invite one by one by typing their emails? No way!

Okay. It probably is not the best way. But I couldn’t find a function to do it (function like “send invite to anyone without plus account in the selected circle”). Anyway, what I suggest below is reasonably easy to do (only several steps).

  1. Right click the circle where you forgot to invite people, select “View circle in tab”.
  2. Click the people you want to invite (or simple use the “select all” function from “more actions” in the upper right tabs).
  3. Drag the selected people to “drop here to create a new circle”
  4. Create a tmp circle. Now, you have the option to invite the ones who don’t have google plus account again. Of course, you probably want to delete the tmp circle afterward.

 

July 13, 2011 at 3:47 am Leave a comment

Slow printing on 10.10

This post is a real life saver. Tested on 10.10 64 bit HP 1320. Works like a charm!

March 2, 2011 at 12:05 am Leave a comment

Setup key for nx and ssh

It took me quite many hours. There are many posts online but at the same time many of them lead to dead ends. As mentioned in this post, the instruction described on help.ubuntu.com allows one to setup custom key but at the same time leaves a big security hole on ssh. Because everyone can ssh to your server without the need of a key. Here is what I did to patch such hole. After the whole procedure, password authentication for ssh will be blocked and custom key will be used for nx. I tested it in Ubuntu 10.10. After more testing, everything is fine but I can’t resume session. Still need more fixing!

  1. Instead of using ssh, it is better to use SU to authenticate. I am mostly following this thread (it has a script there that probably handles Steps 1 and 2 here but I’m not very comfortable running “unidentified” script on my working computer and so I didn’t try).
    1. Modify /etc/nxserver/node.conf to set ENABLE_SU_AUTHENTICATION=”1″ and the rest (ENABLE_SSH_AUTHENTICATION, ENABLE_USERMODE_AUTHENTICATION, ENABLE_PASSDB_AUTHENTICATION) to “0”.
    2. Restart nxserver by running sudo /etc/init.d/freenx-server restart
    3. If everything is going well, you can now try to shut down password authentication for ssh as follows:
      • Add or uncomment “PasswordAuthentication no” in /etc/ssh/sshd_config
      • Restart sshd by sudo service ssh restart
    4. If nx still works well, you may want to change sshd_config back to allow password authentication for the moment
  2. Now, let us set custom key as described in help.ubuntu.com as follows.
    1. Run sudo dpkg-reconfigure freenx-server and select “Create new custom keys” (or “Custom keys” if you have created keys before and don’t want to change them).
    2. In the next page, you should select SU for authentication.
    3. The above steps (2.a and 2.b) don’t work to me. It probably doesn’t work for you also if you have the “unknown job: freenx-server” error. Basically, new custom keys were not made for me. However, sudo /usr/lib/nx/nxkeygen did the job.
    4. After configuration, you need to distribute the public key to clients that want to login to your server. The key is stored at /var/lib/nxserver/home/.ssh/client.id_dsa.key. You will need root privilege to access or copy it.
    5. For Windows, you can change the key in NX Client at Configure->General->Key->Import. Or you can also directly copy the content of client.id_dsa.key to DSA Key window.
    6. For Linux, qtnx is pretty screwed up with key management. See this post if you have problem trying to have custom key worked (actually please leave me a message if you figure out how to make qtnx gui worked correctly with your custom key. I definitely want to know!). I just realized that NX Client supports Linux also. So it probably easier to just use NX Client instead of qtnx.
  3. If you disable “password authentication” as suggested earlier, ssh will not work anymore unless you setup a key. Setting up key is relatively easy.
    1. ssh-keygen -t rsa (or ssh-keygen -t dsa) [I’m still not sure which one should be used always; I will suggest simply try both.]
    2. Copy the content of public key files (id_rsa.pub, id_dsa.pub) to the authorized_keys file on the remote server. This step is a bit counter-intuitive at first. But it is actually very easy to understand. When a client tries to login, the server looks into all public keys (locks) in the authorizedkeysfile and see if the client can open any of the locks. If the client is successful, the server can be certain the client is authentic.
    3. Also you need to check /etc/ssh/sshd_config to make sure that the AuthorizedKeysFile is actually defined and pointed correctly to the authorized_keys file on the server. The following two lines work for me:
      • AuthorizedKeysFile /var/lib/nxserver/home/.ssh/authorized_keys2
      • AuthorizedKeysFile2 %h/.ssh/authorized_keys
    4. Instead of going through Step 3.b above, you may also use ssh-copy-id user@remote_server to transfer your keys directly if you haven’t set password authentication to “no” yet.
  4. If everything is working fine, remember to add “PasswordAuthentication no” back to /etc/ssh/sshd_config and restart ssh server (sudo service ssh restart).

If you have problem to resume session, try to set ENABLE_SLAVE=”0″ inside /etc/nxserver/node.config.

Below are the final /etc/ssh/sshd_config and /etc/nxserver/node.config that seem to work for me. The version I am using is NXSERVER – Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)

(more…)

February 26, 2011 at 6:35 am Leave a comment

Ubuntu share folders

I used to use Samba to share folders between my laptop and my desktop. It works fine until 10.10 that Ubuntu decided to act crazy and screw the whole mount.cifs thing. I still managed to share the folders for a while after some tweaks with /etc/fstab. But today it is just not working anymore. I got the “Unable to find suitable address” error throughout.

I guess I am through with Samba. I did try NFS using this and it seems to working fine now.

 

January 31, 2011 at 9:19 pm Leave a comment

Deferred binding failure in GWT

I am a total newbie to GWT/GAE framework. I was playing and modifying an objectify sample code myself last night and get into a “deferred binding failure” error. What I did is to add another entity class and extend classes PersistentService, PersistentServiceImp, and PersistentSerivceAsync to persist my data. I first ran the code as Web Application. OnModuleLoad threw an exception and gave me the following rather cryptic errors.

Java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:616)
 at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
 at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
 at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
 at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
 at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.example.myproject.client.PersistentService' (did you forget to inherit a required module?)
 at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
 at com.google.gwt.core.client.GWT.create(GWT.java:97)
 at com.example.myproject.client.UserRequestUI.(UserRequestUI.java:31)
 at com.example.myproject.client.ObjectifyExample.onModuleLoad(ObjectifyExample.java:30)
 ... 9 more
Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
 at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:595)
 at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
 at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
 ... 12 more

I dug into the web and it seems that there are zillions of ways getting into deferred binding failure. Since I just started yesterday, it took me long time to figure out that I should try compiling first instead. And I got some less obscure (a bit more informative) errors.

Compiling module com.example.myproject.ObjectifyExample
 [ERROR] Errors in 'file:/home/xxx/workspace/yyy/src/com/example/myproject/client/ObjectifyExample.java'
 [ERROR] Line 22:  Failed to resolve 'com.example.myproject.client.PersistentService' via deferred binding
 Scanning for additional dependencies: jar:file:/home/xxx/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.1.1_2.1.1.v201012170127/gwt-2.1.1/gwt-user.jar!/com/google/gwt/core/client/impl/AsyncFragmentLoader.java
 [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
 [WARN] com.example.myproject.client.PersistentService_Proxy
 [ERROR] Errors in 'file:/home/xxx/workspace/yyy/src/com/example/myproject/client/ProviderSearchUI.java'
 [ERROR] Line 27:  Failed to resolve 'com.example.myproject.client.PersistentService' via deferred binding
 Scanning for additional dependencies: file:/home/xxx/workspace/yyy/src/com/example/myproject/client/UserRequestUI.java
 [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
 [WARN] com.example.myproject.client.PersistentService_Proxy
 [ERROR] Errors in 'file:/home/xxx/workspace/yyy/src/com/example/myproject/client/UserRequestUI.java'
 [ERROR] Line 31:  Rebind result 'com.example.myproject.client.PersistentService_Proxy' could not be found
 [ERROR] Cannot proceed due to previous errors

I was wondering if it was a config problem or if was jetty locking some files. It turns out that it was just a stupid mistake—I forgot to serialize the entity class!  After I added back “implements Serializable” to my entity class, everything works fine again. I guess these error messages can be really misleading.

January 2, 2011 at 3:15 pm 4 comments

Annoying Opacify Feature in 10.10

Okay. I found this so-called opacify feature extremely annoying (I’ll just call it retarded to show my anger towards it). Basically, it makes any other overlapping windows to fade out from the window currently moused over with. It doesn’t sound so annoying but you will know if you use it for an hour or two. I stood up with this annoyance for almost a month because I got busy with other stuffs. I finally determine to spend some time to fix it and it wasted me like a couple hours. Anyway, just follow this link for solution.

December 13, 2010 at 11:43 pm Leave a comment

Cutting MTS file for Youtube

One thing I really hate about youtube (I think many others do too) is the crazy 10 minute limit. I know it as recently extended to 15 minutes but so what! But to be fair, even with this limitation, youtube is still probably the best site for video sharing.

It is especially annoying to me since we try to have a student presentation every week and post our videos on Youtube.  The videos are typically an hour long and cutting all these can easily waste someone couple hours. Youtube is nice enough to accept MTS file but without a way of cutting it, what is the point.

After some searches and trials, I tested several windows software. They did the job but still I would prefer something more automatic. So after copying here and there, I compile a python script for that eventually. I use mencoder to cut the file. But since mencoder doesn’t seem to be able to cut MTS file, I have to convert it to mp4 first (again using mencoder). The script seems to work fine for my JVC HM200BU. The output file is big and youtube will take long time to process those files. But I care less about that. It is not my tiny desktop running transcoding anyway. So here is the python script

#!/usr/bin/env python
import sys
   import os
   import re
   import commands
   import string
   import math
   import datetime

def cutVideo(movie,segment_time):
   cmd="mplayer -frames 0 -identify %s.mp4 2>&1|grep ID_LENGTH|cut -f2 -d=" % movie # get video length
   print cmd
   len=commands.getoutput(cmd);
   print len
   movie_len=datetime.timedelta(seconds=math.ceil(string.atof(len)))
   start_time=datetime.timedelta(seconds=0)
   cut_len=datetime.timedelta(minutes=segment_time)

   print movie_len
   count=1
   while 1:
	   cmd = "mencoder -ss %s -endpos %s -oac copy -ovc copy %s.mp4 -o %s_%d.avi" % (start_time,cut_len,movie,movie,count)
	   os.system(cmd) # extract segment

   	   count=count+1
   	   start_time = start_time + cut_len

           if start_time > movie_len:
   		  break

if __name__ == "__main__":
   fin=sys.argv[1]
   bname=re.sub('\.mts$','',fin,1)
   bname=re.sub('\.MTS$','',bname,1)
   fout="%s.mp4" % bname
   cmd="mencoder %s -demuxer lavf -oac copy -ovc copy -of lavf=mp4 -o %s" % (fin,fout)
   os.system(cmd) # convert to mp4
   cutVideo(bname,10) # cut video into 10 minute segments
   cmd="rm %s" % fout
   os.system(cmd) # remove tmp file

Save the file as cutMTS.py and change it to “run” permission (chmod 755 cutMTS.py). To cut a file 00001.MTS, simple type

./cutMTS.py 00001.MTS

It will generate several avi files 00001_1.avi, 00001_2.avi, and so on. Each of them will be 10 minutes long. If one wants to change the length of the video segment, simply change the argument in the line cutVideo(bname, 10). For example, for 15 minute segment, change 10 to 15.

November 18, 2010 at 5:16 am Leave a comment

Older Posts


Categories

Feeds


Follow

Get every new post delivered to your Inbox.