linux

linux

Selasa, 27 Desember 2011

catatan aja

screen
untuk keluar dr screen ( detach ): ctrl + a  d
untuk keluar dan berhenti dr screen : exit
root@napinfo-188-205:~# screen -r
There are several suitable screens on:
        2170.pts-2.napinfo-188-205      (Detached)
        2178.pts-2.napinfo-188-205      (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
root@napinfo-188-205:~# screen -r 2170
[detached]
root@napinfo-188-205:~# screen -r 2178
[detached]

-----> gunakan ctrl + a + d  --> untuk kembali ke consol
root@napinfo-188-205:~# screen -r
There are several suitable screens on:
        2170.pts-2.napinfo-188-205      (Detached)
        2178.pts-2.napinfo-188-205      (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
========================================
untuk installasi :
download open-iscsi
cd open-iscsi
vi open-scsi/iscsi_sysfs.c
tambah return 0; di :
---------------------------------------
int iscsi_sysfs_check_class_version(void)
{
        char *version;
        int i;

-->>    return 0;
        version = iscsi_sysfs_get_iscsi_kernel_version();
        if (!version)
                goto fail;

        log_warning("transport class version %s. iscsid version %s",
                    version, ISCSI_VERSION_STR);
--------------------------------------------
iscsiadm -m iface
iscsiadm -m node
iscsid
iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260
cat /proc/scsi/scsi
root@<-III->:~# cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: ST3500418AS      Rev: CC38
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: TSSTcorp Model: CDDVDW SH-S223B  Rev: SB02
  Type:   CD-ROM                           ANSI  SCSI revision: 05
root@<-III->:~#
masuk ke manajemen storage add host di tab configure
modprobe iscsi_tcp
iscsiadm -m node -T iqn.1992-01.com.lsi:1535.600a0b8000744f8e000000004c0eee50 -l
iscsiadm -m node
 cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: ST3500418AS      Rev: CC38
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: TSSTcorp Model: CDDVDW SH-S223B  Rev: SB02
  Type:   CD-ROM                           ANSI  SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 01
  Vendor: IBM      Model: Universal Xport  Rev: 0250
  Type:   Direct-Access                    ANSI  SCSI revision: 05
root@<-III->:~#
============================
startup GUI di slackware
slackware defaultnya running level3 yang boot masyk command propt mode
untukmengubah ke boot mode GUI lakukan langkah di bawah ini:
edit file di : /etc/inittab
temukan baaris berikut :
# Default run level. (Do not set to 0 or 6)
id:3:initdefault:

ubah angka 3 diatas menjadi angka 4 untuk mode GUI
=============================
install Grub buat slackware :
http://slackbuilds.org/repository/13.1/system/grub2/
download :ftp://alpha.gnu.org/gnu/grub/grub-1.98.tar.gz
          http://slackbuilds.org/slackbuilds/13.1/system/grub2.tar.gz

tar -xvf grub2.tar.gz
mv grub-1.98.tar.gz grub2/
cd grub2
./grub2.SlackBuild
cd /tmp
installpkg grub2-1.98-x86_64-2_SBo.tgz
cat /proc/mdstat
grub-install /dev/md0

berikut ini  pilihan bisa 2 cara :
1.grub-mkconfig -o /boot/grub/grub.cfg
  hasilnya masih kosong...
2.copy grub.cfg
  cp /usr/doc/grub2-1.98/grub.cfg /boot/grub2/
 
saya pilih yang no 2.
edit file grub.cfg jadi :
---------------------------------------------------------------
#
# Sample GRUB configuration file
#

# Boot automatically after 30 secs.
set timeout=10

# By default, boot the first entry.
set default=0

# Fallback to the second entry.
set fallback=1


# For booting GNU/Linux
menuentry "linuxslac_serever" {
        set root='(md0)'
        linux /boot/vmlinuz root=/dev/md0
        initrd
}

# Change the colors.
menuentry "Change the colors" {
        set menu_color_normal=light-green/brown
        set menu_color_highlight=red/blue
}
==============================
lupa password :
boot dari media apa aja ( cd linux/flashdisk atau yg lain )
yg penting bisa akses HDD asli  yang buat boot :
masuk command prompt :
create direktori :
mkdir /mnt/satu
mount HDD asli :
mount /dev/sda2 /mnt/satu
kemudian masuk ke folder /etc/passwd ( di hdd asli nya :
cd /mnt/satu/etc/
vi passwd
cari bagian :
root:x:0:0::/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/false
daemon:x:2:2:daemon:/sbin:/bin/false
adm:x:3:4:adm:/var/log:/bin/false
lp:x:4:7:lp:/var/spool/lpd:/bin/false
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
...
pada bagian :
root:x:0:0::/root:/bin/bash
hilangkan huruf x nya menjadi :
root::0:0::/root:/bin/bash
kemudian save :  esc -->  wq enter
kemudian reboot , dan boot dari flash Haddisk asli :
insyalloh password jadi kosong...
login pake root untuuk password jangan ketik apa1 tapi langsung enter.
setelah bisa masuk baru buat passwoed baru lagi...
===============================
speed harddisk
 hdparm -tT /dev/md1

root@HO-168-33:/opt# sudo hdparm -tT /dev/md1

/dev/md1:
 Timing cached reads:   1416 MB in  2.00 seconds = 708.31 MB/sec
 Timing buffered disk reads:  108 MB in  3.09 seconds =  34.94 MB/sec
root@HO-168-33:/opt#
==============================
=================================create swap file ====================================
8G memory swap
root@darkstar:/etc/rc.d# dd if=/dev/zero of=/swapfile bs=1024 count=8000000
8000000+0 records in
8000000+0 records out
8192000000 bytes (8.2 GB) copied, 74.8582 s, 109 MB/s

# dd if=/dev/zero of=/mnt/swap/swapfile bs=1k count=20480
# mkswap /mnt/swap/swapfile
# swapon /mnt/swap/swapfile
To make it enable at boot, you need to add the swap file in the /etc/fstab file like below:
/swap1         swap             swap        defaults         0   0


1. Adding swap file on Linux
Login as root or change to super user then type the following command to create 1 GB swap file.
dd if=/dev/zero of=/swap1 bs=1M count=1024

bash-3.1# dd if=/dev/zero of=/swap1 bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 28.3646 s, 37.9 MB/s
Run ?mkswap? to set up a Linux swap area on a device or in a file, in this case in the /swap1 file.
mkswap /swap1
For example:
bash-3.1# mkswap /swap1
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=e501fc72-f731-4624-ab45-ee898f6cf1c5
After setting up the swap area, now we need to enable / activate the swap file by using ?swapon? command.
swapon /swap1
You are done. But the swap file will be disable if you reboot the system.
To make it enable at boot, you need to add the swap file in the /etc/fstab file like below:
/swap1         swap             swap        defaults         0   0
----------
dd if=/dev/zero of=/swap1 bs=1M count=1024
mkswap /swap1
swapon /swap1
============================
wget -r -P /home/hihi -l 0 -c -N -nH --cust-dir=3 ftp://root:dkdji@192.168.5.1//home/semangka/*

wget -r -P /home/hihi -l 0 -c -nH --cus-dir=3 --user=root ftp://192.168.5.1//home/semangka/*
==========================================================================================================
di ftp server
/etc/rc.d/rc.inetd start
config di /etc/inetd.conf
kemudian edit di /etc/vsftp.conf
      #anonymous_enable=YES
      anonymous_enable=NO
      # Uncomment this to enable any form of FTP write command.
      write_enable=YES
    
di wget ( client )
di /etc/wgetrc copy ke /root
cp /etc/wgetrc /root/.wgetrc
tambahkan di /root/.wgetrc

ftp_password = jakarta
background = on
timestamping = on
continue = on
#preserve-permissions = on

contoh command di client
wget -r -P /mnt/md0/stalfa/IPOT  -l 0 -c -N -nH --cut-dirs=2 --user=root ftp://192.168.188.204://opt/*
===================================

Tidak ada komentar:

Posting Komentar