Cygwin ls command not found [closed] - path

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
This is a question that I self-answered on my tech blog where I keep the tech-tips which I need to give to myself from time to time, so I decided to move it over here instead. The original blog post is here: http://thehacklist.blogspot.com/2009/04/cygwin-ls-command-not-found.html
If you are a linux enthusiast and really miss those greps and sed/awks on the windows box, you've probably installed cygwin. You tried running it either by double-clicking the cygwin icon on your desktop or the cygwin.bat file in your C:\cygwin directory and got the bash-3.X$ prompt. However, although the pwd or cd commands work, if you try ls, it says:ls: command not found.

Right click on "My Computer" -> Properties -> Advanced ->
Environment Variables
Add a new environment variable, called CYGWIN_HOME and set its value to C:\cygwin
Edit the PATH environment variable and add %CYGWIN_HOME%\bin to it (usually separated by a ';').
Just click okay, exit any command prompts or bash shells (over cygwin) you may have open, and open it again - it'll work!
Assumption - this assumes that you have installed cygwin at C:\cygwin. If you've kept it someplace else, please modify the above accordingly.

Check the cygwin.bat file, it should have something like:
set PATH=C:\cygwin\bin;C:\cygwin;%PATH%
...etc
bash --login -i
(you don't really need c:\cygwin in there, but I have some additional scripts/bat files there; the key thing is c:\cygwin\bin)

Related

Kubernetes deployment via Web UI - 'Failed to pull image' error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am creating a deployment using "CREATE AN APP" option from the Kubernetes UI page on windows - with two pods and external service. The image being used is available. However, I am getting an error saying:
**Search Line limits were exceeded, some search paths have been omitted, the
applied search line is: my-namespace.svc.cluster.local svc.cluster.local cluster.local <ORG DOMAIN NAMES>**
**Failed to pull image "dockerUserName/python-app-image": rpc error: code = Unknown desc = Error response from daemon: manifest for dockerUserName/python-app-image:latest not found**
I am new to K8S and have no idea like where I am going wrong. Any help would be much appreciated.
That error is thrown by the Docker daemon when the image cannot be found. Verify that the image and tag you are trying actually exist by running docker pull dockerUserName/python-app-image:latest.
Alternatively, run docker images to get a list of images you have already pulled and check the TAG column.
Keep in mind that the latest tag for Docker is just a naming convention. You need to create it and keep it updated yourself, it does not automatically give you the last pushed image.

Windows 10 - Username with whitespace and PATH [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
Upon installing Windows 10 I created my admin user as Miha Šušteršič. Now when I install programs that need to modify the environment variable PATH, most of them don't get added. For instance this happens with MongoDB and Git, but npm got added normally.
I think this is an issue with the whitespace in the path to the variables. I tried renaming my username to M.Sustersic, but the system folder Users\Miha Šušteršič\ did not get updated.
Is there a way for me to change this folder name automatically (so the rest of the app dependencies on \Users\Miha Šušteršič\AppData don't get bugged) or do I need to reinstall windows?
Is there something else I am missing here? I tried adding the dependencies on my own, but nothing worked so far.
You can actually change the folder name. It's a bit tedious but it's worth it. Make sure you know of the edition of your Windows 10 you're using first - Professional, Enterprise or Home - before carrying out these steps, cos of step 5:
Right click on Windows Start Menu option and click Command Prompt (Admin)
(If you can't find Command Prompt (Admin) when you right-click on the Start Menu or search for it, you can simply go to C:/Users/Default/AppData/Local/Microsoft/Windows/WinX/Group3 on your pc. There, you'll find two shortcuts both named "Command Prompt"; one is for Command Prompt, and the other is for Command Prompt (Admin).Try out both shortcuts to know which is which, and then click on the one for Command Prompt (Admin))
In the Command Prompt (Admin), create a new/temporary admin account by entering this command: net user Administrator /active:yes (Notice the space between Administrator and /) and close the cmd
Next, click on the start menu and sign out of your current admin account
(four icons above the shut down button)
Sign in with the new Administrator account you just created
(Skip this step only if you use the Windows Home Edition) Right click on the Start Menu and click Computer Management and open Local Users and Groups > Users. Right-click on the username you wish to change and select Rename and close the window.
Open Local Disk (C) > Users and right-click and rename the corresponding folder with the name you wish, just as in Step 5, and close the window.
Next, search for regedit in the search box and click on it. Now, inside the regedit (i.e. Registry Editor), go to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT > Current Version > Profile List.
In the list of identifiers under Profile List, find the ProfileImagePath that corresponds to the account name you wish to change. Yours should look something like this:
ProfileImagePath REG_EXPAND_SZ c:\Users\Miha Šušteršič.
Double click on the value and rename it to what you want.
Still in the regedit, scroll up to the top of the window and make sure the highlight is on Computer, then click Edit in the menu options just above it; then click Find; then enter C:\Users\<your old username>. In your case, that would be:
C:\Users\Miha Šušteršič
And search.
If the search brings out any result (i.e. any folder bearing your old account user name,) click on it and rename it, and then go back to Edit in the menu option and this time, click Find Next or f3. Keep on "Finding Next" this until there are no files are left to rename, then close regedit.
Finally, sign out of your Administrator account and sign in with your now-renamed account, and then, go on to disable the Administrator account you just signed out from. You do this by going to Command Prompt (Admin) and this time, you enter the command:
net user Administrator /active:no
(Once again, notice the space between Administrator and /)
...and close the command.
And that's it! Long and tedious, but it works. You can check also out this video to have a better understanding of everything I just described.
_Note: Make sure to follow every step to the letter so you don't run into more serious problems.
If you run into any issues renaming at Step 6, simply shut down your computer and restart and try again.
Also, certain files may/will not allow for renaming. It's alright; just leave them as they are and "Find Next" until there's no more file to rename._
See this KB article to change the name of the User Profile directory.
After you do this, you may want to make a link just in case any of your apps keep local path configuration.
cd C:\Users
mklink /D "Miha Šušteršič" M.Sustersic

Running Fitnesse in Debug mode [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I used to use Fitnesse daily years ago, but forgot how to run tests in debug mode (or have stack trace information be output) - does anyone know?
I recall being able to configure it either as a flag when running/starting up fitnesse.jar, or as a URL parameter (e.g. http://localhost:8090/FitLibraryWeb.MyTest?test&debug=true)
To debug fixtures in .Net I normally add Debugger.Break() inside my C# fixture code
Although my prefered development solution has already been pointed out on Rustin's DebugBreak() suggestion, and alternate solution is to invoke RunnerW.exe, which requires adding the following line to your target Fitnesse test page
[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]
Please, bear in mind that I am assuming your test page already defines REMOTE_DEBUG_RUNNER pointing to RunnerW.exe, as stated in Fitnesse guide's Customizing Test Execution section
For the sake of simplicity, I will present a sample fit test header.
So, here is how to Remote Debug using Visual Studio:
Make sure you fitnesse test page starts with the following lines
!define TEST_RUNNER {FitSharp\Runner.exe}
!define REMOTE_DEBUG_RUNNER {FitSharp\RunnerW.exe}
[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]
The rest of your test specification goes here
In Visual Studio, set target code breakpoint
On fit test page, click on Press me to start in remote debug mode, defined above. This starts the RunnerW.exe process (winform app called Fitsharp) which will wait for 30 seconds (I am not sure).
In Visual Studio > Debug menu > Attach to process, locate RunnerW.exe and press Attach button.
On Fitsharp window (RunnerW.exe process), click GO button and you are on your way.
As pratical solution, I use the following strategy:
I create static page called SetupEngine and add the 3 lines stated on previous step 1.
On the top of every test page, I just put the following header, so I don't have to repeat those 3 lines.
!include .SetupEngine
Note that . (dot) on .SetupEngine (which is a path) refers to your Fitnesse root page. You may have to adjust it.
I had this ideia when I was referring to Fitnesse.UserGuide's remote debug section
Hope it helps
Add the following line just before the your test target location
!|debug|
For further details, refer to Michael Sorens' excelent article, the most comprehensive article on Fitnesse debug techniques.
Your thinking of using RunnerW.exe as opposed to the Runner.exe.
If you change your test runner to be RunnerW a pop-up window will appear with a 'go' button on it, and will not start the fitnesse test until you hit it.
Before hitting go you can attach to any process (via 'Attach To Process' in the debug menu if your using VS) and the execution will pause at the break points set.
Note: You must have the same build being used by FitNesse as the code you are debugging.
You can also attach to a remote process, using the Remote Debugger.
Also, if you attach the the RunnerW.exe process, you can debug the fixtures themselves.
I haven't had to do it in a while, but the current documentation that comes with FitNesse indicates that you are close. You should be using remote_debug instead of debug.
The best thing is to start with the documentation that comes with your copy of FitNesse, as it matches what you are running. If you are running on port 8080, then the following link should work: http://localhost:8080/FitNesse.UserGuide.DebugingFixtureCode.
Assuming you are using Java, these instructions should help. If you are using a different language I am not sure I can help.

Command - R like functionality in MacVim

I'm on a Mac and when I am in TextMate editing a ruby file I can simply hit Command-R to execute the file and see the results in a new window. Is there something similar to this using MacVim?
It's really important that I be able to open up a NEW window. Reason is because in the current window I might have more than one full page of info. If that happens I can't scroll through it.
You could create your own mapping to do it:
map <D-r> :w<CR>:!ruby %<CR>
% is the current file. If your file starts with #!/path/to/ruby you can omit the explicit call to ruby in your mapping.
Haven't tested the <D-r> mapping - no mac here. It's likely configuration dependent.
The following question has the answer to exactly what I was looking for
https://superuser.com/questions/133886/vim-displaying-code-output-in-a-new-window-a-la-textmate

How do I restart a service on a remote machine in Windows? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?
You can use the services console, clicking on the left hand side and then selecting the "Connect to another computer" option in the Action menu.
If you wish to use the command line only, you can use
sc \\machine stop <service>
You can use mmc:
Start / Run. Type "mmc".
File / Add/Remove Snap-in... Click "Add..."
Find "Services" and click "Add"
Select "Another computer:" and type the host name / IP address of the remote machine. Click Finish, Close, etc.
At that point you will be able to manage services as if they were on your local machine.
You can use System Internals PSEXEC command to remotely execute a net stop yourservice, then net start yourservice
Using command line, you can do this:
AT \\computername time "NET STOP servicename"
AT \\computername time "NET START servicename"
I would suggest you to have a look at RSHD
You do not need to bother for a client, Windows has it by default.
Well, if you have Visual Studio (I know it's in 2005, not sure about earlier versions though), you can add the remote machine to your "Server Explorer" tag. At that point, you'll have access to the SERVICES that are running, or can be ran, from that machine (as well as event logs, and queues, and a couple other interesting things).
One way would be to enable telnet server on the machin you want to control services on (add/remove windows components)
Open dos prompt
Type telnet yourmachineip/name
Log on
type net start &serviceName* e.g. w3svc
This will start IIS or you can use net stop to stop a service.
Depending on your setup you need to look at a way of securing the telnet connection as I think its unencrypted.
Several good solutions here. If you're still on Win2K and can't install anything on the remote computer, this also works:
Open the Computer Management Console (right click My Computer, choose Manage; open from Administrative Tools in the Start Menu; or open from the MMC using the snap-in).
Right click on your computer name and choose "Connect to Remote Computer"
Put in the computer name and credentials and you have full access to many admin functions including the services control panel.

Resources