Friday, 31 July 2009

VPN Linux

VPN Linux:

links
http://ubuntuforums.org/showthread.php?t=201349
http://openvpn.net/index.php/open-source/documentation/howto.html
http://home.gna.org/kvpnc/en/index.html






Installing OpenVPN

OpenVPN can be downloaded here.

For security, it's a good idea to check the file release signature after downloading.

The OpenVPN executable should be installed on both server and client machines, since the single executable provides both client and server functions.
Linux Notes (using RPM package)

If you are using a Linux distribution which supports RPM packages (SuSE, Fedora, Redhat, etc.), it's best to install using this mechanism. The easiest method is to find an existing binary RPM file for your distribution. You can also build your own binary RPM file:

rpmbuild -tb openvpn-[version].tar.gz

Once you have the .rpm file, you can install it with the usual

rpm -ivh openvpn-[details].rpm

or upgrade an existing installation with

rpm -Uvh openvpn-[details].rpm

Installing OpenVPN from a binary RPM package has these dependencies:

* openssl
* lzo
* pam

Furthermore, if you are building your own binary RPM package, there are several additional dependencies:

* openssl-devel
* lzo-devel
* pam-devel

See the openvpn.spec file for additional notes on building an RPM package for Red Hat Linux 9 or building with reduced dependencies.

Sunday, 19 July 2009

IRSSI (IRC CLI)

IRSSI (IRC CLI)

Usage: Copy the .theme file to ~/.irssi/ directory,
change the theme with:
/SET theme theme_name

/connect irc.ubuntu.com
/join #ubuntu


-last 10 msg recived
/last receive 10

-no goodbye msg it think
/part #intersocs


-To close a window you're not using anymore, type
/wc


-search irc channel list for a string
/list *channelname*


-if someone mentions "helpdesk" highlight
/hilight helpdesk

-When you come back type just /away and you'll see any hilights you missed between you going and coming back.
/away gonesomewhere back soon.

LINUX ASSEMBLY

LINUX ASSEMBLY

Some example code always helps:

mov eax,1 ; The exit syscall number
mov ebx,0 ; Have an exit code of 0
int 80h ; Interrupt 80h, the thing that pokes the kernel and says, "Yo, do this"


=====================================

/usr/include/asm/unistd.h

===================

This is the syscall you use to write to, well, a file. But you also use it to print stuff on the screen. "Why the heck is that?" you ask. See, in Linux everything is a file. Things like the screen, mice, printers, etc. are special files called "device files", but you read and write to them just like you do to a text file. This actually makes sense, because reading/writing files is one of the simplest things to do in programming, so why not do everything in the same simple way - but I digress.


=====================================
you use the extended 32-bit registers EAX, EBX, ECX
instead of the normal 16-bit registers AX, BX, CX etc.




An assembly program can be divided into three sections:

* The .data section

This section is for "declaring initialized data", in other words defining "variables" that already contain stuff. However this data does not change at runtime so they're not really variables. The .data section is used for things like filenames and buffer sizes, and you can also define constants using the EQU instruction. Here you can use the DB, DW, DD, DQ and DT instructions. For example:

section .data
message: db 'Hello world!' ; Declare message to contain the bytes 'Hello world!' (without quotes)
msglength: equ 12 ; Declare msglength to have the constant value 12
buffersize: dw 1024 ; Declare buffersize to be a word containing 1024

* The .bss section

This section is where you declare your variables. You use the RESB, RESW, RESD, RESQ and REST instructions to reserve uninitialized space in memory for your variables, like this:

section .bss
filename: resb 255 ; Reserve 255 bytes
number: resb 1 ; Reserve 1 byte
bignum: resw 1 ; Reserve 1 word (1 word = 2 bytes)
realarray: resq 10 ; Reserve an array of 10 reals

* The .text section

This is where the actual assembly code is written. The .text section must begin with the declaration global _start, which just tells the kernel where the program execution begins. (It's like the main function in C or Java, only it's not a function, just a starting point.) Eg.:

section .text
global _start

_start:
pop ebx ; Here is the where the program actually begins
.
.
.


======================


