This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // generate 36 length UUID | |
| // from: http://stackoverflow.com/questions/8684551/generate-a-uuid-string-with-arc-enabled | |
| + (NSString *)uuidString { | |
| // Returns a UUID | |
| CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); | |
| NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid); | |
| CFRelease(uuid); | |
| return uuidStr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "net/ftp" | |
| host = "ftp://192.168.1.42/" | |
| begin | |
| 21ftp = Net::FTP.new | |
| ftp.connect('192.168.1.42', 21) | |
| ftp.login('***', '***') | |
| status = ftp.status | |
| #p status | |
| files = ftp.list('*') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget http://www.fayea.com/apache-mirror//commons/net/binaries/commons-net-3.1-bin.zip | |
| unzip commons-net-3.1-bin.zip | |
| sudo cp commons-net-3.1/commons-net-3.1.jar /usr/share/ant/lib/ | |
| rm -rf commons-net-3.1 | |
| rm -rf commons-net-3.1-bin.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # initialize remote repositories for gitosis | |
| su git | |
| cd ~/repositories | |
| mkdir SpringJMS.git | |
| cd SpringJMS.git | |
| git --bare init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # generate ctags for rails project | |
| ctags -R --exclude=.git --exclude=log * --exclude=coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # the scss: http://sass-lang.com/ | |
| # scss plugins: https://github.com/kuroir/SCSS.tmbundle | |
| # dependences: | |
| # mac os x & textmate 2 | |
| # git | |
| mkdir -p ~/Library/Application\ Support/Avian/Bundles | |
| cd ~/Library/Application\ Support/Avian/Bundles | |
| git clone git://github.com/kuroir/SCSS.tmbundle.git "SCSS.tmbundle" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifdef DEBUG | |
| # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
| #else | |
| # define DLog(...) | |
| #endif | |
| // ALog always displays output regardless of the DEBUG setting | |
| #define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mvn archetype:create -DgroupId=lv.site.wb -DartifactId=wb -DarchetypeArtifactId=maven-archetype-webapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CATALINA_HOME=/home/lvjian/libs/tomcat6 | |
| #PATH=$CATALINA_HOME/bin:$PATH | |
| # some alias about tomcat | |
| alias tm='cd $CATALINA_HOME'; | |
| alias tmout='tail -f $CATALINA_HOME/logs/catalina.out'; | |
| alias tmstart='$CATALINA_HOME/bin/startup.sh'; | |
| alias tmstop='$CATALINA_HOME/bin/shutdown.sh'; | |
| alias tmconf='vim $CATALINA_HOME/conf/server.xml'; | |
| alias tmclear='rm -rf $CATALINA_HOME/work/*'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.text.ParseException; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Calendar; | |
| import java.util.Date; | |
| import java.util.Locale; | |
| import java.util.Map; | |
| import lombok.extern.log4j.Log4j; |