Ubuntu

overall

http://ubuntuguide.org/wiki/Ubuntu_dapper
http://ubuntuguide.org/wiki/Ubuntu:Hardy
http://ubuntuforums.org/showthread.php?t=268985

command list

command arguments

What does “—” (double-dash) mean? (also known as “bare double dash”)

http://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash

http://www.cyberciti.biz/faq/linux-unix-bsd-xargs-construct-argument-lists-utility/

restart x

ctl+alt+backspace to kill x. to get back to the gui login screen enter #/etc/init.d/$DM restart. replace DM with gdm or kdm depending on which desktop manager your using.

edit application menu
sudo gedit /usr/share/applications/virgoftp.desktop

[Desktop Entry]
Name=virgoftp
Comment=FTP down
Exec=/opt/virgoftp/virgoftp
Icon=/opt/virgoftp/image/virgoftp32.png
Terminal=false
Type=Application
Categories=Application;Network;

因为我的目录在/opt/virgoftp/
virtual system within another account

gdmflexiserver —xnest

one button to turn monitor off
sleep 1 && xset dpms force off

more useful : lock screen and turn monitor off :
gnome-screensaver-command --lock && sleep 1 && xset dpms force o
add a new source and update packages

echo "deb http://packages.medibuntu.org/ hardy free non-free" | sudo tee -a /etc/apt/sources.list
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

chinese input

How can I activate SCIM inside a NX session?

The Smart Common Input Method (SCIM) provides an input method user interface for a number of languages such as Chinese, Japanese and Korean.

In order to activate SCIM inside your NX session, you need to add some
environmental variables to the /etc/profile system configuration file.

For example, if you want to activate SCIM for Chinese, you will need to add the
following lines to the /etc/profile system configuration file:

export LC_CTYPE="zh_CN"
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim

This will set the Chinese language for all the users. If you would like to
allow each user to change this, the user should set these variables
in the ~/.bash_profile file in his / her user's home.

SCIm general setup

https://help.ubuntu.com/community/SCIM

network connection

Mount samba shares with utf8 encoding using cifs

http://ubuntuforums.org/showthread.php?t=288534

testing /etc/fstab before rebooting: sudo mount -a

mount Samba

/etc/fstab

         //192.168.1.149/public    /mnt/myworldbook        cifs    guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

manual mount

        sudo mount -t cifs //192.168.1.149/public /mnt/myworldbook -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777
issues:
CIFS VFS: Error connecting to IPv4 socket

https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/208770
solution:
http://ubuntuforums.org/showthread.php?t=103274&highlight=CIFS+VFS%3A+cifs_mount+failed+w%2Freturn+code+%3D+-101

placing the following in my /etc/rc.local file before the last line:

sleep 30
/bin/mount -a
I see this too on my slow (500 MHz P3, 256 MB memory) Hardy box (Mythbuntu). It hangs for about 30 - 45 seconds on every boot with a message that the network is inaccessible. This problem appeared when I added some CIFS mounts to my /etc/fstab. After the delay, the continues with the boot, and after boot-up, the mounts have in fact happened.

I also was seeing the even longer hang at shutdown mentioned in a comment to this bug report, but found a solution on the Ubuntu forums. Just do:

      sudo ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
      sudo ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

and that fixes it completely (but doesn't help the delay at start-up).

mount NFS system

/etc/fstab

manual mount

        sudo mount 192.168.1.149:/shares/internal /mnt/myworldbook-nfs/  -o rw

mount windows NTFS partition

/etc/fstab

         # Entry for /dev/sda1 :
         UUID=98B41FE7B41FC6A2 /media/sda1 ntfs-3g defaults,locale=zh_CN.UTF-8 0 1 
         or
         # Entry for /dev/hda1 :
         /dev/sda1 /media/hda1 ntfs-3g defaults,locale=zh_CN.UTF-8 0 1

manual mount

        sudo mount -t ntfs-3g /dev/sda1 /mnt/sda1 -o defaults,locale=zh_CN.UTF-8

Fix cif server shutdown error

Instructions are very simple:
1)uncompress archive : unzip ./mountcifs.zip
2) sudo chmod a+x ./mountcifs
3)sudo cp mountcifs /etc/init.d/
4)cd /etc/rc0.d
5)sudo ln -s /etc/init.d/mountcifs K02mountcifs
6)cd /etc/rc6.d
7)sudo ln -s /etc/init.d/mountcifs K02mountcifs

