Sublime Text - Unable to edit package settings - terminal

I am trying to edit the settings for an installed package for Sublime Text.
Background:
Installed Laravel 4 Artisan package via Package Control: Install Package.
Trying to run Artisan commands returns an error message:
Laravel requires the Mcrypt PHP extension.
Via terminal, artisan works fine. This leads me to believe that the PHP version used by Laravel 4 Artisan in Sublime Text is different from the version set up in my .bash_profile.
In the terminal, which php returns /Applications/MAMP/bin/php/php5.4.10/bin/php
In Sublime Text, Package Settings > Laravel 4 Artisan > Settings - Default points to:
{
"php_path": "php"
}
These settings seem to be read-only. I cannot even change the text, let alone save it with the new PHP location.
Any ideas or am I missing something simple?

problem solved. The problem is me being a Sublime Text noob.
Solution for those of you who don't know:
Sublime text packages appear to have various settings modes. A default mode and a user mode.
If you copy the contents of default mode over to user mode, then edit user mode. Then I believe that the settings in user will extend / override the settings in the default mode.
From what I can see, you cannot edit the settings in default.
So instead of { "php_path": "php" }, user settings should be something like the following depending on your php setup.
{
"php_path": "/Applications/MAMP/bin/php/php5.4.10/bin/php"
}

Happy to see you solved your problem. I'll clarify a bit to help anyone else who comes across this. You are correct in the fact that the settings are merged. The load order determines how these files are merged. The User folder is always last. So whatever you specify there will always be taken over that of previous configurations.
Depending on how you installed your plugin, the "Default" settings that came with the plugin may be overwritten. So you don't want to make any changes there that you hope to persist, so placing them in the User folder is the correct thing to do. As an additional note, you don't have to copy the entire contents of the "default" settings. Rather, you only need to specify the settings you want to override. Things will be merged appropriately.
One last thing, I don't believe ST2 makes the default settings read only. I do know ST3 does (well based on where it is installed). Be sure to post questions with the correct tag (sublimetext3 in this case). Was to long for a comment, but I hope this helps clarify things for you.

Also in case anyone is still struggling after doing this, remember to restart SublimeText to enable.

Related

Edit Exploit in Metasploit

How can I change Metasploit module source, I want to change some URL in an exploit.
I have tried the edit command and successfully edited this line to what I want, but changes are not reflected, the exploit has the same behavior as before, it looks like I haven't changed anything, but when I to try edit it again, I see my changes!
Does Metasploit save this anywhere else?
Just reload your module with reload right after you finished with edit
Do u want to edit the Metasploit framework or just one of the exploits?
If u just want to edit an exploit,find the location, edit it ,and reload all the modules by the command "reload_all".

Setup TYPO3 for development on Windows (Apache + OpenSSL)

