Google
 

6/2/14

(gnome-ssh-askpass:13543): Gtk-WARNING **: cannot open display:

(gnome-ssh-askpass:13543): Gtk-WARNING **: cannot open display:

While  git clone https://dokokanogitrepos/passtuki.git if get the above error.

run

#$ unset SSH_ASKPASS

3/3/14

To show Justin how it works

Here you can write whatever you think interesting.

12/10/13

Load Microsoft Word Macro

To add the template to the list of global templates



  • On the Tools menu, click Templates and Add-ins.
  • In the Templates and Add-ins dialog box, click Add.
  • Navigate to global_macros.dot, and then click OK.
  • The template appears in the Checked items are currently loaded list, and Word automatically selects the check box next to the template name, as shown in this illustration.

7/20/13

count number of lines under linux

Use the following to see how many jobs are submitted.

>> qstat -u username | wc -l

10/18/12

Fiji: install deconvLab

When first download the plugin, it does not work. It is a zip file. Put the zip file into the plugin folder of Fiji. Then unzip it. If you don't unzip it, Fiji cannot load it.

6/5/12

Ubuntu Live CD root password and live session password for default user Ubuntu

Posted on December 11, 2009 by GoogleThem.
Categories: Linux tips and tricks.
sudo passwd ubuntu
Then create your password, you will need to already be in Terminal ;-)
To create a usable root user’s account on a live cd, you can set the root password then su. This has not been possible in previous versions of Ubuntu as their user model made you remember to sudo before each command requiring root access.
sudo passwd root
It’s easier just to sudo command for one time use, instead of creating a root user to su to.
As of Ubuntu 9.10, I haven’t been able to login with “demo” or “Ubuntu” as the password for live session username “Ubuntu”.
If you are running most other types of linux like Debian, Red Hat, Mepis, Suse and others, they have an actual root user with an account.
It is easier to gain root access permanently, for these other flavors of Linux click here to learn how.

5/15/12

Dropbox cannot sync problem.

This problem was solved for me by following this article on Dropbox support:

https://www.dropbox.com/help/72

Of which the key details were:

Permissions errors occur more frequently when using shortcuts (Windows), aliases (Mac) or symlinks (Mac/Linux) to sync folders outside of your Dropbox folder.

Often you can resolve the problem by reverting the file's sharing settings using an administrative account. Here's how:

On Mac OS X
The easiest way to fix all Dropbox settings folder permissions in Mac OS X is through the Terminal application. You can run Terminal using Spotlight or find it in the Applications > Utilities folder
Once there, copy and paste the following lines into Terminal one at a time and exactly as it is written and press the return key after each line:
sudo chown -R $USER ~/Dropbox
sudo chmod -R u+rw ~/Dropbox
sudo chown -R $USER ~/.dropbox
sudo chmod -R u+rw ~/.dropbox

You may be prompted to enter your password. Enter the password you use to log in to the computer to permit the permissions change
If you've moved your Dropbox at some point, replace ~/Dropbox in the first two lines with the path to your Dropbox folder.

This command will grant your user account read and write access to all of the files in the Dropbox settings folder. After running these commands, restart your Dropbox and it should be able to sync happily again.

9/19/11

Comment in .vimrc

It is unusual. It is ".

7/31/11

matlab mex

1. be careful with the data type. It messes up instead of telling you that there is some implicit conversion.

7/26/11

use vi to open two files at the same time.

from here

Sometimes you need to edit a new or existing file while looking at a separate file using VI. This can be very useful and a powerful time saver. Fortunately you can do this using some simple commands.


First go ahead and edit a file with VI
shellprompt$ vi test-1.txt
while in VI enter the following
:new
This will open a new split screen session, in order to navigate between the two windows in VI do the following
ctr-w
j
Or
ctr-w
k
Using the first will move you to the lower window and using the latter will move you to the upper window.
To make one of the windows full screen and out of the dual screen mode use the following
:only
*Important Side Notes
If you used :new and opened up a new window session it will not have a name so you cannot save it without entering the following
:wq whatevername.txt
Also if you want to open a file in split screen mode that is not new and exists you can enter the following
:new /path/to/whateverfile