Fix network manager shutdown issue

install Wicd, as it will automatically remove gnome-manager

http://wicd.sourceforge.net/download.php
it is : deb http://apt.wicd.net hardy extras

multimedia

mplay set up

http://blog.koema.net/?p=31

too many packets in buffer

sudo vim /usr/share/applications/mplayer.desktop
add -framedrop as : Exec=gmplayer -framedrop %F

developer

install java

http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/

install LAMP

sudo apt-get install apache2 php5 mysql-server-5.0 phpmyadmin
sudo /etc/init.d/apache2 restart
the instructions at the following link is wrong.

http://ubuntuguide.org/wiki/Ubuntu:Hardy#Install_a_LAMP_server_for_local_web_development

fix apache2 errors : Apache error - server's fully qualified domain name

sudo vim /etc/apache2/apache2.conf
add :
ServerName "localhost"

fix [warn] The Alias directive in /etc/phpmyadmin/apache.conf at line 3

contents of /etc/phpmyadmin/apache.conf are already being loaded by phpmyadmin.conf located in /etc/apache2/conf.d which means that you can remove the following line from your /etc/apache2/apache2.conf file.

INCLUDE /etc/phpmyadmin/apache.conf

install tomcat

http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/

install maven

Download and install Maven 2.0.9+.
download: http://apache.seekmeup.com/maven/binaries/apache-maven-2.0.9-bin.tar.bz2
installation: http://maven.apache.org/download.html#Installation

Installing Torrent-Flux

http://ubuntuforums.org/showthread.php?t=268985
db name : torrentflux , password : x
access name: user/x

PHP Admin:

root/llllllllllllll

acrobat acroreader

Install Adobe Reader 8.1.2 on Ubuntu 8.04

All you’ll need to do in order to install Adobe Reader is add the Medibuntu repository. This can be done via:

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list

Once that is done you’ll likely want to add the Medibuntu GPG key as well:

sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

..and finally install Adobe Reader v8.1.2 (at the time of this writing) by using:

sudo apt-get install acroread

webdav and mozillar weave

http://www.digital-arcanist.com/sanctum/article.php?story=20070427101250622

HOWTO Enable WebDAV with Apache 2.x on Ubuntu Linux

HOWTOsThis HOWTO will show you how to create WebDAV enabled directories hosted on your Apache webserver. I wrote this using Ubuntu Server 7.04, but it should work on previous Ubuntu releases and (with only minor modifications) any other Linux distro.

1. What is WebDAV?
2. WebDAV stands for Web-based Distributed Authoring and Versioning. It was designed to allow groups of individuals to edit and manage files stored on a web-server. The protocol allows the creation of "web-shares" which can be used for file storage, collaborative projects, editing websites themselves, and any number of other things. WebDAV supports features like editing, copying, and moving of files, file locks, resource lists, and file property modification. Most operating systems, including MS Windows, support WebDAV directories. Install the Proper Software
The first thing you will need (obviously) is a functioning apache2 webserver. If you happened to have install Ubuntu Server Edition with the LAMP option, then you're set. Otherwise, you'll need to get a few things with apt. Do this however you want; I will use the command line. While you're at it, you might as well get PHP to go with it.

apt-get install apache2 php5 libapache2-mod-php5

3. Add Modules
Fortunately, Apache 2.x comes with mod_dav already installed, we just have to activate it. We can do this by making some symlinks.

