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
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: redis-server | |
| # Required-Start: $syslog | |
| # Required-Stop: $syslog | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: redis-server - Persistent key-value db |
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
| #!/bin/sh | |
| # Add MongoDB Package | |
| echo "Add MongoDB Package" | |
| echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
| echo "MongoDB Package completed" | |
| # Update System | |
| echo "System Update" |
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
| db.$cmd.sys.unlock.findOne(); |
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
| #!/bin/sh | |
| MONGODB_SHELL='mongo' | |
| DUMP_UTILITY='mongodump' | |
| #SET the bd name which one you want to backup | |
| DB_NAME='' | |
| #SET server path where you want to save the file | |
| CLOUD_PATH='' | |
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
| function freeze_db() { | |
| rc = db.runCommand({fsync: 1, lock: 1}); | |
| if (rc.ok == 1){ | |
| return 1; | |
| } else { | |
| return 0; | |
| } | |
| } | |
| freeze_db(); |
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
| UIViewController * myViewController; | |
| id delegate = [[UIApplication sharedApplication] delegate]; | |
| UIWindow * win = [delegate window]; | |
| myViewController = [[MyView alloc] init]; | |
| // CGRect rect = CGRectMake(x,y,w,h); | |
| // init the view position some how myViewController.viewFrame = rect; | |
| [win addSubview:myViewController.view]; |
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
| - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
| UITouch *touch = [[event allTouches] anyObject]; | |
| CGPoint loc = [touch locationInView:self]; | |
| self.pickedColor = [self colorOfPoint:loc]; | |
| [[NSNotificationCenter defaultCenter] postNotificationName:@"ColorPicked" object:self userInfo:nil]; | |
| } |
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
| package | |
| { | |
| import flash.display.DisplayObject; | |
| import flash.display.GradientType; | |
| import flash.display.Shape; | |
| import flash.display.Sprite; | |
| import flash.events.Event; | |
| import flash.events.MouseEvent; | |
| import flash.geom.Matrix; | |
| import flash.geom.Point; |
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 com.greensock.TimelineLite; | |
| import com.greensock.TweenLite; | |
| import com.greensock.easing.*; | |
| card.z = 300; | |
| card.getChildAt(0).visible = false; | |
| card.getChildAt(0).rotationY = 180; | |
| card.addEventListener(MouseEvent.MOUSE_DOWN,cardDown); | |
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://redis.googlecode.com/files/redis-2.6.13.tar.gz | |
| tar xzf redis-2.6.13.tar.gz | |
| cd redis-2.6.13 | |
| make | |
| mkdir -p /usr/local/bin | |
| cp -pf redis-server /usr/local/bin | |
| cp -pf redis-benchmark /usr/local/bin | |
| cp -pf redis-cli /usr/local/bin | |
| cp -pf redis-check-dump /usr/local/bin |