Usefull linux commands
System
- List linux version, system information
uname -a
- List partitions, and usage
df
- List space under the directory
du -h
- List all last login time: lastlog
Setting up ubuntu (9.10) in SCS environment
http://www.cs.cmu.edu/~hyeontae/ubuntu_in_SCS.html
Setting up Kerberos and AFS in ubuntu 7.10
- add sources to /etc/apt/source.list
deb http://us.archive.ubuntu.com/ubuntu gutsy universe main restricted
multiverse
- apt-get update
apt-get upgrade
- install openafs
apt-get install build-essential module-assistant
m-a a-i openafs
apt-get install openafs-client
- sudo apt-get install heimdal-clients libpam-heimdal
- editing /etc/krb5.conf (emacs /etc/krb5.conf or nano
/etc/krb5.conf)
[libdefaults]
default_realm = CS.CMU.COM
.....
[domain_realm]
.cs.cmu.edu = CS.CMU.EDU
cs.cmu.edu = CS.CMU.EDU
- edit /etc/pam.d/common-auth
auth sufficient pam_krb5.so minimum_uid=1000
auth required pam_unix.so nullok_secure
- edit /etc/pam.d/common-session
session required pam_unix.so
session optional pam_foreground.so
session optional pam_krb5.so
- obtain ticket
kinit
steps to use chinese input method in English locale in linux (ubuntu 7.04)
- create a directory .xinput.d if there is no such directory
in your home directory
- create a file in that firectory with name: default
- put the following things in your directory
XIM=SCIM
XIM_PROGRAM=scim
XIM_ARGS="-d"
GTK_IM_MODULE=scim
SCIM_QTIMM_XINPUT=/etc/X11/xinit/xinput.d/scim-qtimm
[ -r "${SCIM_QTIMM_XINPUT}" ] && . ${SCIM_QTIMM_XINPUT}
unset SCIM_QTIMM_XINPUT
# override with xim for now
QT_IM_MODULE=xim
- later, use Ctrl+Space to switch between input method.
steps to use chinese input method in English locale in linux (ubuntu 9.04)
- check system-->language support --> use .... input
steps to save to eps file (in windows)
This method possibly requires GSView software. Thanks
to Markus Nilsson for suggesting this.
- Install the drivers for a Postscript printer (often denoted PS in
the end of the name of the printer) if you don't already
have one installed on your computer. (This can be done as follows:
Start -> Control Panel -> Printers -> Add printer.
Press next a couple of times until you reach the page where you can
choose between different manufacturers.
Choose a Postscript printer, e.g., Lexmark Optra S 1250 PS.)
- Isolate each figure in its own PowerPoint document.
- Print the figure, but check the box "Save to file", and under properties/advanded/Postscript options, select
Encapsulated postscript (EPS).
- Now you're almost done. The default setting for the boundary box
for your drawing has been set to fill the whole page. If you
want to edit this, use GSView.
Under the File menu, use PS to EPS without checking the
"Automatically calculate Bounding Box". Select your new
bounding box, and save the file as an EPS.
- Use LaTeX's psfig package to put the .eps figure into the LaTeX document.
change mac address in linux
There are a lot of reasons you might want to manually set your MAC
address for your network card. I won’t ask you what your reason
is.
To change this setting, we’ll need to edit the
/etc/network/interfaces file. You can choose to use a different editor
if you’d like.
sudo gedit /etc/network/interfaces
You should see the line for your network interface, which is usually eth0. If you have dhcp enabled, it will look like this:
auto eth0
iface eth0 inet dhcp
Just add another line below it to make it look something like this:
auto eth0
iface eth0 inet dhcp
hwaddress ether 01:02:03:04:05:06
Obviously you would want to choose something else for the MAC address, but it needs to be in the same format.
sudo /etc/init.d/networking restart
You will need to restart networking or reboot to take effect.
Keyword Substitution with TortoiseSVN
January 07, 2009
A cool feature of Subversion is that you can get it to update the
comments in your script automatically when you commit it. Here is an
example of the header I've got on my Application.cfc script.
<!---
=================================================================================================
Repository path: $HeadURL: http://svnserver.com/svn/aliaspooryorik/trunk/Application.cfc $
Last committed: $Revision: 7 $
Last changed by: $Author: john.whish $
Last changed date: $Date: 2009-01-07 13:15:08 +0000 (Wed, 07 Jan 2009) $
ID: $Id: Application.cfc 7 2009-01-07 13:15:08Z john.whish $
=================================================================================================
--->
Whenever I (or anyone else) update this file and commit it, the
header comment is updated. This can be particularly useful when working
with other developers as you can see who made the last commit without
having to do a lookup to subversion. So, how do you do it?
In your script add the following comment.
<!---
=================================================================================================
Repository path: $HeadURL$
Last committed: $Revision$
Last changed by: $Author$
Last changed date: $Date$
ID: $Id$
=================================================================================================
--->
The values wrapped in the $ signs are reserved keywords (svn:keywords).
Now you need to tell subversion to replace those values as it is not
enabled by default. You can do this for a whole project or for
individual files if you wish.
You can set this up using the svn propset command (more info here: http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html)
or, if you are using TortoiseSVN, then follow these steps:
- Right click on the root folder of your working copy.
- Select 'properties' (Note: this is not the TortoiseSVN
properties option!)
- Select the 'subversion' tab.
- Click the 'properties' button.
- In the new 'properties' dialog, select the 'New' button.
- Select 'svn:keywords' from the dropdown list.
- Enter (note that each one is on a new line)
HeadURL
Revision
Author
Date
ID
- If you want to apply keyword substitution to all sub files and
folders, tick the box titled 'Apply property recursively'
- Click 'OK'
That's it. It is worth pointing out that your file will only be
updated when you do a commit so it won't be updated right away.
Alternatively if you are feeling brave you can set this up as the
default. To do this you need to:
- Right click on the the root of your working copy.
- Select 'TortoiseSVN -> Settings'.
- Click the 'Edit' button labelled 'Subversion configuration file'
- Tortoise will ask you to select a text editor, Notepad.exe will
do if you don't have anything better!
- Scroll down to the bootom of the file and look for the
[auto-props] section.
- Just above it is a line that is commented out '#
enable-auto-props = yes'. Remove the comment.
- Now add this below the [auto props] heading:
### custom keyword substition
*.cfc = svn:keywords=HeadURL Revision Author Date Id
*.cfm = svn:keywords=HeadURL Revision Author Date Id
- Save your file and that should do it for new files you create.
If you really want to get carried away then you can also specify your
own keywords to be substituted!