Posted by superuser
Sat, 18 Jun 2011 05:02:00 GMT
Αν θέλετε να εκτελέσετε μια μεταφορά πολλών αρχείων με scp, διατρέχετε τον κίνδυνο να διακοπεί η σύνδεση, και να μείνει στη μέση η δουλειά σας. Ο πιο απλός τρόπος για να τρέξουμε μία διεργασία σε φόντο, και ταυτόχρονα να την αποδεσμεύσουμε από την κονσόλα είναι με τη χρήση των εντολών unix
nohup και με ένα τελικό (ampersand) & . Το πρόβλημα με την εντολή
σψπ είναι ότι μετά την εκτέλεση της περιμένει κωδικό πρόσβασης, οπότε υπάρχει πρόβλημα.
Η λύση είναι απλή, και την βρήκα στο πολύ ενημερωτικό blog του
Kunal Bharati
Εκτελούμε την εντολή nohup δίχως ampersand (&) ώστε να μην οδηγηθεί η διεργασία σε φόντο.
$ nohup scp file_to_copy user@server:/path/to/copy/the/file > nohup.out 2>&1
Δίνουμε τον κωδικό πρόσβασης ssh που θα μας ζητηθεί
και αμέσως μετά , ...
πληκτρολογούμε CTR-Z το οποίο θέτει προσωρινά σε αναμονή την εκτελούμενη διεργασία
Τελευταία λυτρωτική ενέργεια, πληκτρολογήστε
$ bg
και το process πάει στο background.
Posted in Unix | Tags background, bg, CTR, scp, Z | no comments
Posted by superuser
Thu, 11 Mar 2010 12:26:00 GMT
This is a guide on how to install and configure MySQL for the Joomla environment. For the demonstrations of this article i use a FreeBSD-8 OS. The paths for the executables files and the paths where mysql holds the databases it may be different in your case. For example FreeBSD uses most executables scripts on /usr/local/bin/ , while Linux on /usr/bin or /usr/sbin. The rest remains the same.
Installing mysql
Nearly all operating systems have their own package manager. The installation is a straightforward process. You should have root privileges to make a complete installation in binary or to build from sources.
For example:
# sudo apt-get install mysql-server [DEBIAN/UBUNTU]
# pacman -S mysql [ARCHLINUX]
# yum install mysql mysql-server [REDHAT/FEDORA]
# make WITH_CHARSET=utf8 install clean [FreeBSD]
You should note that in the case of FreeBSD, i compile using
WITH_CHARSET=utf8
because mysql by default sets a
latin1 character encoding. If you install mysql using the default latin1 encoding but you intend to use
utf8 characters in your app, you'll be in trouble. Check what default character encodings use your distribution for mysql server. As far as i know, Archlinux ships with default utf8 encodings, while Fedora with latin1, as FreeBSD does.
Configuration of mysql
Immediately after the completion of your installation you must create the directory where your databases will be stored . Again with root privileges:
# /usr/local/bin/mysql_install_db
Check that the directory /var/db/mysql has been created with a lot of stuff inside. In some distributions this directory (/var/db/mysql) has not the appropriate permissions for the group and it's owned by root. We should change that, otherwise mysql server will deny to start.
# chgrp -R mysql /var/db/mysql
# chown -R mysql /var/db/mysql
Starting mysql & Setting the mysql-Root password
Let's start now the mysql server
# /usr/local/bin/mysqld_safe -user=mysql &
[1] 2783
localhost# Starting mysqld daemon with databases from /var/db/mysql
If you don't get an error at this step, you can be sure that mysqld daemon is up and running..
When you need to stop the server (don't do this now)
$ mysqladmin -u root -p shutdown
From now on, we have no need for system-root privileges, so use your ordinary user account.
In our last step before starting to work with MySQL, is to set the password for the mysql-root account (mysql-root account is not related in anyway with the system-root account of your OS. Are completely different concepts. The first is a mysql user, the later a system user. The only conceptual thing in common is that both have full privileges for their environment). Replace new password with your secret mysql-root password.
$ /usr/local/bin/mysqladmin -u root password newpassword
Creating the database
It's time to create my mysql database now, i call it "joodb" :
$ mysqladmin -u root -p create joodb
Enter password: [enter your mysql root password here]
Check now that your database has been created. Enter at your mysql client and ask to SHOW DATABASES;:
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is xxx
Server version: 5.0.51a FreeBSD port: mysql-server-5.0.51a
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>show databases;
Your database list should include joodb. Fine! joodb database is ready to use, but for security issues mysql permits the usage of a db only by privileged mysql-users. Except the root mysql-user, we do not have created any other. Now i'll set the privileges to use "joodb" for a mysql-user named "joom" with password "ladin". This user will be automatically created during the setting of the privilege. The sensible data are "joodb"(database name), "joom"(mysql-username), "ladin"(mysql-password) and the domain "localhost".
mysql> grant all privileges on joodb.* to 'joom'@'localhost'
identified by 'ladin';
Query OK, 0 rows affected (0.09 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)
mysql> \q
Bye
flush privileges enables the privilege and pressing \q you exit the client.
Our database now is ready to use by a mysql-user named joom. Connecting my Joomla application with this database it means simply that i have to provide these informations to the configuration file of Joomla. In the section Database Settingsof the configuration.php i simply set:
#--- configuration.php ---
/* Database Settings */
var $dbtype = 'mysql';
var $host = 'localhost';
var $user = 'joom';
var $password = 'ladin';
var $db = 'joodb';
var $dbprefix = 'jos_';
That's all! We have succesfully created and configured our mysql database, created our mysql-user, set up the privileges and connected at our joomla application. Fire up now with your extra-galactica application.
Posted in Unix | Tags joomla, MySQL, setup | no comments
Posted by superuser
Thu, 31 Dec 2009 12:25:00 GMT
This is a collection of my working environment preferences including nearly everything: OS, Window Manager, Software, Editors, Mailserver, …
The idea for the creation of this list has been adopted from a Pistos’ gist
Environment
Software, Desktop
Software, Server
Programming
Posted in Unix, FreeBSD, Ruby | Tags preferences | no comments
Posted by superuser
Mon, 05 Oct 2009 13:46:00 GMT
Το περασμένο Σαββατοκύριακο ο πάροχος του vps μου δέχθηκε μεγάλη επίθεση με σκοπό την εσκεμμένη αδρανοποίηση των υπηρεσιών των συστημάτων. Επιθέσεις αυτού του τύπου ονομάζονται και DoS attacks (Denial Of Service). Ο πάροχος αναγκάστηκε να μπλοκάρει την προεπιλεγμένη πόρτα ssh, μιας που οι επιθέσεις (14 ώρες !) αφορούσαν ως επί το πλείστον στην κλασσική πόρτα 22, και προέτρεψε όλους τους πελάτες να αλλάξουν πόρτα ssh. Το σύστημα μου είναι FreeBSD 7.1 vps
Η αλλαγή έπρεπε να γίνει μέσω VNC, μιας που η πόρτα 22 ήταν απενεργοποιημένη.
Εγκατέστησα το tsclient με υποστήριξη για vncviewer.
# cd /usr/ports/net/tsclient && make install clean
Για να συνδεθώ συμπλήρωσα τα απαραίτητα πεδία:

Παρατηρήστε ότι αν η θύρα (5129) είναι διαφορετική από την προκαθορισμένη 5800, τότε θα πρέπει να την προσθέσετε στο πεδίο Computer (όλα τα στοιχεία του παραδείγματος στη φωτογραφία είναι προφανώς ψεύτικα!)
O.K. Τώρα έχω εισέλθει στο σύστημα μου μέσω VNC και θέλω να αλλάξω την θύρα ssh.
Το μόνο που χρειάζεται να κάνετε είναι να ορίσετε την τιμή του Port στο /etc/ssh/sshd_config . Προσθέστε την νέα πόρτα (ή αφαιρέστε τον σχολιασμό από την ήδη υπάρχουσα καταχώρηση). Στην πείπτωση μου π.χ.
Port 1234
Αρκεί να ξαναφορτώσετε τη διεργασία sshd και είστε έτοιμοι!
# /etc/rc.d/sshd reload
Συνδεθείτε τώρα μέσω ssh αναφέροντας την νέα πόρτα:
$ ssh myusername@my.vps.net -p 1234
Posted in Unix, FreeBSD | Tags αλλαγή_πόρτας, ssh, tsclient, vnc, vps | no comments
Posted by superuser
Fri, 27 Mar 2009 09:43:00 GMT
I had to transfer my old mysql databases from my old server to a new one. The source and destination servers runs different OSes but this is not a problem, the only requirement to succesfully transfer my dbs is to having setup the mysql server to the destination server. The following steps worked fine in my case. I do a complete backup of my Mysql databases, i transfer the backup file using scp (secure copy) and repristinate with a single command. All that you need is no more than three simple unix command lines.
First i create a complete backup of my mysql databases. There is no need to stop the mysql server to create this backup file. MysqlDump
blocks all databases during backup process. The following command will create the backup file backup.sql (provide your mysql root password when asked).
$ mysqldump -u root -p --all-databases > backup.sql
The second step consists in transfer the backup.sql file in my new server. Although you can use ftp or curl to do so, i prefer SecureCoPy. scp is a very cute unix command line which provides an easy and secure way to copy a single file or an entire directory from a host/server to another host/server node. From my old server i give
$ scp -pr fileORdirectory remote-user@remote-hostname-or-ip:directory/
, where "fileORdirectory" is my fileORdir from the old server,
"remote-user" is my system username to the remote server and "directory/" is the directory where the "fileORdirectory" will be moved on. The initial location is the home directory of the "remote-user", in the same way as you do with a simple ssh connection. Note that ":" is not a port symbol. Saying that now i'm sending my
backup.sql
$ scp -pr backup.sql remote-user@my.newserver.lan:mysql_backups/
Last step: Enter to your new server ("remote-user" should be your username) and make "mysqldump" targeting your backup.sql file to complete the migration.
$ mysql -u root -p < backup.sql
Note that in this way also the mysql root password will be copied to the new server. So, if during the installation you had setup a different root mysql password in the new server, after the backup process this will be changed to the root mysql password of the old server.
Posted in Unix | Tags migration, MySQL, mysqldump, scp, securecopy | 1 comment
Posted by superuser
Fri, 13 Feb 2009 11:12:00 GMT
Here you can find is a list of useful unix-shell commands in order to obtain all the required hardware specifications from your Solaris machine. They should work for all platforms (SPARC, UltraSparc, i386, amd64, ... ) although have been tested only on *SPARCs. I use them often, so exposing them here is a way to remember them. Please check the example's output to see what kind of indormations are included in any case.
The most common command but with poor output:
$ uname -a
SunOS myhost.lan 5.9 Generic_118118-05 sun4u sparc SUNW,Sun-Fire-V210
Hard Disk Specifications:
$ iostat -E
sd0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU Product: xxTxN SUN72G Revision: x6x2 Serial No: 0xx9Bx1xEP
Size: 73.40GB <73400057856 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
sd1 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU Product: xxTxN SUN72G Revision: 0x2x Serial No: 0x0xx0xFxK
Size: 73.40GB <73400057856 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
st11 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: QUANTUM Product: xxTx8xx0 Revision: xx50 Serial No: P
An alternative is the
$ format
command which provides hard disk infos but root permissions are requested.
A good command with complete peripherals references:
$ prtconf
System Configuration: Sun Microsystems sun4u
Memory size: 2048 Megabytes
System Peripherals (Software Nodes):
SUNW,Sun-Fire-V240
packages (driver not attached)
SUNW,builtin-drivers (driver not attached)
deblocker (driver not attached)
disk-label (driver not attached)
terminal-emulator (driver not attached)
dropins (driver not attached)
kbd-translator (driver not attached)
obp-tftp (driver not attached)
SUNW,i2c-ram-device (driver not attached)
SUNW,fru-device (driver not attached)
SUNW,asr (driver not attached)
ufs-file-system (driver not attached)
chosen (driver not attached)
openprom (driver not attached)
client-services (driver not attached)
options, instance #0
aliases (driver not attached)
memory (driver not attached)
virtual-memory (driver not attached)
SUNW,UltraSPARC-IIIi (driver not attached)
memory-controller, instance #0
SUNW,UltraSPARC-IIIi (driver not attached)
memory-controller, instance #1
pci, instance #0
network, instance #0
network, instance #1
pci, instance #1
isa, instance #0
flashprom (driver not attached)
rtc (driver not attached)
i2c, instance #0
i2c-bridge (driver not attached)
i2c-bridge (driver not attached)
motherboard-fru-prom, instance #0
chassis-fru-prom, instance #1
power-supply-fru-prom, instance #2
power-supply-fru-prom, instance #8
dimm-spd, instance #3
dimm-spd, instance #4
dimm-spd, instance #5
dimm-spd, instance #6
rscrtc (driver not attached)
nvram, instance #7
idprom (driver not attached)
gpio, instance #0
.....
gpio, instance #3
power, instance #0
serial, instance #0
serial, instance #1
rmc-comm, instance #0
pmu, instance #0
i2c, instance #0
gpio, instance #0
usb, instance #0
ide, instance #0
disk (driver not attached)
cdrom (driver not attached)
SUNW,qlc, instance #0
fp (driver not attached)
disk (driver not attached)
fp, instance #0
SUNW,qlc, instance #1
fp (driver not attached)
disk (driver not attached)
fp, instance #1
SUNW,qlc, instance #2
fp (driver not attached)
disk (driver not attached)
fp, instance #2
SUNW,qlc, instance #3
fp (driver not attached)
disk (driver not attached)
fp, instance #3
pci, instance #2
scsi, instance #0
disk (driver not attached)
tape (driver not attached)
sd, instance #0
sd, instance #1
..............
st, instance #5 (driver not attached)
st, instance #6 (driver not attached)
scsi, instance #1
disk (driver not attached)
tape (driver not attached)
sd, instance #15 (driver not attached)
sd, instance #16 (driver not attached)
sd, instance #17 (driver not attached)
......
st, instance #11
st, instance #12 (driver not attached)
st, instance #13 (driver not attached)
pci, instance #3
network, instance #2
network, instance #3
pseudo, instance #0
I left the best for the end. This is a powerful scanning of your hardware system. Covers nearly everything. CPU, Processors, Memory, pci, Fan speed, temperature sensors, voltage sensors, led state, ...
$ /usr/platform/`uname -m`/sbin/prtdiag -v
System Configuration: Sun Microsystems sun4u Sun Fire V240
System clock frequency: 167 MHZ
Memory size: 2GB
==================================== CPUs ====================================
E$ CPU CPU Temperature
CPU Freq Size Implementation Mask Die Amb. Status Location
--- -------- ---------- ------------------- ----- ---- ---- ------ --------
0 1503 MHz 1MB SUNW,UltraSPARC-IIIi 3.3 - - online MB/P0
1 1503 MHz 1MB SUNW,UltraSPARC-IIIi 3.3 - - online MB/P1
================================= IO Devices =================================
Bus Freq Slot + Name +
Type MHz Status Path Model
---- ---- ---------- ---------------------------- --------------------
pci 66 MB pci108e,1648 (network)
okay /pci@1f,700000/network@2
pci 66 MB pci108e,1648 (network)
okay /pci@1f,700000/network@2,1
pci 33 MB isa/su (serial)
okay /pci@1e,600000/isa@7/serial@0,3f8
pci 33 MB isa/su (serial)
okay /pci@1e,600000/isa@7/serial@0,2e8
pci 33 MB pci10b9,5229 (ide)
okay /pci@1e,600000/ide@d
pci 33 PCI2 SUNW,qlc-pci1077,2312 (scsi-+
okay /pci@1e,600000/SUNW,qlc@2
pci 33 PCI2 SUNW,qlc-pci1077,2312 (scsi-+
okay /pci@1e,600000/SUNW,qlc@2,1
pci 33 PCI1 SUNW,qlc-pci1077,2312 (scsi-+
okay /pci@1e,600000/SUNW,qlc@3
pci 33 PCI1 SUNW,qlc-pci1077,2312 (scsi-+
okay /pci@1e,600000/SUNW,qlc@3,1
pci 66 MB scsi-pci1000,21 (scsi-2)
okay /pci@1c,600000/scsi@2
pci 66 MB scsi-pci1000,21 (scsi-2)
okay /pci@1c,600000/scsi@2,1
pci 66 MB pci108e,1648 (network)
okay /pci@1d,700000/network@2
pci 66 MB pci108e,1648 (network)
okay /pci@1d,700000/network@2,1
pci 33 7 isa/rmc-comm-rmc_comm (seria+
okay /pci@1e,600000/isa@7/rmc-comm@0,3e8
pci 33 10 pciclass,0c0310 (usb)
okay /pci@1e,600000/usb@a
============================ Memory Configuration ============================
Segment Table:
-----------------------------------------------------------------------
Base Address Size Interleave Factor Contains
-----------------------------------------------------------------------
0x0 1GB 1 BankIDs 0
0x1000000000 1GB 1 BankIDs 16
Bank Table:
-----------------------------------------------------------
Physical Location
ID ControllerID GroupID Size Interleave Way
-----------------------------------------------------------
0 0 0 1GB 0
16 1 0 1GB 0
Memory Module Groups:
--------------------------------------------------
ControllerID GroupID Labels Status
--------------------------------------------------
0 0 MB/P0/B0/D0
0 0 MB/P0/B0/D1
1 0 MB/P1/B0/D0
1 0 MB/P1/B0/D1
============================ Environmental Status ============================
Fan Speeds:
---------------------------------------------
Location Sensor Status Speed
---------------------------------------------
F0 RS okay 6818 rpm
F1 RS okay 7031 rpm
F2 RS okay 6958 rpm
MB/P0/F0 RS okay 16875 rpm
MB/P0/F1 RS okay 17307 rpm
MB/P1/F0 RS okay 18243 rpm
MB/P1/F1 RS okay 17307 rpm
PS0 FF_FAN okay
PS1 FF_FAN okay
Temperature sensors:
-----------------------------------------------------------------------------
Location Sensor Temperature Lo LoWarn HiWarn Hi Status
-----------------------------------------------------------------------------
MB/P0 T_CORE 55C - - 84C 89C okay
MB/P1 T_CORE 50C - - 84C 89C okay
MB T_ENC 24C -3C 5C 40C 48C okay
PS0 FF_OT - - - - - okay
PS1 FF_OT - - - - - okay
----------------------------------------------------------------------
Current sensors:
----------------------------------------------------------------------
Location Sensor Current Lo LoWarn HiWarn Hi Status
----------------------------------------------------------------------
MB FF_SCSI - - - - - okay
PS0 FF_OC - - - - - okay
PS1 FF_OC - - - - - okay
------------------------------------------------------------------------
Voltage sensors:
------------------------------------------------------------------------
Location Sensor Voltage Lo LoWarn HiWarn Hi Status
------------------------------------------------------------------------
MB/P0 V_CORE 1.45V - 1.26V 1.54V - okay
MB/P1 V_CORE 1.46V - 1.26V 1.54V - okay
MB V_VTT 1.25V - 1.17V 1.43V - okay
MB V_GBE_+2V5 2.51V - 2.25V 2.75V - okay
MB V_GBE_CORE 1.21V - 1.08V 1.32V - okay
MB V_VCCTM 2.53V - 2.25V 2.75V - okay
MB V_+2V5 2.49V - 2.34V 2.86V - okay
MB V_+1V5 1.51V - 1.35V 1.65V - okay
MB/BAT V_BAT 2.97V - 2.70V - - okay
PS0 P_PWR - - - - - okay
---------------------
Keyswitch:
---------------------
Location State
---------------------
SYSCTRL NORMAL
--------------------------------------------------
Led State:
--------------------------------------------------
Location Led State Color
--------------------------------------------------
MB ACT on green
MB SERVICE off amber
MB LOCATE off white
PS0 ACT on green
PS0 SERVICE off amber
PS0 OK2RM off blue
PS1 ACT on green
PS1 SERVICE off amber
PS1 OK2RM off blue
HDD0 SERVICE off amber
HDD0 OK2RM off blue
HDD1 SERVICE off amber
HDD1 OK2RM off blue
HDD2 SERVICE off amber
HDD2 OK2RM off blue
HDD3 SERVICE off amber
HDD3 OK2RM off blue
=========================== FRU Operational Status ===========================
-------------------------
Fru Operational Status:
-------------------------
Location Status
-------------------------
MB/SC okay
PS0 okay
HDD0 present
HDD1 present
PS1 okay
================================ HW Revisions ================================
ASIC Revisions:
-------------------------------------------------------------------
Path Device Status Revision
-------------------------------------------------------------------
/pci@1f,700000 pci108e,a801 okay 4
/pci@1e,600000 pci108e,a801 okay 4
/pci@1c,600000 pci108e,a801 okay 4
/pci@1d,700000 pci108e,a801 okay 4
System PROM revisions:
----------------------
OBP 4.16.2 2004/10/04 18:22 Sun Fire V210/V240,Netra 240
OBDIAG 4.16.2 2004/10/04 18:23
Posted in Unix | Tags format, hardware, iostat, prtconf, prtdiag, solaris, specifications, uname | 2 comments
Posted by superuser
Thu, 12 Feb 2009 19:40:00 GMT
Per chi fosse interessato ad iniziare a imparare i segreti di amministrazione di un sistema unix o linux c'e' un'eccezionale dispensa scritta da Giuseppe Anastasi e Andrea Passerella con titolo "Amministrazione di un Sistema Unix in Rete". Fa parte del materiale didattico per l'esame di "Organizzazione di Sistemi Operativi e Reti" della facolta' di Ingegneria dell'universita' di Pisa (la mia vecchia universita'), ma nonostante cio' e' uno dei migliori libri didattici che ho mai letto per l'introduzione ai sistemi unix. Breve, conciso, serio e molto educativo. Molto utile anche per chi insegna unix ad allievi anche non universitari. C'e' un secondo volume, supplementare che vi consiglierei di scaricare, scritto da A.Passerrela. Tutto il materiale consigliato, e molto ancora e' stato reperito dalla pagina ufficiale http://www2.ing.unipi.it/~d8149/corsi/osor/materiale/
Posted in Unix | Tags Amministrazione, Anastasi, Passerella, UNIX | no comments
Posted by superuser
Fri, 03 Oct 2008 19:02:00 GMT
Είχα αναφερθεί παλαιότερα στο mlDonkey. Το άρθρο αυτό είναι συμπληρωματικό του πρώτου αφού θα προσθέσω τον τρόπο λειτουργίας του προγράμματος μέσω Telnet. Για να ακολουθήσετε τα βήματα χρειάζεται να έχετε εγκατεστημένο μόνο το core του mlDonkey, δηλαδή δεν χρειάζεται η εγκατάσταση κάποιου γραφικού περιβάλλοντος χρήσης (GUI). Μπορεί να φαίνεται άβολο εκ πρώτης όψεως όμως είναι πολύ ενδιαφέρον.
Η εγκατάσταση γίνεται απλά από τα Ports του FreeBSD. Απλά στο make θα προσθέσω τα προθέματα WITHOUT_GUI, WITHOUT_X11, WITHOUT_TK="YES".
# cd /usr/ports/net-p2p/mldonkey
# make WITHOUT_GUI=yes WITHOUT_X11="YES" WITHOUT_TK="YES" install clean
Μετά την ολοκλήρωση της εγκατάστασης, ανοίξτε ένα παράθυρο εντολών (εικονική κονσόλα) και σαν χρήστης ξεκινήστε το core πρόγραμμα δίνοντας mlnet.
$ mlnet
Running under /home/vt33/.mldonkey
2008/10/03 21:53:10 [cO] Starting MLDonkey 2.9.6 ...
2008/10/03 21:53:10 [cO] Language EL, locale UTF-8, ulimit for open files 11095
2008/10/03 21:53:10 [cO] MLDonkey is working in .
2008/10/03 21:53:10 [Gettext] Loading language resource mlnet_strings.el_GR.UTF-8
2008/10/03 21:53:10 [cO] loaded language resource file
2008/10/03 21:53:10 [DNS] Resolving [my.domain.lan] ...
2008/10/03 21:53:10 [DNS] Resolving [www.mldonkey.org] ...
2008/10/03 21:53:10 [dMain] Libmagic file-type recognition database present
2008/10/03 21:53:10 [cO] Logging in ./mlnet.log
2008/10/03 21:53:14 [dMain] Core started
Αυτό το παράθυρο αφήστε το ανοιχτό. Ανοίξτε ένα ακόμη παράθυρο (κονσόλα) εντολών για να κάνουμε τη σύνδεση. Η μόνη πληροφορία που χρειάζεται για τη σύνδεση είναι το hostname του υπολογιστή σας (το δικο μου είναι το "my.domain.lan" γιατί έτσι έχω ονομάσει το δίκτυο μου. Αν δεν έχετε αλλάξει κάτι στον οικιακό υπολογιστή σας τότε το hostname σας είναι "localhost".
$ telnet my.domain.lan 4000
Trying 127.0.0.1...
Connected to my.
Escape character is '^]'.
Welcome to MLDonkey 2.9.6
Welcome on mldonkey command-line
Use ? for help
MLdonkey command-line:
>
Την πρώτη φορά που θα συνδεθείτε θα χρειαστεί να δημιουργήσετε ένα λογαριασμό χρήστη ( ) τον οποίο θα χρησιμοποιείτε κάθε φορά που θα μπαίνετε. Μπορείτε να δημιουργήσετε και άλλους, καθώς και γκρουπ χρηστών .
> useradd mlGaidaros OkoDikOsMoy
User mlGaidaros added, group mldonkey
Δώστε τώρα το αναγνωριστικό σας για να έχετε πλήρη δικαιώματα ενεργειών με auth.
> auth mlGaidaros OkoDikOsMoy
Full access enabled
Τώρα θα πρέπει να φορτώσουμε τη λίστα με τους servers με τους οποίους θα συνδεόμαστε. Μπορείτε να χρησιμοποιήσετε οποιοδήποτε αρχείο .met (είναι τα γνωστά met που έχετε χρησιμοποιήσει σε όλα τα μουλαροειδή ανεξαρτήτως φίρμας και πλατφόρμας). Το mlDonkey συμβουλεύει να χρησιμοποιήσετε το .met του gruk ( http://www.gruk.org/server.met ). Ο λόγος είναι πως είναι οι πιο αξιόπιστοι εξυπηρετητές. Θα σας συμβούλευα και γω να μην χρησιμοποιείτε άλλα met γιατί μπορεί να περιέχουν κακόβουλους σέρβερ, αλλά μια λίστα από εναλλακτικά met μπορείτε να βρείτε εδώ. Δεν παίζει ρόλο ο αριθμός - άλλωστε μέχρι με 4 (?) μπορείτε να συνδεθείτε ταυτόχρονα. Το mlDonkey έχει άλλα προτερήματα - δεν έχει ονομαστεί τυχαία το μαύρο μουλάρι.
.
Για να φορτώσετε λοιπόν τη λίστα των σέρβερ από το met δώστε
> servers http://www.gruk.org/server.met
Από αυτή τη λίστα προεπιλεγμένα θα συνδεθούν τρεις ή τέσσερις σέρβερ. Για να δείτε τη λίστα όλων των διαθέσιμων σέρβερ δώστε vma , για να δείτε με ποιούς έχετε συνδεθεί vm και για να συνδεθείτε με ένα επιπλέον σέρβερ από τη λίστα δώστε c .
Για να κάνετε αναζήτηση δώστε (π.χ. για FreeBSD) :
> s FreeBSD
Query 1 sent to 4 server(s)«
Για να δείτε τα αποτέλεσματα της αναζήτησης δίνετε vr (view results.
> vr
Result of search 2
153 results (done)
[ Num ] Size Avail Status Names Tags MD4
[ 1] 1744715776 1 FreeBSD-6.2-RELEASE-i386-DVD.iso urn:ed2k:7076496503601799E1B0C34623FB8630
[ 2] 728487936 1 [FreeBSD.7.0.].7.0-RELEASE-i386-disc2.iso urn:ed2k:95B28E04F4CE120FEDD08117C224485C
[ 3] 682371072 1 FreeBSD-6.0-RELEASE-i386-disc2.[par.Ratiatu....iso urn:ed2k:B263D4A4E820D96F41BB750AD13E1E8F
[ 4] 660462080 1 CBT - What Is FreeBSD.avi cram urn:ed2k:8C0E6DC1B337598C747035A4AD52BCB6
[ 5] 656064512 1 FreeBSD-6.0-RELEASE-amd64-disc2.iso urn:ed2k:966E21E0574A30C0A3ABCF37EB98DBC2
Για να κατεβάσω π.χ. το τρίτο αποτέλεσμα έχει ένα tag [3 ] το οποίο δηλώνω για το κατέβασμα. Για να το κατεβάσω λοιπόν ... δίνω > d 3 . Για το αποτέλεσμα που έχει tag [11] δίνω > d 11 και ούτω καθεξής. Για να δείτε την πορεία του κατεβάσματος δώστε > vd (view downloads). Για να δείτε τα αποτελέσματα παλαιότερων αναζητήσεων δώστε πρώτα vs (view searches) επιλέξτε την παλιά αναζήτηση και ακολούθως δώστε vr. Για να δείτε την πορεία ανεβασμάτων (uploads) των αρχείων που μοιράζεστε δώστε upstats.
Αν θέλετε να κατεβάσε από torrent , το mlDonkey τα καταφέρνει και εδώ άριστα. Απλά με την εντολή dllink και την διεύθυνση URL του torrent (η παρακάτω URL είναι της έκδοση του i386 FreeBSD).
> dllink http://torrents.thepiratebay.org/4303974/FreeBSD_7.0-RELEASE_i386_DVD.4303974.TPB.torrent
Δώστε ?? (help) για να δείτε όλες τις εντολές που μπορείτε να δώσετε στη κονσόλα. Παραπάνω αναφέρω μόνο τις σημαντικότερες εντολές, συμβουλευτείτε το help γιατί περιέχει πληθώρα χρήσιμων εντολών . Το mlDonkey είναι γραμμένο σε γλώσσα ocaml (objective caml). Διαβάστε την τεκμηρίωση για να καταλάβετε τη σύνταξη της γλώσσας και προγραμματίστε τα "κατεβάσματα" σας.
Τα αρχεία σας αποθηκεύονται για το μεν δίκτυο edonkey στο /.mldonkey/incoming/files/* , ενώ για το δε torrent στον φάκελο /.mldonkey/torrent/seeded/*
Τέλος για να βγείτε ομαλά από την εφαρμογή δώστε kill (στέλνει το σήμα kill στο pid της εφαρμογής και την τερματίζει).
Posted in Unix | Tags command_line, met, MLDONKEY, mlnet, telnet | no comments
Posted by superuser
Tue, 23 Sep 2008 18:29:00 GMT
Ποιός είπε πως Unix και topless δεν πάνε μαζί;
Posted in Unix | Tags Linux, topless | no comments
Posted by superuser
Wed, 05 Dec 2007 17:47:00 GMT
Σιγουρέψτε την αυθεντικότητα και την πληρότητα των αρχείων που κατεβάζετε!
Πολλές φορές όταν στέλνουμε ένα αρχείο μέσω του διαδικτύου ζητούμε να έχουμε την σιγουριά ότι το αρχείο μας έφτασε ακέραιο στον παραλήπτη του χωρίς απώλεια ή προσθήκη δεδομένων. Αυτή την σιγουριά μας την προσφέρει η utility md5sum. Με την md5sum μπορούμε να στείλουμε ένα ή και περισσότερα αρχεία ή και εφαρμογές και ο παραλήπτης τους να διαπιστώσει με ένα πολύ απλό τρόπο ότι το αρχείο έφτασε χωρίς απώλειες και αλλαγές.
Ας υποθέσουμε ότι θέλουμε να στείλουμε σε ένα φίλο μας τις φωτογραφίες που τραβήξαμε κατά τη διάρκεια του καλοκαιριού και θέλουμε να είμαστε σίγουροι ότι θα φτάσουν χωρίς απώλειες κατά την διάρκεια της αποστολής. Χρησιμοποιώντας τον πολύπλοκο αλγόριθμο της md5sum υπολογίζεται το MD5 του αρχείου που θέλουμε να στείλουμε, σώζουμε το αποτέλεσμα σε ένα απλό αρχείο κειμένου προσθέτοντας την επέκταση .md5 αν θέλουμε και το στέλνουμε στον παραλήπτη του αρχείου μαζί με το αρχείο.
Ας δούμε αναλυτικότερα με ποιό τρόπο:
Από το terminal πηγαίνουμε στον φάκελο με τις φωτογραφίες που τον έχουμε ονομάσει fotos.
Ας υποθέσουμε ότι ο φάκελλος περιέχει τρείς φωτογραφίες.
$ cd fotos
Πληκτρολογούμε από το terminal:
$ md5sum * > fotos_md5sum
Αν από το terminal δώσουμε τώρα την εντολή:
ls fotos
θα δούμε ότι στο φάκελο fotos περιέχεται και το αρχείο
fotos_md5sum. Με αυτή την εντολή η utility md5sum δημιουργεί ένα αρχείο, που το ονομάζουμε όπως εμείς θέλουμε για το παράδειγμά μας fotos_md5sum και το οποίο περιέχει αριθμούς σε δεκαεξαψήφια μορφή για κάθε φωτογραφία που περιέχει ο φάκελλος και οι οποίοι μπορούν να επιβεβαιώσουν στον παραλήπτη του αρχείου ότι η μεταφορά του αρχείου έγινε επιτυχώς χωρίς απώλειες ή προσθήκες δεδομένων.
Πολύ εύκολα μπορούμε να το διαπιστώσουμε εάν από το terminal δώσουμε την εντολή:
cat fotos_md5sum
Θα δούμε τη λίστα με τις φωτογραφίες μας με τον αντίστοιχο δεκαεξαψήφιο αριθμό να συνοδεύει την κάθε φωτογραφία. Η εργασία μας έχει τελειώσει . Στέλνουμε το φάκελο fotos και το αρχείο fotos_md5sum που δημιούργησε το md5sum στο φίλο μας. Εκείνος για να επιβεβαιώσει ότι οι φωτογραφίες μας έφτασαν χωρίς σφάλματα σε αυτόν φτάνει να μεταβεί στο φάκελλο fotos που μόλις παρέλαβε με το email που του στείλαμε Από το terminal του για να μεταβεί στο φάκελλο fotos
$ cd fotos
και να δώσει την εντολή
md5sum -c fotos_md5sum
η οποία θα του επιβεβαιώσει αν οι φωτογραφίες που μόλις του στείλαμε έφτασαν σωστά στην αυθεντική τους μορφή χωρίς απώλειες ή προσθήκες δεδομένων. Την ίδια τεχνική χρησιμοποιούμε και όταν κατεβάζουμε την αγαπημένη μας διανομή unix/linux (
iso) από το διαδίκτυο πριν να την "κάψουμε" σε ένα cd ή dvd. Φτάνει να πάρουμε το αρχείο με τα MD5 της διανομής και μόλις την κατεβάσουμε να ελέγξουμε με τον τρόπο που αναφέραμε ότι η iso είναι χωρίς σφάλματα και έτοιμη για να τη χρησιμοποιήσουμε.
[from
Spyros Typaldos]
Posted in Unix | Tags αυθεντικότητας, εργαλείο, md5sum | no comments