Linux Tutorial
Sunday, November 5th, 2006This was previously a consolidation of many guides on the web including some stuff from ubuntuguide. Ubuntuguide is now a wiki, so for basic ubuntu tricks, head to there. This is now a haven for intermediate to advanced linux tutorials, although they generally favor ubuntu. Info here is licensed under the GNU GPL, the GNU FDL, and Attribution-ShareAlike 2.0 where applicable.
..:: DISCLAIMER & WARNING
- This information is provided without any implied or expressed promises or warranty (without even the implied warranty of merchantibility or fitness for a particular purpose)
- Some commands here may break your system
- Some commands here may violate your country’s laws or company policy. For instance, your country may have laws that prohibit encryption usage (which is used by SSH/putty). It is your responsibility to be aware and abide by your country’s laws.
- By using, referring to, or even acknowledging existence of this guide, you agree to hold yourself exclusively responsible for your actions, and any damages which may arise in relation to using or even not using this guide and any software mentioned here.
- In other words IF SOMETHING BAD HAPPENS BECAUSE YOU USE THIS, IT’S YOUR FAULT, NOT MINE.
..:: Mount an iso file
mount -o loop -t iso9660 file.iso /mnt/test
..:: Mount a fat(32) partition
sudo mount /dev/your_fat_partition /media/where_you_want_to_mount -t vfat -o iocharset=utf8,umask=0000
..:: General SSH usage (adminstration and file transfer)
- SSH is a remote terminal. To connect to a computer running the ssh server type any one of these lines
ssh your_username@server_hostname ssh your_username@server_ip ssh server_hostname -l your_username ssh server_ip -l your_username
- For example, my username is djlosch, and i want to connect to a box that i know as foo.djlosch.com and also 127.0.0.2. I can use any of these commands to connect to it.
ssh djlosch@foo.djlosch.com ssh djlosch@127.0.0.2 ssh foo.djlosch.com -l djlosch ssh 127.0.0.2 -l djlosch
- In addition to providing complete terminal functionality, you can also transfer files between the remote machine and your current machine. To do retrieve a file from the remote computer use:
scp -r username@192.168.0.1:/home/username/remotefile.txt .
- To send a file to the remote machine use:
scp -r localfile.txt username@192.168.0.1:/home/username/
..:: Use ssh from a Windows computer [windows]
- To use SSH terminal from a windows machine, you will need putty:
- right click this file and choose save as: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
- save it wherever you like to save your programs.
- type in the hostname or ip of the computer you want to connect to in the “Host Name (or IP address)” box
- click the SSH radio button in the “Protocol” selection.
- click “Open” at the bottom of the window
- To use SSH file transfer from a windows machine, you will need winscp:
- download winscp from here: http://prdownloads.sourceforge.net/winscp/winscp376.exe?download
- save it wherever you like to save your programs.
- click “New” and then type in the hostname or ip of the computer you want to connect to in the “Host Name (or IP address)” box
- type your username in the “User name” box, and verify that the “Port number” is set to 22.
- click “Login” at the bottom of the window
..:: Create a command to control your PCM volume
- type
sudo wget http://www.djlosch.com/source/volmute -O /usr/bin/volmute
- example usage
volmute increase #increase PCM volume volmute decrease #increase PCM volume volmute mute #mute PCM volume volmute unmute #unmute PCM volume volmute toggle #toggle muting of PCM volume
- use this in conjunction with your multimedia key listener daemon, or a voice control daemon to easily control your PCM volume
..:: Use gaim to connect to Gmail IM
In gaim click Tools > Accounts > Add
Use these settings:
Protocol: Jabber
Screen Name: Your_gmail_screen_name
Server: gmail.com
Resource: Gaim
Password: Your_gmail_password
Use TLS if available: checked
Force old SSL: unchecked
Allow plaintext auth over encrypted streams: unchecked
Port: 5222
Connect Server: talk.google.com
Proxy Type: Use Global Proxy Settings (unless you specifically need to change this)
Alias, Remember Password, and Auto-Login are up to you.
..:: Install a desktop session recorder that supports Beryl/Compiz, AIGLX, XGL (recordmydesktop)
- type
cd sudo wget http://www.djlosch.com/source/gtk-recordmydesktop_0.3-1_i386.deb sudo wget http://www.djlosch.com/source/recordmydesktop_0.3.0-1_i386.deb dkpg -i recordmydesktop_0.3.0-1_i386.deb dkpg -i gtk-recordmydesktop_0.3-1_i386.deb
- run it by typing
gtk-recordmydesktop
..:: Enable voice command and control (cvoicecontrol)
- type
wget http://www.kiecza.net/daniel/linux/cvoicecontrol_0.9alpha-1_i386.deb sudo apt-get install libncurses sudo dpkg -i cvoicecontrol_0.9alpha-1_i386.deb
- configure your microphone by typing
TERM=vt100 microphone_config
- add commands to your voice model by typing
model_editor
- run the speech listener daemon using your voice model file by typing
cvoicecontrol your_voice_model_file
..:: Install a BitTorrent client (azureus)
- Azureus has been added to the extended repositories so you can now get it in apt.
sudo apt-get install azureus
..:: Install and configure network file server (samba)
- type
sudo apt-get install samba sudo nano /etc/samba/smb.conf
- edit the open file as necessary. here is an example
[global] workgroup = your_workgroup encrypt passwords = yes password level = 20 map to guest = bad user socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY security = user server string = Samba on %h wins support = no [homes] comment = Home Directories allowing R/W access to owner valid users = %S browseable = no read only = No create mask = 0640 directory mask = 0750 guest ok = no [archive] comment = Archive allowing Read Only access for all path = /some/path/to/folder/for/sharing public = yes writeable = no [free_serve] comment = Archive allowing R/W access for all path = /some/path/to/folder/for/sharing read only = No force user = the_username_you_want_to_own_the_file force group = the_groupname_you_want_to_own_the_file guest ok = Yes
..:: Enable encryption (SSL) for apache by creating a self signed certificate
- type
sudo apt-get install apache2 sudo cp /etc/apache2/sites-available/default /etc/apache2/default.default sudo /usr/sbin/apache2-ssl-certificate -days 365 sudo apache2-ssl-certificate sudo a2enmod ssl cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl
- now you need to determine where you want to put your files that will be served using ssl encryption. I put mine in /var/www-ssl/ and will use this as my example. type
sudo mkdir /var/www-ssl
- now comes the trickier part. make these changes to your /etc/apache2/sites-available/default (How to edit using nano). Note that if you paste, the < and > may translate to periods, so change them back to brackets.
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www
- make these changes to your /etc/apache2/sites-available/ssl
NameVirtualHost *:443 <VirtualHost *:443> DocumentRoot /var/www-ssl
- add this to your /etc/apache2/ports.conf
Listen 443
- add these to your /etc/apache2/sites-available/ssl after the part that says “Possible values include: debug, info, notice, warn, error, crit…”
SSLEngine On SSLCertificateFile /etc/apache2/ssl/apache.pem
- type at the terminal again
sudo /etc/init.d/apache2 restart
..:: Install E17 (enlightenment) in Ubuntu
- add the respective repository to /etc/apt/sources.list for your release.
deb http://edevelop.org/pkg-e/ubuntu edgy e17 deb-src http://edevelop.org/pkg-e/ubuntu edgy e17
- replace ‘edgy’ with the version name of ubuntu you’re using (dapper, feisty, gutsy, hardy, etc). then type
sudo wget "http://lut1n.ifrance.com/repo_key.asc" -O /root/key.asc sudo apt-key add /root/key.asc sudo apt-get update sudo apt-get install enlightenment
- logout of gnome (or kde). At the GDM login menu, select your session as enlightenment, login, and explore.
..:: Disable Enlightenment’s desktop scrolling
enlightenment_remote -edge-flip-set 1
..:: Run amarok in E17
For some people, running amarok reveals the splash screen and then nada. Left click the desktop and open Lost Windows. Amarok should be there. Clicking Amarok will open a small tiny window that you can double click on to fullscreen amarok.
..:: Stop E17 from eating windows (like gaim, amarok, azureus)
E17 is set up to retake your close button. A lot of apps have changed the close button to instead minimize the app, and a lot of apps have changed the minimize button to minimize to tray. Open the settings for any app that E17 is eating windows for and disable the minimize to tray, and minimize on close functions. The applications will now minimize correctly.
..:: Enable multimedia keys (xev, xmodmap, and erme)
- type
wget http://www.c7obs.net/~adi/projects/perl/erme.current chmod 700 erme.current ./erme.current & xev
- Click the window that xev pops up. Press your multimedia key to see what keycode the key has. Then make a file with keycodes corresponding to XFree named keys. This is mine for my Logitech RF Wireless iTouch that i save in ~/iTouch.conf. I have kept this tip up for archival purposes only. the iTouch has been supported out of the box since somewhere between breezy and gutsy
keycode 144 = XF86AudioPrev keycode 153 = XF86AudioNext keycode 129 = XF86Music keycode 174 = XF86AudioLowerVolume keycode 176 = XF86AudioRaiseVolume keycode 160 = XF86AudioMute keycode 162 = XF86AudioPlay keycode 164 = XF86AudioStop
- Save this as your_keyboard.conf and type
xmodmap whatever_you_saved_your_conf_file_as.conf
- I have my music control buttons set as globals in amarok, but volume will need to be set using the PCM volume script. In Erme, add a key. Set the action to ‘exec’, set the key to the name you assigned the keycode in your conf file. Then set the parameters to the function you want to assign it to. For example, my mute button is assigned as such:
key = XF86AudioMute action = exec parameters = volmute toggle
..:: Credits
- http://www.smashsworld.com/2005/08/im-on-google-talk-right-now.php
- http://www.tc.umn.edu/~brams006/selfsign_ubuntu.html
- http://www.kiecza.net/daniel/linux/
- http://forums.gentoo.org/viewtopic-t-396554-highlight-volmute.html
- http://www.chiark.greenend.org.uk/~sgtatham/putty/
- http://winscp.net/eng/index.php
- http://www.soulmachine.net/wiki/index.php?title=Enlightenment_on_Ubuntu_5.10_%28Breezy_Badger%29
- http://www.c7obs.net/~adi/projects/perl/