7/16/11

list only direcoties

>> ls -d */

to list hidden direcotories:

>> ls -d .*/

7/5/11

mac: move applications to different spaces.

You do not have to view all Spaces to move windows between them (That is, by pressing F8, then using your mouse to drag and drop the desired window to the desire Space location). Nor do you have to drag to a screen edge, wait, then drop. If you like to use your keyboard, here's a fast way to do it.

  1. Using your mouse, click and hold the window you want to move to another Space.
  2. While still holding your mouse button down, use your Spaces keyboard shortcut to move to the desired Space. This is usually done by pressing Control and one of the arrow keys.
The window you are holding will be moving with you as you change your Spaces. Once you reach your destination, release the mouse button.

[robg adds: You can also use this method to move the window directly to a numbered space -- just select the window, then press Control-1, -2, -3, etc. This is my preferred method of moving a window to a space, as it seems by far the quickest.]


source from here

5/20/11

rsync exclude files.

To exclude some directory, check the following:

http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/

5/6/11

uninstall Qt


sudo /Developer/Tools/uninstall-qt.py

3/22/11

ITK directory

To configure cmake
ITK_DIR
It should be "/Users/xxxx/software/InsightToolKitCompiled", where you put your compiled ITK.

3/21/11

Problem with ITK: library not loaded.

Problem: 
dyld: Library not loaded: libITKCommon.3.16.dylib


Solution:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib/InsightToolkit


/usr/local/lib/InsightToolkit is where the "libITKCommon.3.16.dylib" lives in.

12/28/10

use grep

Recently I am using Mercurial to manage my Matlab codes. I need combine commands "hg" with "grep" to see which files are updated. Here is how it is working:

>> hg status | grep '\.m$'

The above command will give all the .m files without any other junks, such as "*.m~" and other image files.

12/23/10

Install python packages.

Python provides a easy solution to install packages and resolve package dependencies.


>> sudo easy_install simplejson 

This works very well!!!

11/17/10

Debian Lenny.

Have not used Linux (Debian) for a while. Today, my old computer for my son showed some problem with X windows. I could not start the X server. Tried to reconfigure the Xorg. The Wiki from Debian is very helpful. Followings are the steps I followed.



Switch to a console as root (not a terminal emulator in X), then run:

/etc/init.d/kdm stop
/etc/init.d/gdm stop
/etc/init.d/xdm stop
cd /etc/X11/
Xorg -configure

Alternatively, reboot the machine in single user mode, then run:

cd /etc/X11/
Xorg -configure

Follow the on-screen instructions. This should give you something to work with.

Run X


After installation run:

startx

10/11/10

apple page customize dictionary

copied from: http://discussions.apple.com/thread.jspa?threadID=531999

I've converted the all.dic from Medic.zip in the format you need with Pages. A quick test showed that it works.

If you send me your e-mail address, I'll send you the new dictionary file. Click on my name above the atavar and use the e-mail address in the Biography field.

You then only need to join your ~/Library/Spelling/en with the new medic.en:

* Either open both en and medic.en in TextEdit and copy medic.en to the en window, then save the file
Or, if you're familiar with Terminal.all, you could cd to ~/Library/Spelling and use this command:

cat ~/Desktop/medic.en >> en

(I assume that you unzipped the file to your desktop)
---

If you want to change all.dic by yourself, then you have to replace the line endings with a special character from the en file. The character looks like "^@" but is in fact one character. In the resulting file, the words are all in one line separated by the special character. TextEdit doesn't show this character, so to change all.dic you should use something like emacs that comes with Mac OS X. You can launch emacs in Terminal.app.