Skip to content

Instantly share code, notes, and snippets.

View InstaRobot's full-sized avatar
:electron:
I don't know ...

Vitaliy Podolskiy InstaRobot

:electron:
I don't know ...
View GitHub Profile
@InstaRobot
InstaRobot / FreeBSD_node_monit.md
Created November 11, 2016 02:21 — forked from fdelbos/FreeBSD_node_monit.md
FreeBSD 10 Nodejs setup with nginx, mongo and monit

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

// Создать файл проекта и синхронизировать с Юнити!
{
"folders":
[
{
"path": ".",
"file_exclude_patterns": ["*.meta"],
},
],
open -n /Applications/Unity/Unity.app
rm -rf $HOME/Library/Application Support/Developer/Shared/Xcode
rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
nscurl --ats-diagnostics <DOMEN>
// Первый вариант
wget -r -l0 -k http://apple.com/
// Второй вариант - более подробный
wget -r -k -l 100 -p -E -nc http://clean-vk.instarobot.net
А теперь немного подробнее о параметрах wget.
- (void)enumerateObjectsUsingBlock:(void (^)
(id obj, NSUInteger idx, BOOL *stop))block
// А теперь пример реализации:
[array enumerateObjectsUsingBlock:
^(NSString *string, NSUInteger index, BOOL *stop) {
NSLog(@"I found %@", string);
}];
-(NSArray *)getGroupsForUser:(NSString *)userID {
NSArray *array = [[NSArray alloc] init];
VKRequest *request = [VKApi requestWithMethod:@"groups.get"
andParameters:@{@"user_id": userID, @"filter": @"admin", @"extended": @"1"}
andHttpMethod:@"GET"];
[request executeWithResultBlock:^(VKResponse *response) {
NSLog(@"%@", response.json);
//TODO: completeBlock
@try
{
// try
}
@catch (NSException *exception)
{
// exception
}
@finally
{