Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

2018-01-04

Cygwin: Permissions 0660 for '~/.ssh/id_rsa' are too open.

Environment:

  • MS Windows 8.1
  • Cygwin 64bit
  • ssh keys copied from somewhere and placed to ~/.ssh/

Problem:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0660 for '~/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: ~/.ssh/id_rsa

Did not work:

  • chmod 600 id_rsa
  • chmod 700 .ssh
  • Playing with Windows security panels
  • Setting group to SYSTEM
  • Everything else

Solution:

Found on Vineet Gupta's blog http://vineetgupta.com/blog/cygwin-permissions-bug-on-windows-8

chgrp Users id_rsa
chmod 600 id_rsa

Now, all works. Thank you, Vineet!

2017-01-15

Cannot disconnect USB drive? Close the Task Manager!

Excuses
Yes, I am still using a WD "Passport" for downloaded movies. Copy on PC and connect the drive to TV's port. Yes, I know that I can stream. Yes, I have a good router. Never mind :-)
Oh, yes, I am still using Windows. Dear Mac users, I love you, too, but not as much as I love Bill Gates :)

<jokes aside>

Problem
"Windows cannot disconnect your USB drive". Close the programs, blah-blah-blah.

Obvious
Well, closing File Manager's windows surely helps.
Waiting a bit after the file is "copied" helps, too. I guess, some portions of it are not flushed to the drive yet (who knows, it's Windows).

Who cares?
My TV. Sometimes. Just does not see the files if the drive wasn't properly dismounted.

Not so obvious
The TASK MANAGER!
I believe, it monitors the disk activity. So, shut it down.

Not obvious at all
Atlassian's SourceTree.
Why? Who knows. I do not want to know. These days, I am using PHPStorm's Git or a command line. SourceTree is kept for some strange cases when I am not 100% sure what I just did... :-)

</off to watch>

2016-11-27

ln -s on Windows? Use mklink for symbolic links !

I needed to make Apache server seeing a folder via a symbolic link - on MS Windows. The standard Windows' shortcuts look like links, but Apache does not see them...

Apparently, there is a way to make REAL symbolic links under Windows. (Must run command prompt as administrator).

For example:

mklink C:\etc\hosts C:\Windows\System32\Drivers\etc\hosts

results in

C:\>dir c:\etc

2013-01-02  21:37    <DIR>          .
2013-01-02  21:37    <DIR>          ..
2013-01-02  21:37    <SYMLINK>      hosts [C:\Windows\System32\Drivers\etc\hosts]


The syntax for folders is:

mklink /D linkName target



Note: do not forget the drive letter (C:), or the link may not work in some situations.

Read more:



2016-07-14

Cygwin and ANSI terminal

Problem

I see ANSI color sequences on Cygwin.

Explanation

The default Cygwin.bat runs bash in a Window terminal, which does not support ANSI sequences, so you'll see the color codes instead of actual colors:

$ codecept selfupdate

[37;41m                                                                   [39;49m
[37;41m  [Symfony\Component\Console\Exception\CommandNotFoundException]   [39;49m

Solution

Edit the Cygwin.bat and make it look like:

@echo off

C:
chdir C:\cygwin64\bin

mintty -

Now, it will run "mintty", which is a different terminal, and it will show the colors correctly.
(Be prepared for the possible changes in copy/paste with mouse clicks).

2011-10-21

Netbeans 7.0.1, SVN (Subversion) 1.7, CYGWIN and TortoiseSVN

Environment: MS Windows


I upgraded the CYGWIN, and the version of SVN upgraded to 1.7

$ svn --versionsvn, version 1.7.0 (r1176462)   compiled Oct 11 2011, 10:36:16
Everything went smooth with "svn upgrade" of the folders.


$ svn help upgrade: Upgrade the metadata storage format for a working copy.usage: upgrade [WCPATH...]
NetBeans, however, gave me an hour of headache.


Here are my discoveries (things to do are marked in bold)

  1. By default, NetBeans uses internal SVN client and not the on specified in Options - SVN command line.
  2. To use the command line client, there is an option:
    -J-DsvnClientAdapterFactory=commandline
  3. Adding that option to NetBeans config file did not help. Had to add this as a parameter to the shortcut launching NetBeans
  4. CYGWIN does not like being called from NetBeans. First, it complains about MS-DOS paths (C:\blah-blah), and when it is fixed by setting CYGWIN=nodosfilewarning, still produces some weird error messages
  5. http://tortoisesvn.net/ worked perfectly, however. Do not forget to install the command-line client (which was unchecked in the default setup). You still have to run NetBeans with that -J switch.

2010-12-17

PHP : "intl" extension, Windows, Apache

PHP Internationalization support ("intl") is bundled as of PHP 5.3.0 and does not require PECL:
http://www.php.net/manual/en/intl.installation.php

Things to check if it does not work under Windows/Apache:

  1. php_intl.dll exists in the "ext" folder of the PHP root ( normally it's c:\Program Files\PHP\ext )
  2. The php.ini file in c:\Windows folder has these lines:
    extension_dir="C:\Program Files\PHP\ext"
    extension=php_intl.dll
    (php.ini in c:\Program Files\PHP may work too, but I keep it in Windows folder so it's not accidentally removed when PHP is upgraded)
  3. There are ICU .dll files in c:\Program Files\PHP:
    icudt*.dll
    icuin*.dll
    icuio*.dll
    icule*.dll
    iculx*.dll
    icutu*.dll
    icuuc*.dll
     (* is version number, for example icudt36.dll)
  4. c:\Program Files\PHP is in the %PATH% (environment variables in Control Panel - System - Advanced - ...)
    Without that, the ICU dlls are not loaded by PHP as Apache module - no error message is displayed, but the extension is not in the phpinfo().