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
sudo hostname mydomain.tld |
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
sudo rm /var/log/mongodb/mongod.lock | |
sudo -u mongodb mongod -f /etc/mongodb.conf --repair | |
sudo service mongodb start |
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
sudo apt-get install pure-ftpd | |
sudo adduser blop | |
# add /bin/false to /etc/shells | |
# edit /etc/passwd to set /bin/false as shell | |
# edit /etc/pam.d/pure-ftpd to force the use of /etc/ftpallow | |
# add user blop to /etc/ftpallow | |
# Chroot everyone |
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
IO.popen('ant run') do |io| | |
while (line = io.gets) do | |
puts line | |
end | |
end |
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
du -hx --max-depth 1 /var |
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
sudo sh -c 'echo "ntpdate ntp.ubuntu.com" > /etc/cron.hourly/ntpsync' | |
sudo chmod 755 /etc/cron.hourly/ntpsync |
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)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { | |
if (editingStyle == UITableViewCellEditingStyleDelete) { | |
NSLog(@"Deleting Task!"); | |
Task *taskToRemove = [tasksArray objectAtIndex:indexPath.row]; | |
//remove from taskArray | |
[tasksArray removeObjectAtIndex:indexPath.row]; | |
//remove from core data and on server | |
[dm removeTask:taskToRemove]; | |
//remove from UI |
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
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { | |
if(indexPath.row == [tasksArray count]) | |
return UITableViewCellEditingStyleInsert; | |
else | |
return UITableViewCellEditingStyleDelete; | |
} |
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
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
// Return the number of rows in the section. | |
return [tasksArray count]+1; | |
} |
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
// Create a tabBarViewController | |
tabBarController = [[UITabBarController alloc] init]; | |
// Create the view and the navigator controller for Contact | |
contactNavController = [[UINavigationController alloc] init]; | |
ContactsViewController *contactsViewController = [[ContactsViewController alloc] initWithNibName:nil bundle:nil]; | |
[contactsViewController initWithDataManager:dm]; | |
[contactsViewController initWithStyle:UITableViewStylePlain]; | |
contactsViewController.navigationItem.title = @"Contacts"; | |
contactNavController.viewControllers = [NSArray arrayWithObjects:contactsViewController, nil]; |