2011年5月19日 星期四

GCC Using command

gcc is a GNU project compiler, and you can see it on many Unix like system.

I'll note some using way.

#gcc -O foo.c -o bar.out
#./bar.out

Compile a C program file to a execution file.

-O -> Optimization parameter

-O3 -O2 -O1 -O0    -> 0 do not optimize, 3 is best optimization.


#gcc -Wall -g foo.c -o bar.out

-Wall  -> displayed the warning message  
-g  -> Using gdb debugging and show error message

#gcc -I/usr/include -L/usr/lib -lm test.c -o test 

-Idir_name -> find the header file in directory
-Ldir_name -> find the linrary file in directory
-llibfile_name -> join a library file "libm.so" overpass lib & .so


2011年5月2日 星期一

Mac homebrew git & Aptana Studio 3.0 ruble installation

# ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"


install Xcode

# brew install git


# cd /Users/losehole/Documents/Aptana Rubles
# git clone git://github.com/aptana/YOURPACK.ruble.git


YUI javascript library support: Drop the SDOCML file into your Web Project.

2011年4月28日 星期四

Mac mini server be a wireless AP

1.
Open serveradmin 

select overview => Gateway Setup Assistant


press ethernet => continue => and check the airport to combine the to network interface via NAT.

if you do not need the proxy server then press continue to skip the step.


2.
Open network preferences


Create Network


And the icon will appear like this




OSX snowleopard server mailserver Clamav issue

when I used the serveradmin to watch the System log.

I saw the error message log :

Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Warning: **************************************************
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Warning: ***  The virus database is older than 7 days!  ***
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Warning: ***   Please update it as soon as possible.    ***
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Warning: **************************************************
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Error: cli_loadinfo: Digital signature not found
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Error: Can't load daily.info: Malformed database
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Error: cli_tgzload: Can't load daily.info
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: LibClamAV Error: Can't load /var/clamav/daily.cvd: Malformed database
Apr 28 00:30:07 macminiserver org.clamav.clamd[11273]: ERROR: Malformed database
Apr 28 00:30:07 macminiserver com.apple.launchd[1] (org.clamav.clamd[11273]): Exited with exit code: 1
Apr 28 00:30:07 macminiserver com.apple.launchd[1] (org.clamav.clamd): Throttling respawn: Will start in 10 seconds

then I restart my clamav freshclam and update clamav

#sudo launchctl unload -w /System/Library/LaunchDaemons/org.clamav.freshclam.plist
#sudo launchctl load -w /System/Library/LaunchDaemons/org.clamav.freshclam.plist

after this command, we can check the log in the serveradmin and it will start to update the virus database. And the error log does not appear again.


2011年4月7日 星期四

MAC OSX cpuinfo flags command

SHOW you CPU info like Linux command #cat /proc/cpuinfo | grep flags

#sysctl -a machdep.cpu | grep VMX

machdep.cpu.features:  FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM SSE3 MON DSCPL VMX SMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1
 

 

2011年3月30日 星期三

test

#!/usr/local/bin/python
for i in range(1,10):
  for j in range(1,10):
    print "%d*%d=%s" % (i,j,i*j),
  print ""


for i in range(1,10):
for j in range(1,10):
print "%d*%d=%s" % (i,j,i*j),
print ""

2011年3月28日 星期一

Synergy KVM software control on MAC OSX & UNIX by MacBook Air to Mac Mini Server

download & convert file => Synergy Download

you will find synergy-x.x.x-MacOSX-Universal folder

Server (MacBook Air keyboard & touchpad)

open and cp doc/synergy.conf.sample synergy.conf

vi the conf file like this


section: screens
        foo.local:
        bar.local:
end


section: links
        foo.local:
                right = bar.local


        bar.local:
                left  = foo.local
end

execute the synergy server by configure and listen client connection

#sudo ./synergys -f --config synergy.conf




Client (Mac Mini Server + screen)


#./synergyc -f "HostName or IP"




The result is that can use Air's keyboard and touchpad to remote control the 


Mini Server screen and key-in.


And I have more efficiencies to do my job by the one keyboard and touchpad with two Macs.   







 
創用 CC 授權條款