4.3 Linux System Calls

Linux system calls are called in exactly the same way as DOS system calls:

1. You put the system call number in EAX (we're dealing with 32-bit registers here, remember)
2. You set up the arguments to the system call in EBX, ECX, etc.
3. You call the relevant interrupt (for DOS, 21h; for Linux, 80h)
4. The result is usually returned in EAX

There are six registers that are used for the arguments that the system call takes. The first argument goes in EBX, the second in ECX, then EDX, ESI, EDI, and finally EBP, if there are so many. If there are more than six arguments, EBX must contain the memory location where the list of arguments is stored - but don't worry about this because it's unlikely that you'll use a syscall with more than six arguments. The wonderful thing about this scheme is that Linux uses it consistently – all system calls are designed this way, there are no confusing exceptions.

Sunday, 12 July 2009

SAMBA!!!

SAMBA


Samba's configuration is stored in the smb.conf file, which usually resides in /etc/samba/smb.conf or /usr/local/samba/lib/smb.conf

===

List Shares Available on the Server

To list shares that are available from the configured Samba server, execute the following command:

$ smbclient -L yourhostname



=========================
Connect with a UNIX Client

Enter the following command:

$ smbclient //yourhostname/aservice

Typically yourhostname is the name of the host on which smbd has been installed. The aservice is any service that has been defined in the smb.conf file. Try your username if you just have a [homes] section in the smb.conf file.

Example: If the UNIX host is called bambi and a valid login name is fred, you would type:

$ smbclient //bambi/fred


====================================================================

TDB Database
SWAT is a webbased interface for samba i think see links



=================================================

Configuration File Syntax

The smb.conf file uses the same syntax as the various old .ini files in Windows 3.1: Each file consists of various sections, which are started by putting the section name between brackets ([]) on a new line. Each contains zero or more key/value pairs separated by an equality sign (=). The file is just a plaintext file, so you can open and edit it with your favorite editing tool.

Each section in the smb.conf file represents either a share or a meta-service on the Samba server. The section [global] is special, since it contains settings that apply to the whole Samba server. Samba supports a number of meta-services, each of which serves its own purpose. For example, the [homes] share is a meta-service that causes Samba to provide a personal home share for each user. The [printers] share is a meta-service that establishes print queue support and that specifies the location of the intermediate spool directory into which print jobs are received from Windows clients prior to being dispatched to the UNIX/Linux print spooler.

The printers meta-service will cause every printer that is either specified in a printcap file, via the lpstat, or via the CUPS API, to be published as a shared print queue. The printers stanza in the smb.conf file can be set as not browseable. If it is set to be browseable, then it will be visible as if it is a share. That makes no sense given that this meta-service is responsible only for making UNIX system printers available as Windows print queues. If a comment parameter is specified, the value of it will be displayed as part of the printer name in Windows Explorer browse lists.

Each section of the smb.conf file that specifies a share, or a meta-service, is called a stanza. The global stanza specifies settings that affect all the other stanzas in the smb.conf file. Configuration parameters are documented in the smb.conf man page. Some parameters can be used only in the global stanza, some only in share or meta-service stanzas, and some can be used globally or just within a share or meta-service stanza.

A minimal smb.conf contains a very minimal smb.conf.

Example 1.1. A minimal smb.conf

LINKS:
- http://www.go2linux.org/how-to-install-samba-on-linux-with-swat
- http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html

Saturday, 11 July 2009

avi to DVD Authoring

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

http://www.lynchconsulting.com.au/blog/index.cfm/2007/12/24/HOWTO-Create-DVDs-on-Ubuntu

=============================================
To create simple DVD's (i.e. with no title menu's) you need the following software:

  • mplayer
  • videotrans
  • libxvidcore4
  • dvdauthor
  • mkisofs

To install all this use:

$ sudo apt-get install mplayer videotrans dvdauthor mkisofs libxvidcore4

Here are the simple steps to format a video for DVD:

First, make sure you can view the video using mplayer:

$ mplayer MyMovie.avi

Then we convert if to DVD mpeg format:

$ movie-to-dvd -m pal MyMovie.avi

