====== Linux Notes ======
===== General Documentation =====
* [[http://www.linux.org/docs/|Linux Online Documentation]]
* [[http://tldp.org/LDP/abs/html/dosbatch.html|Converting DOS Batch Files to Shell Scripts]]
* [[http://chrysaor.info/?page=images&filter=Ubuntu|Ubuntu VMware images]]
* [[http://downloads.vmware.com/d/info/desktop_downloads/vmware_player/3_0|VMware Player]]
**Unix**
* [[http://cb.vu/unixtoolbox.xhtml|Unix Toolbox]] - A collection of useful Unix/Linux/BSD commands and tasks
* [[http://www.tablespace.net/quicksheet/solaris-quicksheet.pdf|Solaris QuickSheet]]
* [[http://www.sunfreeware.com/|Sunfreeware - Free and Open Source Software (FOSS) for Sun Microsystem's Solaris]]
===== Samba =====
Samba can be installed by running:
apt-get install samba
Samba allows you to share a directory on your Linux filesystem with your Windows machine. In the ''/etc/samba'' directory, there is an ''smb.conf.user'' file that is used for any Samba extensions that you'd like to make to share additional directories. By default, you should have your home directory set up as a samba share in ''smb.conf''. It's in there as the ''[homes]'' clause, but the actual share name is the same as your username (ex. ''\\mylinuxservername\dkirkdorffer''). If you are connecting for the first time, you will have to set the samba password using following command:
sudo smbpasswd -a dkirkdorffer
You will be prompted to enter a new password; this will be the password to use when connecting to your Linux box from your Windows box.
[dkirkdorffer]
path = /home/dkirkdorffer
read only = no
valid users = dkirkdorffer
create mask = 0644
browsable = no
If you want to have access to the root of your linux drive, you can edit the ''/etc/samba/smb.conf.user'' file and add this snippet (modify the username to your username):
[root]
path = /
read only = no
valid users = dkirkdorffer
create mask = 0644
browsable = no
This will enable you to access the root of your linux drive using the alias "root" (ex: ''\\mylinuxservername\root'')
Start (or stop and restart) the ''smbd'' daemon (at ''/usr/sbin'' or possibly at ''/etc/init.d'') like so:
/usr/sbin/smbd start
/usr/sbin/smbd stop
/usr/sbin/smbd restart
For troubleshooting info read the "[[http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/diagnosis.html|The Samba Checklist]]".
To determine the IP address of the Samba server run:
nmblookup -B BIGSERVER __SAMBA__
==== UNIX ====
Additional UNIX resources of use:
* [[https://blogs.oracle.com/timthomas/entry/enabling_and_configuring_samba_as|Enabling and configuring SAMBA as shipped with Solaris 10]] or [[http://blogs.oracle.com/timthomas/entry/samba_and_swat_in_solaris|SAMBA and SWAT in Solaris 10 Update 4 (Solaris 10 8/07)]].
Start and stop alternatives:
/usr/sfw/sbin/smbd start
/usr/sfw/sbin/smbd stop
/usr/sfw/sbin/smbd restart
or
svcadm enable samba wins
svcadm disable samba wins
===== SSH =====
* [[http://www.andremolnar.com/how_to_set_up_ssh_keys_with_putty_and_not_get_server_refused_our_key|How to set up SSH keys]] - i.e. generate the keys on the server (UNIX, Linux, BSD etc.) instead of the client (i.e. in Windows).
* Special instructions for [[http://cervisia.kde.org/|Cervisia]] - Before doing a check-out for the first time, make sure that the key for the CVS server is in your ''.ssh/known_hosts'' file. One way to do this is: '''ssh @'''. Failing to do this will make Cervisia ask for a password and then terminate the checkout with the error "Host key verification failed".
===== VNC =====
You can start the VNC Server by running ''./startvnc.sh'' or ''./startvnc4.sh''. VNC Viewer can then be installed on your Windows system, allowing you full access to your Linux system from Windows (or another Linux system). You can override the default geometry of the VNC window created by the server by altering the shell script like this:
#!/bin/sh
vncserver -geometry 1580x1100 -depth 24
nohup vncconfig -nowin > /dev/null 2>&1 &
or
#!/bin/sh
/usr/bin/vnc4server -geometry 1220x830 -depth 24
nohup /usr/bin/vnc4config -nowin > /dev/null 2>&1 &
An ''.vnc/xstartup'' file is also used and if using [[http://www.kde.org/|KDE]] can be setup as so
#!/bin/sh
vncconfig -nowin &
startkde &
Set the password by running ''vncpasswd'', ''vnc4passwd'' or ''tightvncpasswd'', depending on your version of VNC.
The default starting port for VNC is 5901 (or 5801 through a web browser), additional instances of VNC will increment this number by 1 (so 5902 for the second one). You can find what port it's currently running on by running:
ps -ef | grep vnc
and looking for the "''rfbport''" parameter. Alternatively, look in the ''~/.vnc'' directory at the log file.
[[http://www.tightvnc.com/|TightVNC]] and [[http://www.realvnc.com/|RealVNC]] are both provide good client viewers, and VNC servers.
==== UNIX ====
See: [[http://www.softpanorama.org/Xwindows/VNC/vnc_on_solaris.shtml#The_vncserver_modification|VNC on Solaris]]
On Solaris, the ''./startvnc.sh'' might look like this:
#!/bin/ksh
PATH=$PATH:/usr/dt/bin:/usr/openwin/bin:/usr/X11/bin
cd ~
vncserver -depth 24 -geometry 1500x768 :1
''./killvnc.sh'' might look like this:
#!/bin/ksh
PATH=$PATH:/usr/dt/bin:/usr/openwin/bin:/usr/X11/bin
cd ~
vncserver -kill :1
and the ''.vnc/xstartup'' file might look like this:
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &