How to deploy & configure thinking sphnix on production server - capistrano

i have tried install & configure thinking sphinx on local host & its working fine. When i tried to install on production server i am confuse with how to configure thinking sphinx on server.
here is the configure file development.sphinx.conf
indexer
{
}
searchd
{
listen = 127.0.0.1:9306:mysql41
log = /home/log/development.searchd.log
query_log = /home/log/development.searchd.query.log
pid_file = /home/log/development.sphinx.pid
workers = threads
binlog_path = /tmp/binlog/development
}
index product_core
{
type = rt
path = /db/sphinx/development/product_core
docinfo = extern
rt_field = sphinx_internal_class_name
rt_field = name
rt_attr_uint = sphinx_deleted
rt_attr_uint = company_id
rt_attr_bigint = sphinx_internal_id
rt_attr_string = sphinx_internal_class
rt_attr_string = name_sort
}
index product
{
type = distributed
local = product_core
}
Anyone please guide me configure thinking sphinx on production server

Related

How can I use Telescope.nvim to complete a path in insert mode?

Fzf.vim implements a fuzzy finder in insert mode, extending the native ins-completion functionality.
For example: in insert mode, we can map <c-x><c-f> to enable Fzf.vim to fuzzy find and insert file names with relative paths (fzf-complete-path). The same functionalities are implemented for words (fzf-complete-word) and lines (fzf-complete-line) completions.
Here are the Fzf.vim mapping example of these functions:
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-l> <plug>(fzf-complete-line)
How can I set the same behavior with Telescope.nvim?
You can define a custom action and map it to a key to execute it in Telescope.
I've written a set of actions for this task (to insert file paths in the current buffer): telescope-insert-path.nvim
You just need to make your custom mappings in the require'telescope'.setup().
local path_actions = require('telescope_insert_path')
require('telescope').setup {
defaults = {
mappings = {
n = {
["pi"] = path_actions.insert_relpath_i_insert,
["pI"] = path_actions.insert_relpath_I_insert,
["pa"] = path_actions.insert_relpath_a_insert,
["pA"] = path_actions.insert_relpath_A_insert,
["po"] = path_actions.insert_relpath_o_insert,
["pO"] = path_actions.insert_relpath_O_insert,
["Pi"] = path_actions.insert_abspath_i_insert,
["PI"] = path_actions.insert_abspath_I_insert,
["Pa"] = path_actions.insert_abspath_a_insert,
["PA"] = path_actions.insert_abspath_A_insert,
["Po"] = path_actions.insert_abspath_o_insert,
["PO"] = path_actions.insert_abspath_O_insert,
["<leader>pi"] = path_actions.insert_relpath_i_visual,
["<leader>pI"] = path_actions.insert_relpath_I_visual,
["<leader>pa"] = path_actions.insert_relpath_a_visual,
["<leader>pA"] = path_actions.insert_relpath_A_visual,
["<leader>po"] = path_actions.insert_relpath_o_visual,
["<leader>pO"] = path_actions.insert_relpath_O_visual,
["<leader>Pi"] = path_actions.insert_abspath_i_visual,
["<leader>PI"] = path_actions.insert_abspath_I_visual,
["<leader>Pa"] = path_actions.insert_abspath_a_visual,
["<leader>PA"] = path_actions.insert_abspath_A_visual,
["<leader>Po"] = path_actions.insert_abspath_o_visual,
["<leader>PO"] = path_actions.insert_abspath_O_visual,
-- Additionally, there's normal mode mappings for the same actions:
-- ["<leader><leader>pi"] = path_actions.insert_relpath_i_normal,
-- ...
}
}
}
}

Swift unable to access other application windows

I'm trying to access the windows of running applications through my application. Currently, I am grabbing the data of all running applications, and the kCGWindowNumber mapped to the applications, but I am having trouble getting the window mapped to that kCGwindowNumber.
How can I reference my windows of other running applications through mine? I have the kCGWindowNumber of those applications, but cannot figure out how to get access to the windows.
This is how I grab my data
let options = CGWindowListOption(arrayLiteral: CGWindowListOption.excludeDesktopElements, CGWindowListOption.optionOnScreenOnly)
let windowListInfo = CGWindowListCopyWindowInfo(options, CGWindowID(0))
Then, I store it into an object, which represents my running application. E.g.
{
kCGWindowAlpha = 1;
kCGWindowBounds = {
Height = 22;
Width = 3840;
X = 5520;
Y = 0;
};
kCGWindowLayer = 24;
kCGWindowMemoryUsage = 341416;
kCGWindowNumber = 190;
kCGWindowOwnerName = "Google Chrome";
kCGWindowOwnerPID = 272;
kCGWindowSharingState = 1;
kCGWindowStoreType = 2;
}
Now that I have the kCGWindowNumber I was trying to access the other applications with this
NSApplication.shared.window(withWindowNumber: kCGWindowNumber_FOR_WINDOW_I_WANT)
but, after reading the documentation I realized that NSApplication.shared returns Returns the application instance, and these windows are not not apart of my application.

PSI update resource custom field with lookup table (Project Server)

Can someone show me a code to update a enterprise resource custom field with lookup table ? Already ran the internet looking for some sample code but did not succeed.
You can create and update a custom field with a lookup table using the below code . But we can not update or delete builtin custom fields
var projContext = new ProjectContext(projectServerUrl);
CustomFieldCollection CustomField = projContext.CustomFields;
EntityTypes Entitytype = projContext.EntityTypes;
LookupTableCollection lookupTables = projContext.LookupTables;
projContext.Load(CustomField);
projContext.Load(Entitytype);
projContext.Load(lookupTables);
projContext.ExecuteQuery();
CustomFieldCreationInformation NewfieldInfo = new CustomFieldCreationInformation();
NewfieldInfo.Id = new Guid();
NewfieldInfo.Name = "The Name";
NewfieldInfo.Description = "The Description";
NewfieldInfo.IsWorkflowControlled = true;
NewfieldInfo.IsRequired = true;
NewfieldInfo.IsEditableInVisibility = false;
NewfieldInfo.IsMultilineText = false;
LookupTable lookuptable = lookupTables.ToList().Find(x => x.Name == "LookupTableName");
projContext.Load(lookuptable);
projContext.ExecuteQuery();
NewfieldInfo.LookupTable = lookuptable;
NewfieldInfo.EntityType = Entitytype.ProjectEntity;
NewfieldInfo.FieldType = CustomFieldType.TEXT;
projContext.CustomFields.Add(NewfieldInfo);
projContext.CustomFields.Update();
projContext.ExecuteQuery();

How to set up Slave Database configuration in vBulletin?

How to set up Slave Database configuration in vBulletin ? I set up like this:
$config['Database']['dbtype'] = 'mysql';
$config['Database']['dbname'] = 'xyz';
$config['Database']['tableprefix'] = 'vbulletin1_';
$config['Database']['technicalemail'] = 'xyz#abc.com';
$config['Database']['force_sql_mode'] = false;
$config['MasterServer']['servername'] = 'xyz';
$config['MasterServer']['port'] = 3306;
$config['MasterServer']['username'] = 'x';
$config['MasterServer']['password'] = 'xxxx';
$config['MasterServer']['usepconnect'] = 0;
$config['SlaveServer']['servername'] = 'abc';
$config['SlaveServer']['port'] = 3306;
$config['SlaveServer']['username'] = 'a';
$config['SlaveServer']['password'] = 'xxxx';
$config['SlaveServer']['usepconnect'] = 0;
This is depends from your slave DB credentials only. And "Slave DB" means that you have replicated DB on your host (vBulletin can't make this, it should be done automatically by your web server). So, if you have not a replicated DB, you should not setup Slave DB.
A Master-Slave setup is for performance. You send write queries to the master server, and most read queries to the slave server. It helps improve performance because write queries lock tables/rows depending on the database table type, and reads do not.
vBulletin forum

zend router optimization

How can I optimize all of these routes into one. As we do in .htaccess file.
routes.addemails.type = "Zend_Controller_Router_Route_Regex"
routes.addemails.route = "campaign/email/add"
routes.addemails.defaults.module = campaignManagement
routes.addemails.defaults.controller = Email
routes.addemails.defaults.action = add
routes.updateEmail.type = "Zend_Controller_Router_Route_Regex"
routes.updateEmail.route = "campaign/email/edit/?([a-zA-Z0-9_-]+)?"
routes.updateEmail.defaults.module = campaignManagement
routes.updateEmail.defaults.controller = Email
routes.updateEmail.defaults.action = edit
routes.updateEmail.map.key = 1
routes.delEmail.type = "Zend_Controller_Router_Route_Regex"
routes.delEmail.route = "campaign/email/delete/?([a-zA-Z0-9_-]+)?"
routes.delEmail.defaults.module = campaignManagement
routes.delEmail.defaults.controller = Email
routes.delEmail.defaults.action = delete
routes.delEmail.map.id = 1
I've not set up a route using a config file, but at a glance try:
routes.emails.route = "campaign/email/(add|edit|delete)/?([a-zA-Z0-9_-]+)?"
routes.emails.map.action = 1
routes.emails.map.id = 2
I am assuming that the map.* are the variables in the url (so action is the first bit of regex, with id being the second bit of regex. Correct me if I'm wrong).