This will create two files: MyMovie.m2v and MyMovie.ac3 which we need to merge back together:

$ mplex -f 8 -o MyMovie.mpg MyMovie.m2v MyMovie.ac3

Format the video for DVD:

$ dvdauthor -o dvd/ -t MyMovie.mpg

Create a title page for it:

$ dvdauthor -o dvd/ -T

Create an ISO image to burn to dvd:

$ mkisofs -dvd-video -v -o MyMovie.iso dvd

Tuesday, 30 June 2009

(ubuntu tips)

- http://www.go2linux.org/how-to-install-samba-on-linux-with-swat
- http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch05_:_Troubleshooting_Linux_with_syslog


Ubuntu can play the most popular non-free media formats, including DVD, MP3, Quicktime, Windows Media

apt:ubuntu-restricted-extras?section=universe?section=multiverse


LINKS:
https://help.ubuntu.com/community/RestrictedFormats/
https://help.ubuntu.com/community/Medibuntu



======================


Ubuntu contains a very powerful firewall called netfilter that is part of
the central kernel program.

netfilter GUI: Firestarter
-------------------------------------------------


sudo apt‐get update
sudo apt‐get upgrade
or
sudo apt‐get update
sudo apt‐get dist‐upgrade

-------------------------------------------------------------------

Vim
Emacs (CLI mode using emacs --no-window and in GUI mode)
Nano

-------------------------------------------------------------------

MPlayer
SMPlayer
VLC


---------------------------------------------------------------------

network card info:

ifconfig


------------------------------------------------------------------------


So, here we go:

1. Follow the official instruction to install all the restricted formats:

sudo apt-get install ubuntu-restricted-extras

2. Install MPlayer:

sudo apt-get install mplayer

3. Download MPlayer binary codecs package from here.
4. Install MPlayer binary codecs package: (Note: the package name may differ from yours.)

tar xjvf essential-20071007.tar.bz2
sudo mkdir /usr/lib/codecs
sudo cp essential-20071007/* /usr/lib/codecs

At this point, you should be able to play rmvb files now. In case you still can’t, install libstdc++5 as follow:

sudo apt-get install libstdc++5

Bonus: I highly recommend you to give SMPlayer a try. You can get SMPlayer by:

sudo apt-get install smplayer





=========================================================

CHANGE FILE PERMITIONS

sudo chmod -R a+rwx .mozilla

links:
http://www.freeos.com/articles/4440/
http://lowfatlinux.com/linux-file-permissions.html




LISTING FILES AND DIRS

ls [list, all, show direcrtys] search string
ls -lad .mo*


MOVING AND COPYING FILES

cp -i file file2
cp file1 file2 file3 dir1
mv file file2


LINKS
http://www.tuxfiles.org/linuxhelp/fileman.html

================================

ssh gui tunneling
enovativ: No problem. To clear this up, run ssh -X (or ssh -Y) in your machine and run a command "firefox &" would bri

==========


list current processes.:
ps -e

kill a process:
kill

Monday, 22 June 2009

harddrive partition and folder properties

GRUB setup instructions
http://ubuntuforums.org/showthread.php?t=224351
-----------------------------------------------------------------------------------------------------------------

to the "sudo chown" and "sudo chmod" commands. In a unix/linux system, users can only write into their home directory by default. this is a very good approach, because this way, it is hardly possible that one user breaks the system (by accident or intentionally).


Drives by default belong to the root user



sudo mkdir /media/Disk/userdata

or using Nautilus as root ("gksudo nautilus").

Then, you give the directory to the user

sudo chown youruser:youruser /media/Disk/userdata

You can also do this with nautilus as root.


From this point, it is n excellent idea to create a symbolic link to that directory under the home directory of the user. That way, the user will be able to reach his space on the drive from within his home directory (where al his other data are as well).

sudo ln -s /media/Disk/userdata /home/youruser/userdata


src: http://ubuntuforums.org/showthread.php?t=543






Now I need to give it the proper permissions. Let's just assume, for this example, that my username is marie.
sudo chown -R marie:marie /storage
sudo chmod -R 755 /storage