Software

You are currently browsing the articles from KomKid.Net matching the category Software.

Expanding the size of a virtual disk

เมื่อ OS ใน Virtual Box เต็ม จะทำอย่างไรกันดีเล่าพี่น้อง
ความจริงวิธีที่จะทำ มันไม่ตรงกับหัวข้อครับ เพราะมันไม่ใช่การขยาย แต่มันเป็นการสร้างใหม่
1.เลือก VDI Image เป้าหมายที่ต้องการขยาย

2.สร้าง VDI Image อันใหม่ให้มีขนาดที่ต้องการ
3.เพิ่ม Image อันใหม่เป็น Slave และ เพิ่ม linux Image เข้าไปใน CD สำหรับใช้ Boot ตามตัวอย่างใช้ Parted Magic

4.เปิด terminal พิมพ์ nano /proc/paritions เพื่อดูขนาด harddisk

5.ใช้คำสั่ง dd โดยสังเกตขนาดตามรูป จะโอนจาก 10G(hda) ไปเป็น 30G(hdb) ก็ใช้คำสั่ง

1
dd if=/dev/hda of=/dev/hdb

6.รอจนเสร็จแล้ว shutdown
7.สร้าง OS อันใหม่ แล้วเพิ่ม VDI Image อันใหม่ กับ image ของ Parted Magic boot อีกทีเพื่อ resize partition เพราะ image ใหม่มีขนาด 30 GB ก็จริง แต่ขนาด partition ยังเท่าเดิม

8.เสร็จแล้วก็ shutdown แล้วเอา image ของ Parted Magic ออกก็จะได้ OS ใหม่ใหญ่กว่าเดิมไว้ใช้งาน

Written by Komkid on July 22nd, 2010 with no comments.
Read more articles on Admin and IT Tips and Software and Ubuntu.

Create Screenshot from movie

Ubuntu : Totem Movie Player
1.เปิดไฟล์
2.เข้าเมนู Edit -> Create Screenshot Gallery…

3.เลือกความกว้าง สูงสุดได้ 500 pixel
4.เลือกจำนวนภาพหรือทำเครื่องหมายเพื่อให้โปรแกรมคำนวณให้ก็ได้

Windows : Media Player Classic
1.เปิดไฟล์
2.เข้าเมนู View -> Options…
3.เลือก Output เป็น VMR9 (windowed)

4.เข้าเมนู File -> Save Thumbnails…
5.ตั้งชื่อไฟล์ ชนิด จำนวนแถว ขนาด ด้านล่าง

ขอบคุณภาพประกอบจาก www.thailandtorrent.com

Written by Komkid on May 18th, 2010 with no comments.
Read more articles on IT Tips and Software and Ubuntu.

Ubuntu : Install OCS Inventory NG

OCS Inventory NG เป็น Asset Management Software แบบ Open Source สำหรับจัดการข้อมูล Hardware และ Software ในระบบเครือข่าย รองรับ Client ที่เป็น Windows, Linux, MacOS ฯลฯ

* Relevant inventory information.
* Powerful deployment system allowing to distribute software installation or scripts on computers without overloading the network.
* Web Administration Console.
* Multiple operating systems support, including Microsoft Windows, Linux, *BSD, Sun Solaris, IBM AIX, HP-UX, MacOS X.
* Lightweight bandwith usage: 5 KB for a full Windows inventory.
* High performance: about 1 000 000 of computers inventoried per day using a server bi-Xeon 3 GHz and 4 GB RAM.
* 3-Tier architecture using current standards, HTTP/HTTPS protocol and XML data formatting.
* Based on well known products such as Apache web server, MySQL database server, PHP and PERL scripting languages.
* Web service accessible through SOAP interface.
* Plugins support through API.
* …

http://www.ocsinventory-ng.org

ขั้นตอนการติดตั้งสำหรับ Server ที่เป็น Ubuntu
1.ติดตั้ง Package ที่จำเป็น

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#apache, php, mysql
apt-get install apache2
apt-get install php5 libapache2-mod-php5 php5-gd
apt-get install mysql-server
apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
 
apt-get install make
sudo aptitude install libc6-dev
 
#perl
sudo aptitude install perl libapache2-mod-perl2 libxml-simple-perl libcompress-zlib-perl libdbi-perl libapache-dbi-perl
sudo aptitude install libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl libnet-ip-perl libsoap-lite-perl
 
cpan SOAP::Lite #optional for web service

2.ติดตั้ง OCS Inventory NG Server

1
2
3
4
wget http://launchpad.net/ocsinventory-server/stable-1.3/server-release-1.3.1/+download/OCSNG_UNIX_SERVER-1.3.1.tar.gz
tar -xvzf OCSNG_UNIX_SERVER-1.3.1.tar.gz
cd OCSNG_UNIX_SERVER-1.3.1
./setup.sh

