Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Wednesday, February 04, 2015

Try Ionic framework hybrid app on Mac

Introduction


Ionic framework is a cross-platform HTML5 Javascript CSS framework for hybrid app.
It works with AngularJS and Cordova (PhoneGap).

Check the Ionic documents for details, you will find what it provides.
  • AngularJS: data binding, page routing...
  • AngularJS Extensions (the magic of UI components; View Controller pattern; Javascript Utilities )
  • Ionic Icons
  • CSS UI Components, which you can use Sass to customize.
  • HTML5 Input Type
  • CLI Command line tools - CLI FAQ
  • Demos and Examples - check the Kitchen Sink App with examples demonstrating most of Ionic's features.
  • App Template: iOS-like Tab View Controller template; Side menu template;
  • Community Forum where you can discuss the issues with Ionic.

http://situee.blogspot.com/2015/02/try-ionic-framework-hybrid-app-on-mac.html

Friday, October 10, 2014

Config Apache SVN server for Mavericks

I have a post about Config Apache SVN server for Mountain Lion

This time, after upgrade to 10.9 Mavericks, Apache fails again.

The mod_dav_svn.so and mod_authz_svn.so are missing.

$ apachectl -S
httpd: Syntax error on line 501 of /private/etc/apache2/httpd.conf: Syntax error on line 2 of /private/etc/apache2/other/svn.conf: Cannot load /usr/libexec/apache2/mod_dav_svn.so into server: dlopen(/usr/libexec/apache2/mod_dav_svn.so, 10): image not found



Here's the fix

Download And Build Subversion

 http://archive.apache.org/dist/subversion/subversion-1.6.23.tar.bz2


add symlink
ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
cd subversion-1.6.23
./configure
make
sudo cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/libexec/apache2/.
sudo cp subversion/mod_authz_svn/.libs/mod_authz_svn.so /usr/libexec/apache2/.

Wednesday, January 22, 2014

Setup DNSmasq MAC DNS server


$ brew install dnsmasq

$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
$ sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

Go to System Network preference,
Set the only one DNS as 127.0.0.1

/usr/local/etc/dnsmasq.conf

#upstream dns servers
resolv-file=/etc/resolv.dnsmasq.conf

#for the host domain to the ip, like the "hosts" file
address=/dev/127.0.0.1
address=/double-click.net/127.0.0.1

# set listen address as your IP
listen-address=127.0.0.1, 192.168.11.12

/etc/resolv.dnsmasq.conf  

Put upstream server in /etc/resolv.dnsmasq.conf , such as 8.8.8.8
nameserver upstream_dns_server
nameserver 8.8.8.8


Kill the process, it will restart and reload new config.

$ sudo kill $(ps aux | grep '[d]nsmasq' | awk '{print $2}')


Reference:

Install DNSmasq locally on Mac OS X via Homebrew
http://blog.philippklaus.de/2012/02/install-dnsmasq-locally-on-mac-os-x-via-homebrew/

Setup a wildcard TLD using Dnsmasq on OS X
http://bhamrick.com/2013/04/18/setup-a-wildcard-tld-using-dnsmasq-on-os-x/

https://gist.github.com/g3d/2709563

http://unixhelp.ed.ac.uk/CGI/man-cgi?ps

Appendix:

 ps aux  : to see every process on the system using bSD syntax;

$ ps aux 
USER       PID  %CPU %MEM  VSZ RSS     TTY   STAT START   TIME COMMAND
timothy  29217  0.0  0.0 11916 4560 pts/21   S+   08:15   0:00 pine 
root     29505  0.0  0.0 38196 2728 ?        Ss   Mar07   0:00 sshd: can [priv]  
can      29529  0.0  0.0 38332 1904 ?        S    Mar07   0:00 sshd: can@notty 
USER = user owning the process
PID = process ID of the process
%CPU = It is the CPU time used divided by the time the process has been running.
%MEM = ratio of the process’s resident set size to the physical memory on the machine
VSZ = virtual memory usage of entire process
RSS = resident set size, the non-swapped physical memory that a task has used
TTY = controlling tty (terminal)
STAT = multi-character process state
START = starting time or date of the process
TIME = cumulative CPU time
COMMAND = command with all its arguments
ps -aux VS ps aux

Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX standards require that "ps -aux" print all processes owned by a user named "x", as well as printing all processes that would be selected by the -a option. If the user named "x" does not exist, this ps may interpret the command as "ps aux" instead and print a warning. This behavior is intended to aid in transitioning old scripts and habits. It is fragile, subject to change, and thus should not be relied upon.

Sunday, September 22, 2013

Use Launch Daemon to Start Tomcat Automatically on Mac

Start tomcat automatically on Mac.

1. create launchd_wrapper.sh at tomcat/bin
2. create /Library/LaunchDaemons/org.apache.tomcat.plist
3. restart your mac

Note: Replace "/Users/username/tomcat" with your tomcat path in launchd_wrapper.sh and plist file.

try to launch tomcat with the plist
"sudo launchctl load -w /Library/LaunchDaemons/org.apache.tomcat.plist"

If you got error: "launchctl: Dubious ownership on file (skipping)" [5]
Please try change owner and permission of the plist file
a. change the owner to root with "sudo chown root <filename>",
b. change the permissions with "sudo chmod 644 <filename>"
   (4 for read access, 2 for write access, 1 for execute access, added up. The first number is for the owner, the second for the group, the third for everyone.) 


-----  http://situee.blogspot.com ---------