Linux/Unix commands
Basic file commands
| Command [extra params]
| Description
|
| man command
| Shows the manual-page for command.
|
| info command
| Shows the info-page for command(more detailed than man).
|
| cp [-R] from_where to_where
| Copy files from place to place.
|
| mv from_where to_where
| Move files from place to place.
|
| rm [-rf] target_file
| Remove files
|
| du [-sk]
| disk usage in kilobytes
|
| swapon [-s]
| swap usage (summary)
|
| free
| displays free memory and swap resources
|
| dmidecode
| Dump DMI (SMBIOS) table to human readable format
|
| cardctl
| PCMCIA card control utility ( e.g. cardctl ident)
|
| top
| displays the top CPU processes
|
| ln [-s] real_dir_name link_name
| make hard or symbolic links to files
|
| locate file_name
| search for files
|
| mount /dev/device /mnt_place [-o uid=user,gid=group,umask=0007]
| Sets up(mounts) a file system to /mnt_place directory.
|
| umount /dev/device
| Unmounts the wanted device.
|
| dmesg
| print or control the kernel ring buffer.
|
Configuration
Digital Cameras
The best program for this can be found from:
http://www.uni-ulm.de/~eschiehl/
Adding groups and users
Commands adduser and addgroup will deal with this. The settings
are saved into /etc/group. For example group root0 where
belong ssheikki and www-data is defined like this:
root0:x:102:ssheikki,www-data
groups user_name shows the groups where user_name belongs to.
Mounting devices
Mounts are loaded from /etc/fstab in the startup.
For example line(in /etc/fstab)
/dev/hda1 /c vfat gid=root0,uid=www-data,umask=0007 0 0
mounts the /dev/hda1 to /c with given parameters.
Same can be given also from command-line:
mount /dev/hda1 /c -o gid=root0,uid=www-data,umask=0007
To see all partitions, use:
fdisk -l command
If you want for example remount your read filesystem to rewritable, use;:
mount -o remount,rw /dev/hda2
Mouse Settings
Mouse device is /dev/mouse, a symbolic link(ln -s) to the physical
device, such as:
/dev/ttyS0 for COM1
/dev/ttyS1 for COM2
/dev/ttyS2 for COM3
/dev/ttyS3 for COM4
Mouse can be configured using gpmconfig which is config for gpm.
The settings for standard ps2 mouse are following:
Set the responsiveness (normally not needed) [1]?
> 10
Repeat protocol (enter 'none' to turn repeating off) [raw]?
>
Do you want to add any additional arguments []?
>
Do you want to test this configuration (y/N)? y
gpm -m /dev/psaux -t imps2 -r 10 -Rraw
Finish testing by typing Ctrl-D
Current configuration: -m /dev/psaux -t imps2 -r 10 -Rraw
Device: /dev/psaux
Type: imps2
Responsiveness: 10
Repeat_Type: raw
Runtime information /proc/
The /proc file system is a pseudo-filesystem that stores relevant
informations about the kernel(man 5 proc). For example
/proc/interrupts shows how many times each IRQ was used and
by whom.
Unix has Different Run Levels
Each run level has own configuration files. In debian
they are in /etc/rc#.d/ and in redhat they are
/etc/rc.d/rc#.d/ (# means the run level number).
Power Off: Run Level 0(/etc/rc0.d/)
Single User: Run Level 1(/etc/rc1.d/)
Multiuser: Run Level 2(/etc/rc2.d/)
Full Multiuser(2 with NFS): Run Level 3(/etc/rc3.d/)
Unused: Run Level 4(/etc/rc4.d/)
X11(graphical): Run Level 5(/etc/rc5.d/)
Reboot: Run Level 6(/etc/rc6.d/)
To change boot behaviour, modify /etc/inittab. The run levels are
also described there.
A script starting with S starts a service. One starting with K stops a service.
The number after the `S' or `K' specifies the order in which the scripts are run.
For example, S25xdm will start before S35xdm.
Stop/Start/Restart scripts
Subdirectory /etc/init.d/ (or in redhat /etc/rc.d/init.d)
contains all startup scripts that may be used to stop/start/restart
the related process. For example /ec/init.d/gpm stop will stop the mouse
and /ec/init.d/gpm start will start it again.
Installing kernel
/usr/src/linux/README tells what to do. First download the latest source.
Then everything starts with "make menuconfig". If you don't have ncurses-dev
installed please find it from the web or in debian just use "apt-get install
ncurses-dev".
As simplest, the following steps should be taken(with 2.4.x kernel):
make menuconfig
make dep
make bzImage
make modules
make modules_install
make install
or using with make-kpkg:
make-kpkg --targets
make-kpkg buildpackage
Things to remember in menuconfig
- Network packet filtering; if you setup linux box which is going
to be used as firewall or gateway. New alternative for old ipchains.
- ext3 journaling filesystem; enable to use ext3 filesystem.
- Linux USB
To select modules for different kernels in /etc/modules
Write following to /etc/modules:
if `kernelversion` == 2.4
uhci
emu10k1
...
elseif `kernelversion` == 2.6
uhci-hcd
snd-emu10k1
...
endif
Window managers
To handle logging I recommend; wdm(WINGs Display Manager).
For actual managers you should try;
- Enlightenment; easy, fast and furious. Install e16keyedit and e16menuedit also.
- IceWM; fast and bare.
- fvwm2; bare and beautiful.
Test if your port X is open
- Set up a server using netcat; nc -v -l -p X
- Connect to the server from remote computer; nc serveraddres X
- Example: nc -v -l -p 1099 and nc server.dyndns.org 1099
To resolve net-addresses
Use nmap, host and dig programs.
Misc
lspci, Shows info about your pci cards(replaces /proc/pci)
tune2fs, from ext2 -> ext3 for example.
[1] Linux Administration Guide
http://www.bo.infn.it/alice/alice-doc/mll-doc/linux/admin/lxadmgde.html
To setup a new disk
Partition the disk: cfdisk.
Make it ext3: mke2fs -j /dev/hdXX
Set parameters, turn ext2, etc: tune2fs -m 0 /dev/hda1
Remember to put DMA on: hdparm -c /dev/hdb, hdparm -c 1 /dev/hdb
Good configure for hdparm is for example:
/dev/hda:
multcount = 16 (on)
I/O support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 19457/255/63, sectors = 312581808, start = 0
busstate = 1 (on)
and acceptable speed for example:
ssheikki:~# hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 0.43 seconds =297.67 MB/sec
Timing buffered disk reads: 64 MB in 1.17 seconds = 54.70 MB/sec
If you get "HDIO_SET_DMA failed: Invalid argument",
when setting hdparm -d1 /dev/hda then your
kernel is missing VIA module. Select it from:
ATA/IDE/MFM/RLL support --->
IDE, ATA and ATAPI Block devices --->
<*> VIA82CXXX chipset support
For real world tests:
Writing speed:
time dd if=/dev/zero of=test bs=1048576 count=1024
Reading speed:
time dd if=test of=/dev/null bs=1048576 count=1024
In the end you can umount your file system and do fsck(filesystem check):
For ext2 in is done: e2fsck -c -c -C 0 -f -v /dev/hdXX
Helvetin skandit
You can try these and hope that it will work! :)
1. loadkeys fi-latin1
2. add to /etc/locale.gen following
fi_FI ISO-8859-1
fi_FI@euro ISO-8859-15
And the run locale-gen.
3. http://www.arska.org/finnish-howto/html/
4. xorg.conf keyboard should look about like this for Finns:
Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105" # pc105 is finnish
Option "XkbLayout" "fi"
EndSection
/dev/null breaks
rm the old and create new with:
mknod -m 666 /dev/null c 1 3
The break might cause for example sshd fail
to start(sshd[756]: fatal: daemon() failed: Success).
Change finger information
Use chfn command.
Setting up libraries
Add library paths in:
/etc/ld.so.conf
See man for the following commands:
ldconfig
ldd program
Gphoto2 & USB settings
You need USB support from kernel(see preferred kernel settings below and/or Linux USB).
You need: libusb
You need: libgphoto2 installed. Remember to see that
usb is found by libgphoto2.
Last you need: gphoto2 installed.
How to know that something might work:
less /proc/bus/usb/devices
gphoto2 --list-ports
gphoto2 --auto-detect
Prefered kernel settings for usb:
debian:/usr/src/kernel/linux-2.6.7# grep -i usb .config | grep -v "#"
CONFIG_USB=m
CONFIG_USB_DEVICEFS=y
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_HID=m
CONFIG_USB_HIDINPUT=y
Find out who is using some file or socket
fuser -v /resource
Ssh authentication without password
Goto computer FROM where you want to access some computer:
Generate key pares:
ssh-keygen -b 2048 -t dsa
Copy the file to the computer you want to access. If many
computers, just append the id_dsa.pub-file to authorized_keys-file.
scp id_dsa.pub user@remotehost:.ssh/authorized_keys
And volaa... do a test:
ssh user@remotehost
Install windows and Linux on different harddrives, Lilo config
Situation example: linux on Master Disk MBR(/dev/hda) and windows on
Slave Disk MBR(/dev/hdb). In this situation, linux bootloader(lilo
in this example) starts from Master MBR. To add Windows boot you
need to add following choice to /etc/lilo.conf.
other=/dev/hdb2
label="Windows"
table=/dev/hdb
map-drive=0x80
to=0x81
map-drive=0x81
to=0x80
It changes the active disk in the boot so Windows will
be booted unnoticed.
Where are your cd-roms
To see this, cat:
cat /proc/sys/dev/cdrom/info
Second LoopBack interface/ip for local usage
If you want 193.167.3.129, for example, to point to your own
computer, use:
/sbin/ifconfig lo:1 193.167.3.129
Test in local:
ssheikki@jt11-231-2:/$ traceroute 193.167.3.129
traceroute to 193.167.3.129 (193.167.3.129), 30 hops max, 38 byte packets
1 jt11-231-2 (193.167.3.129) 0.061 ms 0.020 ms 0.014 ms
Test in computer where loopBack adapter isn't used:
ssheikki@jt7-236:~$ traceroute 193.167.3.129
traceroute to 193.167.3.129 (193.167.3.129), 30 hops max, 38 byte packets
1 trinet-gw (130.233.31.254) 2.303 ms 2.331 ms 3.403 ms
2 gw-2-v96.hut.fi (130.233.231.19) 0.899 ms 0.634 ms 0.681 ms
3 u35211.win.hut.fi (193.167.3.129) 0.833 ms 4.314 ms 0.591 ms
Howto setup http over SSL(https)
creating the certificate and config apache
securing the actual webpages
Howto tunnel RMI through HTTP
Install Apache 2.x to port 80.
Install Tomcat 4.x to port 8080. For windows, use exe-installer.
Install Tomcat Web Server Connectors, i.e. get mod_jk_1.2.x.dll(in linux
mod_jk_1.2.x.so).
Make sure you have following lines in Apache httpd.conf:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
RewriteEngine on
RewriteLog C:/tomcat/rewrite.log
RewriteLogLevel 9
RewriteRule ^/cgi-bin/java\-rmi\.cgi$ http://localhost/examples/servlet/ServletHandler [P]
LoadModule jk_module C:/Winnt/system32/mod_jk_1.2.5_2.0.47.dll
JkWorkersFile "C:/tomcat/conf/workers.properties"
JkLogFile "C:/tomcat/logs/mod_jk.log"
JkLogLevel info
JkMount /manager ajp13
JkMount /manager/* ajp13
JkMount /examples ajp13
JkMount /examples/* ajp13
JkMount /tomcat-docs ajp13
JkMount /tomcat-docs/* ajp13
JkMount /webdav ajp13
JkMount /webdav/* ajp13
JkMount /*.jsp ajp13
tomcat/conf/workers.properties should contain:
workers.tomcat_home=C:/tomcat
workers.java_home=C:\j2sdk1.4.2_01
ps=\
worker.list=ajp13, ajp14
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)server$(ps)lib$(ps)catalina.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)server$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
Tadaa... you might want to test with: rmiservlethandler.zip.
My iteration time for this easy setup was 16h. :I
Image and video screen capture in Linux
The software for this is xvidcap.
To capture in avi format for example:
xvidcap --file grap.avi --time 100
Brilliant! :)
Making thumbnails images
Use convert:
convert -resize 15x15% original.gif original_thumb.gif
It might be usefull to use script:
for image in *.jpg
do
echo "Processing: $image ..."
convert -resize 15x15% $image thumbs/$image
echo "done."
done
Create animated gifs
Gifmerge is neat and simple:
./gifmerge -l0 -10 animate_this/*.gif > anim.gif
Sometimes you might to need a script, that selects non-duplicate images and
converts them to be in right format and then creates the animation:
mkdir __tmp
for image in *.gif
do
if [ $image_prev ] ; then
diffout="`diff $image_prev $image | wc -l`"
if [ $diffout = "0" ] ; then
echo "Identical images: $image_prev $image, not processed."
else
convert -resize 100x100% $image __tmp/$image
echo "Image $image processed."
fi
else
convert -resize 100x100% $image __tmp/$image
echo "Image $image processed."
fi
image_prev=$image
done
./gifmerge -l0 -10 __tmp/*.gif > anim.gif
rm -rf __tmp
echo "Output should be here:"
ls -laF anim.gif
echo "done."
Shell scripting
http://vertigo.hsrl.rutgers.edu/ug/shell_help.html
DVD players
Install ogle and ogle-gui. Remeber that you also need
libdvdcss
for all movies to be readable.
Example run:
ogle -u gui /dev/hdc
Howto install foreign packages(rpm, etc.) in debian
There is program called alien, which converts packages
to debian packages which can be then easily installed:
alien - Convert or install an alien binary package
alien --to-deb cool-program.rpm
dpkg -i cool-program.deb
Howto merge and edit avi-files
Install avidemux
or avimerge.
Note: Avimerge is easier but has problems with audio and etc.
Video editors
avidemux - best with avi files, at least, maybe best in others too.
cinelerra
Clock synchronization with NTP
Network Time Protocol debian packages: ntp, ntp-simple.
Servers: ntp1.hut.fi, ntp1.funet.fi
List ntp servers:
ntpq -p
Howto capture stream data:
- to capture rm-stream into wav:
vsound -t -v -f output.wav RealPlayer8/realplay input.rm
vsound: digitally record output of an OSS audio program.
- rip radio streams to mp3 files:
streamripper URL
Howto convert sound into mp3/ogg
- audacity - Graphical cross-platform audio editor.
Encodes wav to mp3/ogg and lots of more. And use through very
usable GUI! Brilliant! Myös Suomen kielen tuki löytyy!
Timing commands
at: input time and wanted commands to execute.
crontab input.file: crontab -l list the commands to be executed.
Where the executed program is on the path and it's man page
whereis
Example, where is whereis program:
root@debian:/# whereis whereis
whereis: /usr/bin/whereis /usr/share/man/man1/whereis.1.gz
Search files recursively for wanted string, windows and linux
Linux:
grep -r search_string *
Windows(not in XP):
search search_string
Wget and for example
for((i=9201;9300>i;i++)); do wget http://osoite.org/292_$i.jpg ;done
Converting video formats, e.g. vro to avi/mpeg/etc
Use memcoder, which is part of the mplayer:
mencoder source.vro -o output.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1800 -oac copy
Notes: -ovc defines video codec.
Notes 2: msmpeg4 codec works in Windows
Converting mov -> avi
mencoder *.MOV -o koeX.avi -srate 8000 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1800 -oac mp3lame -lameopts vbr=3:br=32
Update alternative packet
update-alternatives --config automake
Display network information
netstat -a
Print network connections, routing tables, interface
statistics, masquerade connections, and multicast memberships.
Executing X programs as root
Install sux.
Log in as normal user who is allowed to use X programs.
Write sux -, behaves just like su but
transfers $DISPLAY and the X cookies.
Securing computer for local-hack
Disable floppy boot and add-password for lilo:
security +
howto.
More sequrity issues: ulimit.
Bluetooth installation
Pretty good tutorial is here.
But basically it's like this:
- Get kernel patch for bluez; bluez.org.
- Make l2cap, rfcomm, hci_usb kernel modules(no bluez is needed and no
"USB Bluetooth Support" under the USB section is allowed)
- apt-get install bluez-utils
- /etc/init.d/bluez-utils start
- run hciconfig and hcitool scan to scan for devices.
- Look phone info: hcitool info [BD-address]
- rfcomm connect 0 [BD-address]
- For file transfer: apt-get install obexserver and apt-get install openobex-apps.
- register channel: sdptool add --channel=10 OPUSH
- Just start obexserver and send images from phone.
- And then liken in here:
obex_test -b [BB-address] 10 and then c(check connection), x(push file), g(get file).
- Backup/synchronize your calendar, contacts and TODO-list:
apt-get install; multisync, libmultisync-plugin-irmc-bluetooth, libmultisync-plugin-backup.
- rfcomm connect 0 [BD-address]
- To transfer sms-messages etc: gnokii and gnocky.
- TO find out: opexftp.
Execute images with qemu
The QEMU System emulator simulates a complete PC!
Update dynamic libraries
Configure dynamic linker run-time bindings:
ldconfig
Security tools
Nessus; free, powerful, up-to-date and easy to use remote security scanner.
tiger; report system security vulnerabilities.
Neural Network implementations
Fast Artificial Neural Network Library implements multilayer artificial
neural networks in C with support for both fully connected and sparsely connected networks:
http://fann.sourceforge.net/
USB hard disk
- Check that disk is detected, e.g.: less /proc/bus/usb/devices
- Partition the disk, e.g.: cfdisk /dev/sda
- Format the partitions, e.g.: mke2fs -j /dev/sdaX
- Test speed(~27MB/sec) e.g.: hdparm -tT /dev/sda6
- Mount and enjoy, e.g.: mount -t ext3 /dev/sda6 /usbhd
Samba
smbstatus, smbclient, smbmount.
CVS-howto
set up: cvs -d CVSROOT init
import: cvs -dCVSROOT import projektinnimi vendor_tag release_tag
e.g. cvs -d/private/cvs_repository import peacebot TKK start
set CVSROOT: export CVSROOT=:ext:ssheikki@kosh.hut.fi:/u/opi/90/ssheikki/cvs_repository
Benchmarking computers
LMbench, Tools for Performance Analysis.
Open connections
Show all open connections: netstat -a
Show port numbers: netstat -n -a
Who is using port: fuser -n tcp
Verbose who is using port: fuser -n tcp -v
DNS name server
apt-get install bind
To create for exaple alias for jt11-117-3.tky.hut.fi
master zone tky.hut.fi
and the name alias jt11-117-3
For easy configuration, please install webmin.
webmin-bind, webmin-apache, webmin-samba, etc...
Note that webmin starts it's own http server:
https://127.0.0.1:10000/
Analyze X-window connections
xdpyinfo - display information utility for X
xev - print contents of X events
xwininfo - window information utility for X
Partitioning disk in linux so that windows understands it
Partion like this,
Device Boot Start End Blocks Id System
/dev/sdb1 1 1824 14651248+ c W95 FAT32 (LBA)
/dev/sdb2 4256 30401 210017745 5 Extended
/dev/sdb3 1825 4255 19527007+ c W95 FAT32 (LBA)
/dev/sdb5 * 4256 5471 9767488+ 83 Linux
/dev/sdb6 5472 30401 200250193+ 83 Linux
Now evetyhing is ok but the Extended type is wrong. Let's
change it with fdisk.
Command (m for help): t
Partition number (1-6): 2
Hex code (type L to list codes): L
Hex code (type L to list codes): f
Command (m for help): w
Now the table looks like this:
Device Boot Start End Blocks Id System
/dev/sdb1 1 1824 14651248+ c W95 FAT32 (LBA)
/dev/sdb2 4256 30401 210017745 f W95 Ext'd (LBA)
/dev/sdb3 1825 4255 19527007+ c W95 FAT32 (LBA)
/dev/sdb5 * 4256 5471 9767488+ 83 Linux
/dev/sdb6 5472 30401 200250193+ 83 Linux
Backup whole mysql-database
Dump all databases with root access:
mysqldump --all-databases -p -u root | gzip -c > mysql_dump_archive.sql.gz
To restore the databases, run the console output of gzip through mysql:
gzip -cd mysql_dump_archive.sql.gz | mysql -u root -p
Another option is to log as a root into a mysql database:
mysql -u root -p
If you do not remember your password, you can reset it using root shell:
/usr/bin/mysqladmin -u root password 'new_password'
and then execute
source mysql_dump_archive.sql;
Upgrading mysql database from 1.5 to 1.7.1 (Ubuntu)
Step1:
Take backup of the mysql database and save AdminSettings.php and
LocalSettings.php files. Install using aptitude the new mediawiki
version (do not configure it!!, just install, i.e. aptitude install
mediawiki). Copy AdminSettings.php and LocalSettings.php to
/var/lib/mediawiki1.7 directory.
Step2:
Sign in the mysql database (mysql -u root -p) and rename your old table
to text table. Like this:
usedb wikidb;
rename table sm_old to sm_text;
Step3:
Go to the /usr/share/mediawiki1.7/maintenance directory and command
"php upgrade.php". All should go happily and last print is "Done.".
Then command "php refreshLinks.php" to finish. Now the database should
work again as before (or better).
Backuping the mediawiki
Make a static html page backup with:
php /usr/share/mediawiki1.7/maintenance/dumpHTML.php -d /destination/dir
Make an xml dump of the database:
php dumpBackup.php --full > dumpBackup.xml
Dump mysql databases:
mysqldump --all-databases -p -u root | gzip -c > mysql_dump_archive.sql.gz
GANTT chart - project management tool
planner
Irssi
/set term_charset ISO-8859-15
/set term_force_colors ON
sftp/scp connection with chroot
You can restrict the user to his home directory:
apt-get install scponly
Check that /usr/sbin/scponlyc has suid:
chmod 4755 scponlyc
Using rdesktop
Opening a connection with 24bit 80% windows size and with local disk linked to the remote computer:
rdesktop -a 24 -g 80% -r disk:yebbey=/home/ssheikki/ rondo.tkk.fi
Opening a connection with 24bit fullscreen and with local disk linked to the remote computer:
rdesktop -a 24 -f -r disk:yebbey=/home/ssheikki/ rondo.tkk.fi
Connecting a computer behind firewall:
If you have a ssh server that you can connect at TKK, just make a ssh tunnel to that computer like this:
ssh -L 7777:rondo.tkk.fi:3389 username@autlab
Now you can open remote desktop just by connecting:
rdesktop -a 24 -f -r disk:localdisk=/home/username/ localhost:7777
SVN (Subversion) howto
Checkout:
svn checkout http://repository.address.com/path
Status of local files compared to the svn repository:
svn status [files/dirs]
Update:
svn commit [files/dirs]
Commit:
svn commit [files/dirs]
Resolve (my files are good, update them to repository):
svn resolved [files/dirs]
Revert (my files are crap, get original ones from repository):
svn revert [files/dirs]
Check what is the status of files in current directory:
svn -v status
swheikki
ruuvi.helsinki.fi
melkinpaasi.cs.helsinki.fi
subversion howto with https
List project in repository:
svn --username ssheikki list https://localhost/svn/
Import a directory (svnhowto) to repository as svnhowto:
svn --username ssheikki import svnhowto https://localhost/svn/svnhowto -m "initial import"
Checkout all from repository :
svn --username ssheikki checkout https://localhost/svn
Commit:
svn commit
Delete:
svn delete svnhowto
subversion howto with ssh
Same commands as above but you need to give path in the server:
export SVN_SSH="ssh -l ssheikki"
svn checkout svn+ssh://aut40/svn_repository/project_name
subversion howto with local repository
svn co file:///svn_repository/project_name
Multiple ssh connections via one ip
Add in /etc/ssh/ssh_config or in ~/.ssh/config
Host aut40
Hostname yourserver.ftl
Port 49490
HostKeyAlias aut40
CheckHostIP no
Host lap
Hostname yourserver.ftl
Port 49491
HostKeyAlias lap
CheckHostIP no
Pasword change with first visit
After creating the username, set the password to be expired. It requires
user the change it when he tries to log in:
passwd -e
Howto backup your hard disk
dump and restore packages
Tar exclude directory
tar -cvfX tar-name.tar exclude-file dirtobetarred/
Find file with full path and date
find . | grep McCtrl.c > /tmp/lsgreptmp && ll `cat /tmp/lsgreptmp`
Kernel magic instructions
List instructions, helps if computer is jammed:
Alt + Prnt Screen + h
Display all IRQ:s
cat /proc/interrupts
Design programs (open source)
* Inkscape (http://www.inkscape.org/), Open Source vector graphics editor, with capabilities similar to Illustrator, Freehand, CorelDraw, or Xara X.
* Dia (http://dia-installer.sourceforge.net/), diagram creation program, inspired by the commercial Windows program 'Visio'.
* GIMP (http://www.gimp.org/), GNU Image Manipulation Program, for such tasks as photo retouching, image composition and image authoring.
Programming editors (open source)
# Code::blocks (http://www.codeblocks.org/) (Windows)
# devcpp (http://www.bloodshed.net/devcpp.html) (Windows)
Tell command that parameters end
Problem, e.g. howto remove --bzip2 file. Answer:
rm -- "--bzip2"