my @key = ("/root/.ssh/id_rsa");
my $ssh = Net::SSH::Perl->new($host,
identity_files=>\@key,
# debug => 1
);
$ssh->login('root');
Sunday, December 16, 2012
Thursday, June 14, 2012
samba in ubuntu
介紹如何在 ubuntu 上架 samba
1) 先安裝 samba
> sudo apt-get install samba
2) 改 /etc/samba/smb.conf, 加入想要分享的資料夾
[sda1]
path=/tmp/sda1
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sda5]
path=/tmp/sda5
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sda6]
path=/tmp/sda6
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sdb1]
path=/tmp/sdb1
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sdb2]
path=/tmp/sdb2
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
1) 先安裝 samba
> sudo apt-get install samba
2) 改 /etc/samba/smb.conf, 加入想要分享的資料夾
[sda1]
path=/tmp/sda1
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sda5]
path=/tmp/sda5
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sda6]
path=/tmp/sda6
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sdb1]
path=/tmp/sdb1
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
[sdb2]
path=/tmp/sdb2
browseable = yes
read only = no
;writable = yes
;guest ok = yes
create mask = 0755
directory mask = 0755
3) 加入使用者帳號, 前提該帳號必須已經存在
smbpasswd -a some_user_account
mount in ubuntu
在 ubuntu 上, mount fat32 與 ntfs 的磁碟
1) 首先, 先看目前已經找到的磁碟區, 透過
>fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc05fc05f
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 9728 57657285 f W95 Ext'd (LBA)
/dev/sda5 2551 6374 30716248+ b W95 FAT32
/dev/sda6 6375 9728 26940973+ b W95 FAT32
Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2527a2c7
Device Boot Start End Blocks Id System
/dev/sdb1 1 3916 31455238+ 7 HPFS/NTFS
/dev/sdb2 3917 9729 46692922+ 7 HPFS/NTFS
2) mount 磁碟區
mkdir /tmp/sda1 /tmp/sda5 /tmp/sda6 /tmp/sdb1 /tmp/sdb2
mount -t ntfs-3g /dev/sda1 /tmp/sda1
mount -t vfat -o iocharset=utf8 /dev/sda5 /tmp/sda5
mount -t vfat -o iocharset=utf8 /dev/sda6 /tmp/sda6
mount -t ntfs-3g /dev/sdb1 /tmp/sdb1
mount -t ntfs-3g /dev/sdb2 /tmp/sdb2
其中,
mount as ntfs, 在 ubuntu 或 samba, 閱讀中文沒有問題
mount as vfat, 必須指定 iocharset=utf8, 在 ubuntu 或 samba, 才能閱讀中文
1) 首先, 先看目前已經找到的磁碟區, 透過
>fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc05fc05f
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 9728 57657285 f W95 Ext'd (LBA)
/dev/sda5 2551 6374 30716248+ b W95 FAT32
/dev/sda6 6375 9728 26940973+ b W95 FAT32
Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2527a2c7
Device Boot Start End Blocks Id System
/dev/sdb1 1 3916 31455238+ 7 HPFS/NTFS
/dev/sdb2 3917 9729 46692922+ 7 HPFS/NTFS
2) mount 磁碟區
mkdir /tmp/sda1 /tmp/sda5 /tmp/sda6 /tmp/sdb1 /tmp/sdb2
mount -t ntfs-3g /dev/sda1 /tmp/sda1
mount -t vfat -o iocharset=utf8 /dev/sda5 /tmp/sda5
mount -t vfat -o iocharset=utf8 /dev/sda6 /tmp/sda6
mount -t ntfs-3g /dev/sdb1 /tmp/sdb1
mount -t ntfs-3g /dev/sdb2 /tmp/sdb2
其中,
mount as ntfs, 在 ubuntu 或 samba, 閱讀中文沒有問題
mount as vfat, 必須指定 iocharset=utf8, 在 ubuntu 或 samba, 才能閱讀中文
Tuesday, February 28, 2012
Monday, February 27, 2012
Wireless Packet Howto
介紹Windows環境下, 如何架設環境
1) Wireless Adapter, 如 Edimax EW-7711UAn
2) Omnipeek driver, 以 Ralink Wireless Adapter 為例, 可以到 http://www.ralinktech.com/en/04_support/support.php?sn=500 (提供 1.4.0.16)
或 http://www.wildpackets.com/support/omni/omnipeek_basic/wireless (提供 1.4.0.18 for Windows 32/64 )
3) 安裝 driver
4) 執行 Omnipeek, 就可以開始抓取空氣中Wireless Packet
1) Wireless Adapter, 如 Edimax EW-7711UAn
2) Omnipeek driver, 以 Ralink Wireless Adapter 為例, 可以到 http://www.ralinktech.com/en/04_support/support.php?sn=500 (提供 1.4.0.16)
或 http://www.wildpackets.com/support/omni/omnipeek_basic/wireless (提供 1.4.0.18 for Windows 32/64 )
3) 安裝 driver
4) 執行 Omnipeek, 就可以開始抓取空氣中Wireless Packet
DD-WRT
手上有台機器 RT3050 / 4M Flash / 32M RAM, 改成 DD-WRT
4) 接下來, 接 RS-232 Console, 進 Uboot bootloader, 進行 tftp firmware upgrade
一開始找到D-Link DIR-300這個型號, 不過燒錄了相對應的Firmware, 結果無法開機。接著找到 Asus RT-N10+, 有2個firmware, factory-to-ddwrt.trx 與 asus-rt-n10plus-ddwrt-webflash.bin
在 Uboot 下, 用 tftp 燒錄 factory-to-ddwrt.trx, 完成後, 可以開機
之後進 Webui, 可以用 asus-rt-n10plus-ddwrt-webflash.bin 做 firmware upgrade
Subscribe to:
Posts (Atom)