Why does downloading bash script from pastebin not work? I'm trying to upload and download a bash script from pastebin, upload was straightforward enough with copy and paste, download didn't go as easy.  There are two scripts I'm trying to download, these are the commands:  wget http://pastebin.com/raw.php?i=M6iQ6RaY --output-document=ts3update wget http://pastebin.com/raw/e11R2wkP --output-document=ts3restore   When I try to run them, I get  this error:  ./ts3update: /bin/bash^M: bad interpreter: No such file or directory   Then if I remove the interpreter line, I just get this:  ./ts3update: line 4: $'\r': command not found   And this:  ./ts3restore: line 3: $'\r': command not found ./ts3restore: line 7: syntax error near unexpected token `$'in\r'' '/ts3restore: line 7: `        case $yn in   Why does this happen, and how can I fix it? When I read or grep the files I find no instances of ^M or '\r' why does bash see something like that when nothing else does?
Bash/Korn shell script edited on Windows throws error '...^M: not found' I wrote a Bash script in Windows using Notepad++.  cxStopAllServicesOnSERVER.sh  #!/usr/bin/bash cd "/some/path" echo "Hi. Logs can be found at "`pwd`"/cxStartStopLogger.log" echo "["`date`"]*** STOPPING ALL SERVICES ON SERVER ***" &gt;&gt; "cxStartStopLogger.log" exit   Now after uploading it and setting the required file permissions, I tried executing it as follows:  bash-3.00$ cat cxStopAllServicesOnSERVER.sh #Let's have a look at the code. #!/usr/bin/bash cd "/some/path/" echo "Hi. Logs can be found at "`pwd`"/cxStartStopLogger.log" echo "["`date`"]*** STOPPING ALL SERVICES ON SERVER ***" &gt;&gt; "cxStartStopLogger.log"  bash-3.00$ # Code and hashbang 'looks' correct,  bash-3.00$ # if there is any issue with the format (EOL characters and such)  bash-3.00$ # we cannot see it using cat. bash-3.00$  bash-3.00$ sh cxStopAllServicesOnSERVER.sh cxStopAllServicesOnSERVER.sh[2]: /some/path^M:  not found Hi. Logs can be found at /some/path/cxStartStopLogger.log bash-3.00$ # Note that ^M appears at the end of the line.  bash-3.00$ bash -x cxStopAllServicesOnSERVER.sh + cd $'/some/path\r' : No such file or directory1.sh: line 2: cd: /some/path ++ pwd ' echo 'Hi. Logs can be found at /some/path/cxStartStopLogger.log Hi. Logs can be found at /some/path/cxStartStopLogger.log ++ date + echo '[Sun' Nov 18 00:28:17 EST '2012]*** STOPPING ALL SERVICES ON SERVER ***' bash-3.00$ # Note that '\r' return character appears at the end of the line.   Problem: When I change the code to korn shell I face the same issue. Appears that an incorrect character is getting added at the end of the line.   NOTE: I found the solution and have posted the same as an answer. Feel free to update or improve it to help other beginners that may face the same issue.  Thanks!
I usually use "at a company" but I have encountered some articles using "in a company", "in XYZ firm" or "in an organization".  Which one is right? Intuition behind $k$-algebra, $k$-algebra morphisms? Why are my textures pink? Prevent Windows 7 from sleep + power button hook I'm used to not shutdown Windows but to sleeping it. I set up power button (PB) action to do it. When I want to shutdown I must go to start -> Shutdown. That's OK.  Now I think of a mechanism that will be hooked up to a PB. Should be started after I press PB but before OS will go to sleep. Something that will check few conditions (i.e. running backup, running AV scan, ...) and if true (something is running) prevent go to sleep.  Optionally: It would be nice to start the same "mechanism" before restart and shutdown (invoked not only from Start menu, but also by other software (i.e. installers) but with option to allow some sources (i.e. UPS software)  Generally: How to run something after PowerButton but before Sleeping. How to code (C#.NET, vbs, batch (preferred)) sleep prevention (cancellation). What is the point of stacking favorite notifications? Is there an easy way of getting the charset and collation of the DB tables in WordPress without resorting to SQL queries? I'm embarking on a new web map project that seeks to display simple geometries (lines, points, polygons) and rasters/basemaps. Ideally, the map will also allow authorized users to add/remove/edit geometries and their attributes.  What are the available options for the storage of data (e.g. SQL Server Spatial)?  What are the available options for the presentation of data (e.g. ArcGIS Server)?  I'm new to web mapping and am attempting to build a solid understanding of the available options and their pros/cons. Is password confirmation necessary on a Change Password dialog? How to completely delete and app from iphone (including all the data and history) So this problem particularly emerged with the Tinder app. I was using Tinder with a user account (A) and one day I logged out and created a new user account (B) which I never succeeded to activate due to sms verification problems, so I decided to login again with my old account. But even when I delete the Tinder app and reinstall it again, it still shows the B account logged in to the app. This means that IOS is somewhere storing a history for this app. Now I'm looking for a way to delete this history.  Note that this question is not necessarily about a certain app, but rather about where IOS stores historical data of apps and how to delete those histories alongside with the app.  P.S: If there are solutions like changing UUID of my i-phone that wouldn't damage my phone (I'm new to iphone so I'm not sure what I'm saying. For instance this jailbreaking thing which I keep hearing about and I'm not sure what it exactly does to my phone, doesn't sound like an I idea that I like), I'm open to them. How to change a default application in Ice Cream Sandwich? I used the ADWLauncher EX by default while having Gingerbread 2.3.6.  Today I have manually updated my Nexus S to Ice Cream Sandwich 4.0.3, and I wanted to give the new default launcher a shot, but I cannot find anymore where to select / forget the default application for an action.  I've turned the settings of my phone inside out, googled and crawled the forums, but without success. If anybody can tell me how to change a default application in ICS, I'd be grateful!      Yeah, I never thought I'd want to see that Complete action using... window again! :D After many unsuccessful trials based on almost everything about this topic on the Internet, I decided to ask this question again. There is almost  in this platform, but it did not work. That's why I am here.  I want to have Ubuntu 18.04 installed on my USB memory stick (SanDisk Cruzer Glide 32GB) with a persistent storage of more than 4GB (at least 23GB in my case).  I used MiniTool partition wizard to format the stick (NTFS) on Windows. Then, I used Universal USB Installer 1.9.8.2 to install Ubuntu 18.04 on the stick. Here, I tried to format the stick either fat32 or ntfs, but nothing changed. Later, I used another Ubuntu to delete the casper-rw file and create another partition with the same name by following the steps given in the link given above. Unfortunately, I couldn't make it working although I tried almost all combinations.  Can anyone give a thorough list of steps to follow in order to install it on the stick properly?  Edit: I gave ear to @c-s-cameron 's comment below and used YUMI to do that, and it worked. I believe all other answers would work, but I dont have time to give a try for all of them. Thanks all, again! Do matrices $ AB $ and $ BA $ have the same minimal and characteristic polynomials? Let $ A, B $ be two square matrices of order $n$. Do $ AB $ and $ BA $ have same minimal and characteristic polynomials?   I have a proof only if $ A$ or $ B $ is invertible. Is it true for all cases? Punctuating a quoted question within a quoted statement I'm working on a story, and I find myself faced with something of a quandary.  Specifically, I need to know the proper style for the following:     “I have thousands of them,” the commissioner answered, “but I’ll start with ‘What do you need?’.”   Is it proper form to have both the question mark and period, or should one of them be dropped? Do Americans remove the "t" in "wanted"? When you pronounce the phrase "I got a message you wanted to see me", is the "t" usually deleted in the word "wanted"? Thank you. birthday problem - expected number of collisions There are many descriptions of the "birthday problem" on this site — the problem of finding the probability that in a group of $n$ people there will be any (= at least 2) sharing a birthday.  I am wondering how to find instead the expected number of people sharing a birthday in a group of $n$ people. I remember that expectation means the weighted sum of the probabilities of each outcome:  $$E[X]=\sum_{i=0}^{n-1}x_ip_i$$  And here $x$ must mean the number of collisions involving $i+1$ people, which is $n\choose i$. All $n$ people born on different days means no collisions, $i=0$; two people born on the same day means $n$ collisions, $i=1$; all $n$ people born on the same day means $n$ collisions, $i=n-1$.  Since the probabilities of three or more people with the same birthday are vanishingly small compared to two people with the same birthday, and decreases faster than $x$ increases, is it correct to say that this expectation can be approximated by  $$E[X]\approx {n\choose 0}p_{no\ collisions}+{n\choose 1}p_{one\ collision}$$  This doesn't look right to me and I'd appreciate some guidance.    Sorry - edited to change ${n\choose 1}$ to ${n\choose 0}$ in second equation. Sloppy of me. Where did they go?   Where do they went?   Can you please advise which of above forms is correct?  I'm pretty sure that first one is fine but wondering about second one.   Can I use a second form as well or it's incorrect? As a new user without much rep, what should I do if someone else has already asked a question I have, but it has no answers? Is it possible to use a bluetooth headset mic while having High quality sound I have a Plantronics BackBeat Sense SE bluetooth headset. When Connecting it to Windows 10, it installs two profiles in Playback devices list:    PLT_BBTSENSE Hands-Free. PLT_BBTSENSE Stereo.   The Second one (Stereo) is set to be the "Default Device" and the "Default Communication Device" on the system.   At this point the sound works great and normally. The problem happens when I want to use the mic. When I start any program that uses the mic (recorder, chat, VoIP Calls, gaming, etc.) The sound suddenly stops working And I can only use the mic until I stop the recorder or the call.   The thing that kind of fixes the problem is setting the (Hands-Free) as the default device. I can hear the sound when I do that and it works with the mic but it becomes Very bad quality.  What I became to understand is that bluetooth had different profiles for sound and mic: A2DP and HSP. The first handle the voice(High Quality) but the latter handles the mic and reduces the sound quality.  Is this really the case? Is there anyway to make them work simultaneously? Is there any solution to this problem at all? How to give an image or video a TV screen effect? I thought it would be interesting to create a .blend that filters any regular video or image with vintage television look.   Edit: Although this question initially arose from my desire to create a vintage look, it has since been pointed out in a comment that all displays use arrays of RGB emitters, so it's not really an issue of vintage or not. How vintage it will end up looking is probably more a matter of the shape, size, and density of the emitters.  Reference images:       Upon examining the structure of screens, the most common seems to be rows of vertical RGB bars:    Here is another type which I believe is common in computer displays - circular dots in a hexagonal grid:    I have been thinking about how to make a screen in Blender that takes its input from an image or image sequence and for each frame converts the RGB value for a pixel (or region) and uses that to illuminate the red green and blue phosphors in the correct ratios so that when viewed from a distance an image is distinguishable.  Do you think this will require python scripting? I made some initial attempts modeling an array of phosphors then using a Light Path node and a Separate RGB node in Cycles but I haven't gotten very far. I would love to hear what you all can suggest.  Thanks! Determining confidence interval with one observation (for Poisson distribution)