add php gd (graphics directly) support in ubuntu
#sudo apt-get install php5-gd
then, restart web service
#sudo service lighttpd restart //or #sudo service apache2 restart
add php gd (graphics directly) support in ubuntu
#sudo apt-get install php5-gd
then, restart web service
#sudo service lighttpd restart //or #sudo service apache2 restart
clean kernel temp files
#make clean
next, install modules of new kernel:
#make modules_install
then, generate a image for new kernel.
#cd /lib/modules #mkinitramfs -o initrd.img-2.6.30.4 2.6.30.4 #mv initrd.img-2.6.30.4 /boot
edit menu.lst file for grub booter, add following:
title Ubuntu 8.04.3 LTS, kernel 2.6.30.4 root (hd0,2) kernel /boot/vmlinuz root=UUID=98f69044-be12-4dde-95df-358dca35c632 ro quiet splash initrd /boot/initrd.img-2.6.30.4 quiet
install new linux kernel 2.6.30.4 using “make install”, system should show following detail:
root@ibm-laptop:/usr/src/linux-2.6.30.4# make install
sh /usr/src/linux-2.6.30.4/arch/x86/boot/install.sh 2.6.30.4 arch/x86/boot/bzImage \
System.map “/boot”
In order to use the new kernel image you have just installed, you
will need to reboot the machine. First, however, you will need to
either make a bootable floppy diskette, re-run LILO, or have GRUB
installed.
Checking for ELILO…No
GRUB is installed. To automatically switch to new kernels, point your
default entry in menu.lst to /boot/vmlinuz-2.6.30.4
====================
GRUB menu configuration file menu.lst should be update.
configuration and update to linux kernel 2.6.30.4
using root account do following.
#make mrproper #check kernel .o and .config files
next configuration kernel. there are three kinds of configuration UI.
#make config #Text UI
#make menuconfig #Text graph UI
#make xconfig
before using menuconfig mode, ncurses should be installed.
#apt-get install libncurses*
and before using xconfig mode, following package should be installed.
#apt-get install libqt3-headers libqt3-mt-dev
after all configuration work done. using make command to compile kernel.
get recent linux kernel (2.6.30.4)
$sudo wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.4.tar.gz /usr/src $sudo tar xvf /usr/src/linux-2.6.30.4.tar.gz
if linux-2.6.30.4.tar.bz2 package, using command:
$sudo tar jxvf /usr/src/linux-2.6.30.4.tar.bz2
open root account in ubuntu:
$sudo passwd root
then, set new password for root.
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h myhost password ‘new-password’
mysql -p -u root
install samba in arch linux:
$pacman -S samba
$cp /etc/samba/smb.conf.default /etc/samba/smb.conf
$adduser -d /home/<user dir> -m <user name>
$passwd <user name>
$smbpasswd -a <user name>
add two lines in to /etc/samba/smb.conf
netbios name = archsmb
encrypt passwords = yes
[homes]
browseable = yes
writable = yes
then:
$/etc/rc.d/samba start
$smbclient -L localhost -U <user name>
for start each service in arch linux, set deamon in /etc/rc.conf. using sshd for example:
deamons(… sshd lighttpd … …)
open ssh service. change /etc/hosts.allow add one line
sshd: ALL
install lighttpd php fcgi and mysql.
pacman -Ss search
pacman -S lighttpd php fcgi mysql samba perl-cgi
configuation arch linux network by dhcp:
add following lines to /etc/rc.conf
eth0=”dhcp”
INTERFACES=(eth0)
ROUTES=(!gateway)
then try /etc/rc.d/network restart
using python get current timestamp
>>>import time
>>>time.time()
//currenting timestamp to int
>>>int(time.time())
//converting to string
>>>str(time.time())
using python get friend timeline in twitter. following tools should be used:
python-simplejson
first install python-simplejson, if in ubuntu, just using command as follows
$apt-get install python-simplejson
then, downloading python-twitter , unpackage it. then using command
$ python setup.py build $ python setup.py install
then, open python.
>>> import twitter
>>> api = twitter.Api(“username”, “passworld”)
>>> posts = api.GetFriendsTimeline(‘username’)
>>> print [post.text in post as posts ];
for the file, the script should be liked:
import twitter
class mytwitter():
def __init__(self):
self._config = None
def main():
api = twitter.Api('username', 'passworld')
posts = api.GetFriendsTimeline('username')
for post in posts:
print post.text.encode('utf-8')
if __name__ == "__main__":
main()
To mount the ISO image file.iso to the mount point /mnt/test use this command:
mount -o loop -t iso9660 file.iso /mnt/test
building a PXE boot server in the ubuntu.
1. install dhcp3 server in the ubuntu.
apt-get install dhcp3-server
2. edit /etc/default/dhcp3-server
INTERFACES=”eth0″
3. edit /etc/dhcp3/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.example";
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}
4. edit /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
name DHCPserver
address 192.168.1.1
netmask 255.255.255.0
5. restart networking and dhcp3
service networking restart
service dhcp3-server restart
work on the ruby on vista.
firstly, install ruby
next, install rails, by command “gem install rails”
then, create a new web app by rails by “rails project”.
if “project” has been create, it can be runned by command “ruby script/server webrick”.
lastly, open address “http://localhost:3000″ web browser.
Typical Java Commands. using command java javac and jar to do java development work.
using rdesktop can remote control windows computer by using unix.example:
$rdesktop -f <ip address>
-f is mean full screen.
improve your arch linux pacman speed.
pacman using wget for download task. but wget is not for multiple thread download. if using “aria2″, the download speed can sharply increase.
firstly, install aria2 by:
$pacman -Sy
$pacman -S aria2
then, edit /etc/pacman.conf, add a line:
XferCommand = /usr/bin/aria2c -s 2 -m 2 -d / -o %o %u
ok, try pacman again, you can see big change for download speed.
disable linux kde auto login:
open /etc/kde3/kdm/kdmrc
change “AutoLoginEnable” to false
a shell script for quick uploading one file via ftp:
#!/bin/bash
ftp -v -n http://ftp.server.com <
mput $1
bye
END
using command ‘badbloocks’ check bad block on the device.
$badblocks -c -v /dev/sda1
-c blocks at once
-v verbose mode
in the freebsd system, smart montools can be used:
$cd /usr/ports/sysutils/smartmontools
$make config install clean
$smartctl -a /dev/ad0 // quick checking and check all
$smartctl -t long /dev/ad0 // check and test
swc file is an archive for flex or actionscript components and other assets. using one or more swc files in the flex project can by following command:
mxmlc -library-path+=path\SwcFileName_1.swc,path\SwcFileName_2.swc FlexAppName.mxml
using SpringGraph for any flex project:
SpringGraph is a 2D data visualization API based on the flex 2. I have used flex 3 sdk to demo the example of spring graph.
first of all, a package should be downloaded for using SpringGraph at developer blog. Extracting the package, copy ./SpringGraph/bin/SpringGraph.swc to the directory named simple.
The package provides five examples for testing SpringGraph. going into simple SpringGraphDemo. using command to compile the mxml file, like:
mxmlc -library-path+=../SpringGraph.swc SpringGraphDemo.mxml
than using a flash player open SpringGraphDemo.swf. the interface should like this example.
export and import mysql database in command line
export
mysqldump -u admin_user -p database_name > file.sql
import
mysql -u admin_user -p database_name < file.sql
clean ubuntu package cache:
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
clean isolated package
sudo apt-get install deborphan -y