Setting up TYPO3 on Windows using an Apache server poses some problems I've noticed. Solutions are sporadic and/or incomplete in many instances.
There are the requirements, not being able to connect to the backend, openssl not working and a few more.
So, how to setup TYPO3 on a Windows machine for development?
This answer was made with:
Windows 8.1
Ampps (Apache/MySQL)
GraphicMagick
Setting up Typo3 on a Windows machine using a local server
Apache & MySQL
Make sure you have a local server with Apache and MySQL, such as WAMP, XAMPP, Ampps or another.
Settings this up we'll call the "project" we're going to start: typotest
Create a folder in the "www" or "wwwroot" of your Apache server called "typotest"
Create a virtual domain for your project, in Ampps go to localhost/ampps/index.php?act=ampps_domainmanage (Make sure the server is up and running first!), called "typotest". This will make your project accessible through http:// typotest/ (remove space)
On your machine, go to `C:\Windows\System32\drivers\etc\` and open the "hosts" file in the folder with administrator. Add a record at the bottom: `127.0.0.1 typotest`. Save it and make sure it's there.
Open the Apache `httpd.conf` file in C:\Program Files (x86)\Ampps\apache\conf
Make sure the following lines are **not** commented in the file (remove `#`)
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule ssl_module modules/mod_ssl.so
At the bottom of the file, add the following code
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>
Save the file
Open the `php.ini` file in `C:\Program Files (x86)\Ampps\php` and make sure the following lines aren't commented (remove ';')
extension=php_fileinfo.dll
extension=php_openssl.dll
//edit these lines to be the same
post_max_size = 32M
max_execution_time = 240
We're done with Apache.
OpenSSL
Go to here, or if the link is still active, straight here. Download the most recent 32-bit release of OpenSSL for Windows. I used 2 installations, not sure which one was the correct one.
Visual C++ 2008 Redistrubutable 1.7MB installer (Description: Having problems with error messages when trying to run OpenSSL? This will likely fix the problem. Only works with Windows 2000 and later. Although there is a "newer version" of this installer, this is the correct version to install.)
Win32 OpenSSL v1.0.1j (Description: Installs Win32 OpenSSL v1.0.1j (Recommended for software developers by the creators of OpenSSL). Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.)
That should take care of having OpenSSL installed on your Windows machine.
Additional software
By default, Typo3 cannot handle images out of the box. For it to be able to handle these you need to install GraphicMagick and a setting needs to be modified. The setting we'll get to later during the configuration of Typo3 itself.
The software you'll need is this, download the latest version of GraphicMagick. Get the version that's right for your system (and preferably corresponds to your server). You have the choice between 32/64bit, obviously, but also Q8 and Q16, these correspond to image quality (higher is better).
Windows
To setup Windows to have globally usable variables we need to add them to the system settings. I again used two methods and it might be a question of either/or.
Go to "System" (Windows key + Pause/Break key) (Control Panel/System)
Select on the left: "Advanced system settings"
Go to tab: "advanced"
Hit button: "Environment variables..."
Click "New..." to add a new variable
Name this new variable: "OPENSSL_CONF"
Remember, I used Ampps, so the Variable Value for me is: `C:\Program Files (x86)\Ampps\apache\conf\openssl.cnf` -> Press "OK"
Scroll down in the variables list and select variable: "Path"
Click "Edit..."
Behind the existing variable add: `;C:\Program Files (x86)\Ampps\apache\bin` (including the semicolon at the front!!!)
Save it
Reboot Windows at this time
PHPMyAdmin
Open PHPMyAdmin and create a new database named "typotest". Also create a user for this database with the same name and password. (This is for convenience's sake of this setup, these 3 are ideally different and this practice should never happen on a production environment!)
Typo3 Installation
Download Typo3, I've used v6.2.6. Extract it to the earlier created folder in the "www" or "wwwroot" folder of your local server. Next:
Create a file in the "/www/typotest" or "/wwwroot/typotest" called "FIRST_INSTALL", no extension for this file.
Now start the installation by going to `typotest/typo3/install` in a browser.
Follow the 5 steps of the installation, entering values created above where necessary
**Stop** before you log into the backend!
Open the file `/www/typotest/typo3conf/LocalConfiguration.php` in an editor
Search for the following variables and edit to settings below:
'loginSecurityLevel' => 'normal'
'devIPmask' => '*'
'displayErrors' => 2
Now refresh the login page and login.
In the left menu go to "Install" and select the "Unlock the Install Tool" button
Enter password and continue
Go to "All configuration"
Select "Toggle all" below
Search for "rsa"
Where it says: "[BE][loginSecurityLevel] = rsa" change "rsa" to "normal" in the inputfield below.
Modify [FE][activateContentAdapter] = 1 //This enables the viewing of images [source](http://stackoverflow.com/questions/25265924/typo3-distribution-png-issue-when-posting-images)
Modify [GFX][im_path] to the path of your GraphicMagick installation (e.g.: C:\Program Files\GraphicsMagick\ )
Modify [GFX][im_path_lzw] to the path of your GraphicMagick installation (e.g.: C:\Program Files\GraphicsMagick\ )
Modify [GFX][im_version_5] to "gm" (short for GraphicMagick)
Choose "Write configuration" at the bottom of the page. This saves this setting from becoming reset to default "rsa" for BackEnd ([BE]) login. (Make sure to change this back when going to production!)
This might not help everyone out there but it's all the stuff I had to change to get Typo3 to work and it might help a few future souls that have the same or similar troubles.

Setting default firefox preferences

Our continuous integration process uses Selenium, and twice in the last few months it has been knocked out of action thanks to firefox updating itself (either on developer machines or the CI server).
We have therefore installed the previous firefox version alongside the later one (this time in a directory called firefox-16), until Selenium catches up.
The problem is, the app.update.auto setting (in about:config) is set to true by default - meaning that sooner or later it will update itself to 17 and selenium will break. We therefore installed an all-no-update.js file in the /usr/lib/firefox-16/defaults/pref folder containing
user_pref("app.update.auto", false);
which (according to MDN) should override any other values. Unfortunately it doesn't work - the about:config page still shows auto-update as app.update.auto as true. This MDN page says:
All Mozilla-based applications read (application directory)/defaults/preferences/*.js
but unfortunately that doesn't work either - the value stays unchanged.
I've trawled the Bugzilla database but can't find anything relevant (other than the fact that an all.js file gets deleted by an upgrade so be sure to use all-*.js file).
Does anyone know enough about the workings of Mozilla Firefox to tell me how to set this preference value? (please don't say "click on the about:config page" - it needs to be automatically to ensure the build is repeatable and stable).
Thanks, James
Edit:
Sorry if the above isn't clear: I can create default preferences, for newly created profiles, just fine. But as users already have a profile this won't have any effect. I could possibly create a new profile on every machine, for every user, that has this setting disabled - but it is a lot of overhead. Sysadmins all over the world must be using this functionality somehow, surely: a way to override a given preference with a centrally-set one?
The most likely reason is using user_pref() function - as the name already says, this one is reserved for user's preferences (in user's profile), default preferences should use pref() instead.
You also have to consider that whatever you put into this directory are default preferences, they can be overridden in the browser profile (in the file prefs.js there). If you aren't using a clean profile the preference can already be set there and the default won't have any effect then.
For reference: A brief guide to Mozilla preferences
From MDN: Enterprise Deployment (Configuration)
Some config items require lockPref to be set, such as app.update.enabled. It will not work if it set with just pref.
Suspect this may apply to app.update.auto as well. Although I can find no obvious (i.e. named update) configuration option in about:config that is specific to any given add-on. So I don't even know if the per-add-on setting is a pref?

Setting up phpstorm 4 with XAMPP on Windows 7

I need help setting up phpstorm (4.0) with XAMPP which is at the default location c:\xampp\htdocs. I create all my projects at c:\xampp\htdocs\projectname.
Here are the things I have already done:
Setup the PHP interpretator by going to settings and then PHP (main menu)
Go to PHP > Servers and then
To setup run configuration I have the done the following:
Now when I run using the above configuration it just takes me to localhost in my browser, instead of the file I am editing (http://localhost instead of localhost/myproject/myfile.php).
What am I missing? I read the help topics of phpstorm and googled a lot but still couldn't figure it out.
Turns out you don't need to set up run configuration. The answer lies in setting up the mapping in the deployment tab in settings.
(assuming that you are creating your projects in c:\xampp\htdocs)
To do that go to settings (Ctrl + Alt + S) and then choose deployment:
Under mappings tab, it should look like this:
And after that you can view the file in the browser through this menu:
Check the answer to this question. If you need to debug, the recommended way to do it is zero configuration debugging.

Visual Studio Installer: How to make app.config a hidden file if I choose to add primary output instead of individual files?

Basically, I created a Visual Studio Installer project. I added a primary output to my project, which was great because it loaded in the dependencies and files automatically for me. The problem I'm facing is that I want to be able to mark my config file as a hidden file, but can't seem to figure out how.
When I go to View>File System it lists:
MyExternalAssembly.dll
Primary output from MyProject (Active)
So, is there a way to actually mark my config file as hidden during installation if I add a primary output project instead of the individual files?
I'm not sure if you really want to make it hidden. If you're worried about users looking at it, a more than average user will know how to un-hide things and pilfer around. So, that being said, if you want to keep users from seeing what's in the config you will need to encrypt the config. A good example of that can be found here:
http://www.davidhayden.com/blog/dave/archive/2005/11/17/2572.aspx
If you still want to hide the config, then you could try hiding it once the application is run for the first time.
Using: ApplicationDeployment.IsNetworkDeployed && ApplicationDeployment.CurrentDeployment.IsFirstRun with a click once application you can tell if this is the first time an application is run.
You could then use File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden); to actually hide the app.config.
Which would result in:
if (ApplicationDeployment.IsNetworkDeployed && ApplicationDeployment.CurrentDeployment.IsFirstRun)
{
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
}

Resources