Did the default Cygwin installation directory change to C:\tools\cygwin? - cygwin

The docs say it's C:\cygwin, but I observe C:\tools\cygwin.
I'm testing the installation with Chocolatey, but I might have had a previous Cygwin installation and don't remember if I changed the default location. I tried to remove all occurrences of C:\tools in the registry but so far the reinstallation insists on installing there.

Looks like Chocolatey sets this location:
$cygwin_root = (Get-ItemProperty 'HKLM:\SOFTWARE\Cygwin\setup' -ea 0).rootdir
if (!$cygwin_root) {
$cygwin_root = if ($pp.InstallDir) { $pp.InstallDir } else { "$toolsLocation\cygwin" }
} else { Write-Host 'Existing installation detected, ignoring InstallDir argument' }
But what's the reason for not using the default location?

Related

Ignore flake8 warning in SublimeLinter

I have installed SublimeLinter-flake8. I would like to exclude the W191 warning when I am using SublimeLinter with flake8. I have checked the SublimeLinter docs and tried adding "--ignore W191" to my user settings file and reloaded plugins but I still get warned about the usage of tabs.
The following is my Packages/User/SublimeLinter.sublime-settings file.
// SublimeLinter Settings - User
{
"linters": {
"linter_name" : {
"args" : "--ignore W191"
}
}
}
I checked this answer on StackOverflow but I would like it to be applied from the settings file.
The linter_name has to be the specific plugin you're looking to configure (in this case flake8) -- try this:
{
"linters": {
"flake8" : {
"args" : "--ignore W191"
}
}
}
though realistically, it is probably better to configure your flake8 settings in flake8's configuration such that contributors to your project can work on your project without your specific sublimetext settings. I believe sublimetext's invocation of flake8 should be compatible with those configurations if I'm reading their code correctly
disclaimer: though I'm not sure it's super relevant here, I currently maintain flake8

Issue with DSC Script

Just trying to create a script to install IIS and Management Tools and getting the error below, any idea what could be the cause of it?
Configuration iis_dsc_file
{
# Import the module that contains the resource we are using.
Import-DSCResource -ModuleName PsDesiredStateConfiguration
Import-module servermanager
# The Node statement specifices which targets this configuration will be applied to.
Node localhost
{
# Code to ensure IIS feature is enabled
WindowsFeature WebServer
{
Ensure= "Present"
Name= "Web-Server"
}
WindowsFeatures IISManagementTools {
Name= "Web-Mgmt-Tools"
Ensure= "Present"
IncldueAllSubFeature= $True
LogPath= "C:\ServerLogs\IIS-Installation-Log.txt"
}
}
}
The error message I get is below:
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The term 'WindowsFeatures' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Any idea what is the issue?
It fails because there is an extra S at the end of the second WindowsFeature
By the way, IncldueAllSubFeature is misspelled too, it should be IncludeAllSubFeature

php-ews folders do not match php-ews code at all

Installed php-ews using composer:
{
"minimum-stability": "dev",
"prefer-stable": true,
"require":
{
"php-ews/php-ews": "dev-master"
}
}
The installation passed fine.
Made this simple request in my project code:
require_once 'composer/vendor/autoload.php';
use \php-ews\php-ews\src\Client;
$host = 'my.server.co.il';
$username = 'user#server.co.il';
$password = 'myPass';
$version = Client::VERSION_2010;
$client = new Client($host, $username, $password, $version);
But the PHP doesn't accept hyphens (-) in its use command path,
I got the error:
PHP Parse error: syntax error, unexpected '-', expecting ',' or ';' in /var/www/html
Then I noticed, the paths of the use phrases in all the code files of the php-ews project, do not match the project files that where installed using the composer at all. For example, in the create.php file there are use phrases:
use \jamesiarmes\PhpEws\Client;
use \jamesiarmes\PhpEws\Request\CreateItemType;
use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAllItemsType;
use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAttendeesType;
use \jamesiarmes\PhpEws\Enumeration\BodyTypeType;
use \jamesiarmes\PhpEws\Enumeration\CalendarItemCreateOrDeleteOperationType;
use \jamesiarmes\PhpEws\Enumeration\ResponseClassType;
use \jamesiarmes\PhpEws\Enumeration\RoutingType;
The above paths do not even exist in the project at all....
The project files and folders that the composer installed, they do not match the code use and require phrases inside of them.
Did I make the wrong installation?
is there other way to use the composer.json file so I can install the project right, without hyphens (php-ews) in the directories?
php-ews Version installed:
"packages": [{
"name": "jamesiarmes/php-ntlm",
"version": "1.0.0-beta.1",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}]
Linux Centos 7
PHP version: 5.4.16
Microsoft Exchange version: 2010
installation seems correct.
require != use
use is a namespace, this on is defined in the Client.php, which is autoloaded.
client.php line 6:
namespace jamesiarmes\PhpEws;

Predicting package version

I'm configuring syslog-ng through puppet on my servers. The configuration files are very different between versions 2.x, 3.1 and 3.3 . On my hosts, depending on the operating system (centos5, centos6, debian 7, ubuntu), the available syslog-ng version will vary.
I had 2 ideas to adapt the configuration of syslog-ng to the correct version :
Custom Fact : It's easy to write a custom fact to test the installed version of syslog-ng. But this fact will be useless if syslog-ng is not already installed.
Conditions in the manifest : I find it a bit ugly to define a "case" in the manifest wich would determine the version of syslog-ng that the operatingsystem provides.
For me, the cleanest way to do this is to test which version of the package is available through the operatingsystem before installation.
A facter could do this, but I guess it would be a bit difficult.
Is there a puppetish way to solve my problem ?
There is indeed puppet-ish way to solve this problem!
You can combine $::osfamily with $::operatingsystemrelease to do something like this in your manifests:
case $::osfamily {
'CentOS': {
case $::operatingsystemrelease {
/^6/: { include syslog-ng::centos6 }
/^5/: { include syslog-ng::centos5 }
default: { notice("This operating system release for CentOs '${::operatingsystemrelease}' is not supported.")
}
}
default: { notice "Unsupported osfamily ${::osfamily}" }
}
I am not sure I understood all of your problem. In any case, one can use puppet package type to ensure a particular version and use $lsbdistdescription to get the OS name. For example :
package { 'syslog-ng' :
ensure => $::lsbdistdescription {
'/CentOS 7/': => "3.2",
'/CentOS 6/': => "3.1",
'/(Debian|Ubuntu)/' => "2.x",
default => "latest",
},
}
NOTE: In the above one has to get the exact name of the OS, i.e. CentOS 7 or CentOS 6 or Ubuntu from each OS. You can do that by executing facter --puppet | grep lsbdistdescription on the OS. I don't have variety of machines, so I couldn't check that exactly.
Then the configuration file can be just one sourced from a template. The template will vary based on the OS.
file { 'file.cfg' :
ensure => "present",
content => template("modulename/file.erb"),
require => Package["syslog-ng"],
}
Hope it helps.

eclipse : impossible to import git project

I got a problem with my eclipse, on debian.
When I try to import a git project from github, using egit I got a
Couldn't create temporary repository.
error after having set my project properties.
However, I works ok when using running eclipse with sudo.
I think it would be related to wrong permissions somewhere, but cannot figure out where :s
I would appreciate some help.
Thanks by advance !
Considering the source of org.eclipse.egit.ui.internal.clone.SourceBranchPage.java mentions /tmp, it should be related with some permission issue around /tmp.
try {
final URIish uri = newRepoSelection.getURI();
final Repository db = new Repository(new File("/tmp"));
listRemoteOp = new ListRemoteOperation(db, uri);
getContainer().run(true, true, listRemoteOp);
} catch (IOException e) {
transportError(UIText.SourceBranchPage_cannotCreateTemp);
return;
}
The OP jlengrand actually reports in the comments:
The problem was simple in fact, but quite handy to track down:
My .gitconfig file had been corrupted during my debian upgrade, which caused egit to crash.

Resources