cd /etc/apache2/mods-enabled
ln -s ../mods-available/dav* .

4. Create LockDB file for WebDAV
Next we need to set up a DAVLockDB file for WebDAV to use. This is a very important step, as you'll wind up with Internal Server Errors if you try to use WebDAV without it.

mkdir /usr/share/apache2/var
touch /usr/share/apache2/var/DAVLock
chown -R www-data:www-data /usr/share/apache2/var

5. Setup Authentication and Add Users
WebDAV can open your web server up to security risks. You don't want just anyone to wander in and change your files! There are several ways you can do authentication for your WebDAV directory, but htpasswd is the easiest and probably best for most cases. We'll make the passwords using MD5 and store them where we store the apache configurations and add an initial user while we're at it.

htpasswd -m -c /etc/apache2/.htpasswd

6. You can use this command to add more users later or change their passwords. Just remember to remove the -c option or you'll truncate your password db every time! Create the WebDAV Directory
Okay, almost done. Let's make a directory in our web document root where we will run our WebDAV. I'm calling it myWebDAV. This is the folder in which your authorized users will be able to add, delete, and modify files. The directory will need to be writable by the web server.

mkdir /var/www/myWebDAV
chown www-data:www-data /var/www/myWebDAV

7. Configure Apache
Now all we need to tell Apache how to use WebDAV and where to enable it. This consists of adding a few definitions to the user-defined config file at /etc/apache2/httpd.conf. Open that file with an editor and add lines similar to those below.

## Location of the DavLock file
DavLockDB /usr/share/apache2/var/DavLock

## Set up the myWebDAV directory to use WebDAV and authentication
<Directory "/var/www/myWebDAV">
Dav On
AuthName "WebDAV Login"
AuthType Basic
AuthUserFile /etc/apache2/.htpasswd
## Limit access for enhanced security
<LimitExcept GET HEAD OPTIONS POST>
require valid-user
</LimitExcept>
Order allow,deny
Allow from all
</Directory>

8. Restart Apache and Test
That's it! Restart your web server and you're good to go. You and your friends/coworkers/etc can now login and modify the files at http://your.domain.com/myWebDAV.

/etc/init.d/apache2 restart

then set up mozillar weave
http://lifehacker.com/400110/set-up-mozilla-weave-on-your-own-server

locale

change the environment variable in /etc/environment to make it available system-wide.
For example, my LANG was "en_US" in /etc/environment, but /usr/lib/locale/en_US did not exist. /usr/lib/locale/en_US.utf8 did,
so 1)changing LANG to "en_US.UTF8" fixed the problem.
or 2) cd /usr/lib/locale ; sudo ln -s zh_CN.utf8 zh_CN

virtual box

download virtualbox from sun site, please NOT OSE version, because it has no USB support
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter

http://www.ubuntu-unleashed.com/2008/04/howto-install-virtualbox-in-hardy-heron.html

eMule

Open a terminal window and type in:
sudo apt-get install amule
killall gnome-panel

The second command refreshes the GNOME panel.

After that you can find aMule in the Gnome menu under Applications -> Internet.

LAMP

http://www.ubuntugeek.com/howto-install-lamp-server-in-jaunty.html

  • sudo apt-get install apache2
  • sudo apt-get install php5 libapache2-mod-php5 php5-cli php5-dev
  • sudo /etc/init.d/apache2 restart
  • testing php, create a file phpinfo.php in /var/www:
<?php
phpinfo()
?>
  • http://localhost/phpinfo.php
  • sudo apt-get install mysql-server
  • sudo apt-get install phpmyadmin
  • sudo mysqladmin -u root password mypassword to set up mysql root password.
  • ln -s /usr/share/phpmyadmin /var/www/
  • http://localhost/phpmyadmin log in with root and password set up in previous step.

sudo and xdisplay

in the linux machine:
http://brandonhutchinson.com/wiki/X11_Forwarding_and_su/sudo

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License