Do you wish to continue ([y]/n)? y
Which host is running database server [localhost] ? [enter]
On which port is running database server [3306] ? [enter]
Where is Apache daemon binary [/usr/sbin/apache2] ? [enter]
Where is Apache main configuration file [/etc/apache2/apache2.conf] ? [enter]
Which user account is running Apache web server [www-data] ? [enter]
Which user group is running Apache web server [www-data] ? [enter]
Where is Apache Include configuration directory [//etc/apache2/conf.d/] ? [enter]
Where is PERL Intrepreter binary [/usr/bin/perl] ? [enter]
Do you wish to setup Communication server on this computer ([y]/n)? y

Where to put Communication server log directory [/var/log/ocsinventory-server] ? [enter]
To ensure Apache loads mod_perl before OCS Inventory NG Communication Server, Setup can name Communication Server Apache configuration file ‘z-ocsinventory-server.conf’ instead of ‘ocsinventory-server.conf’. Do you allow Setup renaming Communication Server Apache configuration fileto ‘z-ocsinventory-server.conf‘ ([y]/n) ? y
Do you wish to setup Administration Server (Web Administration Console) on this computer ([y]/n)? y
Do you wish to continue ([y]/n)? y

Where to copy Administration Server static files for PHP Web Console [/usr/share/ocsinventory-reports] ? [enter]
Where to create writable/cache directories for deployement packages and IPDiscover [/var/lib/ocsinventory-reports] ? [enter]

1
2
/etc/init.d/apache2 restart
nano /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php #set username & password of mysql

3.เรียกดูได้ที่ http://localhost/ocsreports
4.คลิก send เพื่อสร้าง database จะได้ database ชื่อ ocsweb
6.เข้าใช้งานที่ http://localhost/ocsreports โดยใช้ username=admin password=admin
7.ติดตั้ง Agent สำหรับ Windows โดยใช้ตัว setup จาก http://launchpad.net/ocsinventory-windows-agent/trunk/win32-agent-release-4061/+download/OCSNG_WINDOWS_AGENT_4061.1.zip (สามารถทำ silent install ได้ด้วย)

การติดตั้ง Agent สำหรับ Windows
1. แบบ manual ใช้ตัว setup จาก http://launchpad.net/ocsinventory-windows-agent/trunk/win32-agent-release-4061/+download/OCSNG_WINDOWS_AGENT_4061.1.zip
2. แบบ deploy ผ่าน Active Directory โดยทำผ่าน Group Policy ใส่ไว้ใน Computer Configuration -> Windows Settings -> Scripts -> Startup
2.1 คลิก Show files แล้ว rename OcsLogon.exe เป็น IP เครื่อง OCS Server เอามาวางไว้ในนั้น เช่น 192.168.0.252
2.2 Add Script โดยกด Browse หาไฟล์ในข้อ 2.1
2.3 ใส่ Parameters ดังนี้

/S = Silent
/DEBUG = สร้างไฟล์ log
/NP = No Proxy
/INSTALL = Install Service Agent
/DEPLOY:4061 = ติดตั้ง Agent รุ่น 4.0.6.1
/SERVER:192.168.0.252 = ติดต่อไปที่ Server 192.168.0.252

3. เมื่อเครื่อง Client Boot ขึ้นมาก็จะติดต่อไปที่ Server เพื่อทำการ Upgrade หรือติดตั้งตัว Agent โดยดูผลลัพธ์ได้ที่ C:\OCS-NG

Written by Komkid on May 16th, 2010 with no comments.
Read more articles on Admin and Networking and Software and Ubuntu.

Ubuntu : Install ClamAV

1.ติดตั้ง ClamAV และ Update

1
2
3
4
5
apt-get install clamav
apt-get install clamav-daemon
/etc/init.d/clamav-daemon restart  
freshclam  #update virus definitions
clamscan -r /location_of_files_or_folders

2.Schedule Scan

1
2
crontab -e
00 00 * * * clamscan -r location_of_files_or_folders

3.Log and Quarantine

1
2
mkdir /var/log/clamav/infected
nano /etc/clamav/clamscan_schedule.sh

ป้อน

1
2
3
4
5
6
7
8
9
10
#!/bin/sh
### fix log file if needed
LOG_FILE="/var/log/clamav/scan.log"
if [ ! -f "$LOG_FILE" ]; then
touch "$LOG_FILE"
chmod 644 "$LOG_FILE"
chown clamav.clamav "$LOG_FILE"
fi
 
clamscan -r /public_data --quiet --log="$LOG_FILE" --verbose --move=/var/log/clamav/infected
1
chmod +x /etc/clamav/clamscan_schedule.sh

Written by Komkid on April 26th, 2010 with no comments.
Read more articles on Software and Ubuntu.

Ubuntu : Install FreeNX

FreeNX เป็นคนละตัวกับ NXServer ของ nomachine ครับ (ของ nomachine จำกัดแค่ 2 session เอง)
1.เพิ่ม repository

1
nano /etc/apt/sources.list

เพิ่ม

1
2
deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu VERSION main
deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu VERSION main

เพิ่ม key แล้ว update

1
2
 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2a8e3034d018a4ce
apt-get update

2.ติดตั้ง server

1
aptitude install freenx

3.ติดตั้ง client (ใช้ของ nomachine)

1
2
wget http://64.34.161.181/download/3.4.0/Linux/FE/nxserver_3.4.0-12_i386.deb
dpkg -i nxclient_3.4.0-5_i386.deb

4.กรณีต้องการเปลี่ยน SSH key

1
dpkg-reconfigure freenx-server

เลือก Create new custom keys
จะได้ key อยู่ที่ /var/lib/nxserver/home/custom_keys/client.id_dsa.key สำหรับเอาไป import เข้า nxclient
อาจ copy ไปโดยให้คำสั่ง
ที่ server

1
cp /var/lib/nxserver/home/custom_keys/client.id_dsa.key ~/

ที่ client

1
scp user@freenx-server:~/client.id_dsa.key ~/

Written by Komkid on April 26th, 2010 with no comments.
Read more articles on Admin and Networking and Software and Ubuntu.

« Older articles

No newer articles