Bash issues with output

I have the following script:

 
/bin/sh
echo  "Compare Ran" $(date) >> /var/log/ran.log
if cmp -s "/var/log/ip.log" "/etc/wanip.log"
then
   echo "Wan Check Ran" | /var/log/ran.log
else
   echo "WARNING IP CHANGE" | sendmail *********@email.****.net
fi

If the 2 files don’t match the script works great but if the 2 files match I get the following output:


/var/log/ran.log: 1: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 2: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 3: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 4: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 5: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 6: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 7: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 8: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 9: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 10: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 11: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 12: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 13: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 14: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 15: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 16: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 17: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 18: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 19: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 20: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 21: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 22: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 23: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 24: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 25: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 26: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 27: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 28: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 29: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 30: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 31: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 32: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 33: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 34: /var/log/ran.log: Thu: not found
/var/log/ran.log: 35: /var/log/ran.log: Compare: not found
/var/log/ran.log: 36: /var/log/ran.log: Compare: not found
/var/log/ran.log: 37: /var/log/ran.log: wanip.sh: not found
/var/log/ran.log: 38: /var/log/ran.log: Compare: not found

I can not for the life of me figure out why the script seems to be “reading” the ran.log file if the 2 files are the same.

Any Ideas?

Azure Connect “soft match” issues

Before I get into the details: my problem is clearly different than the one described in this question. I’m running a single Azure Connect instance, so the problem clearly isn’t due to multiple sync. In fact, our system is using Azure Connect from the start, so there’s no upgrade to speak of.

That said, pretty much every member of our organization had both a local AD account as well as a separate Office365 account. As such, in our case, the Azure Connect has to sync up to existing Azure AD accounts.

The process worked for most of our users; however, 9 accounts remain problematic, and I cannot figure out why.

The error message is pretty “standard”:

Nie można zaktualizować tego obiektu, ponieważ następujące atrybuty skojarzone z tym obiektem mają wartości, które mogą już być skojarzone z innym obiektem w lokalnych usługach katalogowych: [Mail user@domain.com;]. Popraw lub usuń zduplikowane wartości w katalogu lokalnym. Więcej informacji na temat identyfikowania obiektów ze zduplikowanymi wartościami atrybutów, można znaleźć w artykule http://support.microsoft.com/kb/2647098.

Tracking Id: GUID
ExtraErrorDetails:
[{“Key”:”ObjectIdInConflict”,”Value”:[“GUID”]},{“Key”:”AttributeConflictName”,”Value”:[“Mail”]},{“Key”:”AttributeConflictValues”,”Value”:[“user@domain.com”]}]

The “friendly” part of the error message is in Polish, but it’s the standard “InvalidSoftMatch” error.

Now, I know I’m using soft matching by SMTP address… but the user in question has a clearly defined email (via the email attribute in AD; we don’t have a local Exchange to make use of the proxyAddresses attribute). That same user has the exact same SMTP address in Office365 Exchange (as well as a SIP address which is also the same). Needless to say, I can’t find any other mentions of this email being used in Exchange online.

As such, I can’t figure out why this account isn’t being synchronized and keeps throwing the “soft match” error.

Question: Honda Civic issues?

Okay so I have a 2003 Honda Civic. This only happens when it rains/ or drive through a puddle of water. Why is it that when I’m driving when it’s rainig hard or drive through puddles the right side of my car makes a very violent noise, almost like it’s dying. It vibrates violently and it’s kinda scary. Can an engine get wet? If so is there a way for my engine to not violently shake. Again it’s on the right side.

XT1064 – 5.0.1 – Rooted – Issues with writing to /sdcard

I just rooted my Moto G 2014 XT1064 running 5.0.1.

I used this article to do the root process: http://maktechblog.com/how-to-unlock-the-bootloader-and-root-the-motorola-moto-g-2nd-gen/#Root Which evolved unlocking the bootloader (which caused data to be erased, of course), installing TWRP, then copying SuperSU.zip over adb, then going back to TWRP recovery and installing SuperSU through TWRP.

Since then, /sdcard seems to be acting like its mounted as read only. I cannot seem to get anything written to it. I’ve tried to adb push files to /sdcard, but I keep getting the same “Permission denied” error. Taking screenshots don’t work either, I get a “Couldn’t capture screenshot” error. And I’ve also noticed the Twitter app is unable to display profile pictures nor pictures inside of tweets.

I’ve tried numerous things, but I’m stumped.

I’ve tried to see if its mounted as read only. Via adb shell, and su to get root, and mount to view the mounted file systems. Everything dealing with /sdcard, /storage/emulated/legacy, and /data/media are all mounted as rw (Read & Write, of course).

Remounting them doesn’t produce any errors, but has no effect.

The file system for /sdcard seems to be just fine, as I can adb shell in, and use ls /sdcard/, from either regular shell or root. And via TWRP, it was able to successfully save a recovery.log to the /sdcard/ file system, indicating nothing should be preventing things from being written to the file system.

I am also unable to copy files to it via Windows, it tells me “Cannot copy [file name] … The device has either stopped responding or has been disconnected”, and OS X still doesn’t seem to recognize it at all despite installing drivers from Motorola, which has happened before I rooted it.

What I found particularly weird is that I can download and install apps still. I installed a root checker app just after rooting it, and it worked, and I wanted to screenshot it, and then I noticed the issues happening.

And I’ve even tried a free app from Google Play which uses SuperUser permissions and attempts to fix the sdcard file system and make it mount right. Still, I am unable to write anything to it.

I’ve also tried to see if restarting adbd as root via the ‘adb root’ command would work, only to be disappointed because it doesn’t work on production phones, despite my phone already being rooted.

I’m pretty new to android in general, including rooting, but I’ve definitely gotten a good feel for how it works, when I installed 5.0.1 onto it a few days ago (It came with 4.4.4 and didn’t have an OTA update yet). But now I’m really confused about why this happened after I rooted, and after a bunch of googling to find nothing helpful, I have to ask here.

Any suggestions?

Edit: Just to be clear, Settings also reports I have 2.4 GB available space, and the file I am trying to copy over is far less than that.

Application focusing issues – Can’t focus on other applications

If I open Chrome and then do a CTRLALTT to open a terminal, and I start typing in the terminal, I can no longer click out of the terminal to the Chrome page. No matter where I click or how many times I click ALTTAB, it won’t work until I hit ALTF4 from the terminal.

That isn’t the only way I can get it to happen, but it’s the most consistent way of reproducing it.

This is really annoying me and I can’t figure it out for the life of me. I’ve tried editing all the raise window things and mouse settings, just about everything you can think of. I also tried compiz --replace and unity --replace which do nothing.

I am using Ubuntu 18.04.1 LTS, it’s basically just been installed other than a few aesthetic changes and all that I’ve done to try and fix this stupid problem.

Please help me, I don’t want to have to go back to windows 🙁

Application focusing issues, can’t focus on something else when focused on terminal

If I open chrome. Then do a Ctrl+Alt+T, opening a terminal and I start typing in the terminal, I can no longer click out of the terminal to the chrome page. No matter where I click or how many times I alt tab, it won’t work until I Alt-F4 from the terminal.

This is really annoying me and I can’t figure it out for the life of me. I’ve tried editing all the raise window things and mouse settings, just about everything you can think of. I also tried compiz --replace and unity --replace which do nothing.

Please help me. I don’t want to have to go back to windows 🙁

Craft CLI RC1 Connectivity Issues with MAMP Pro

I’ve been trying to run the new Craft CLI for the last couple of versions without any success. I figured maybe since we weren’t at RC1 yet that it wasn’t fully working. After seeing Ryan’s video about it at https://mijingo.com/lessons/craft-3-command-line/ I realized that wasn’t the case (and with RC1 being released today).

I am using MAMP Pro (like Ryan does in his video), but I have it using the standard MySQL port at 3306. I also have PHP 7.1 installed at the terminal through homebrew and pdo_mysql is a compiled in module. I am also using RC1.

Interestingly, if I use localhost I get a completely different message than if I use 127.0.0.1. But regardless, both still fail.

Which database driver are you using? [mysql,pgsql,?]: mysql
Database server name or IP address: [localhost] localhost
Database port: [3306] 3306
Database username: [root] root
Database password:
Database name: craft3
Database table prefix:
Testing database credentials... failed: SQLSTATE[HY000] [2002] No such file or directory

Which database driver are you using? [mysql,pgsql,?]: mysql
Database server name or IP address: [localhost] 127.0.0.1
Database port: [3306] 3306
Database username: [root] root
Database password:
Database name: [craft3] craft3
Database table prefix:
Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused

If I create the database manually and put the credentials into my .env file everything connects just fine without any issue. Is there something else I should be considering?

Dual pressure switch / dual pressure tank issues

I have an Airaider ez radon bubbler right after a filter and my pressure tank / pressure switch for my well.

The radon bubbler has its own pump and pressure switch.

After the radon bubbler is a very small pressure tank.

I have low water pressure on the second floor at one shower head.

The well pump is set to 30/50 however the radon bubbler system is set to 40/60.

The radon bubbler pump faulted out due to overheating.
I cleaned the tank and it seemed to work ok for 48 hours

Should I try to replace the small 101 model pressure tank with a larger unit?

Also if the bubbler is set to 40/60 , should I replace the well pump pressure switch with a 40/60 model?

I noticed that when I bypass the radon bubbler my
water stops while taking a shower etc.

The well pump pressure switch goes to zero and then
slowly raises , the second smaller pressure tank
is not bypassed when the radon bubbler is valved off but there is no pressure gauge before or after it anywhere else on the supply line.

If small tank is set properly for a 40/60 pressure switch is it causing the issue with my well pump not kicking on in time ?

Thanks in advance. I can upload pictures if it helps. I would like to solve the well pump issue first then try to get the bubbler back on line.

Rescaling and Image Padding Issues with GraphicsRow

I am trying to get a row of plots (which include legends and labels) using GraphicsRow, with vertical heights of the plots equal. I manually set the size and image padding of these plots so that the plots take up the same vertical space

verticalSize = 250;
p1 = Plot[Evaluate@Table[Cos[n x], {n, 1, 4}], {x, 0, 2 Pi}, 
           Frame -> True, RotateLabel -> False, PlotRange -> All, 
           PlotLegends -> 
           Placed [Map[StringReplace["n= x", "x" -> ToString[#, InputForm]] &,
           Table[n, {n, 1, 4}]], {Scaled[{0, 1}], {-0.1, 1.01}}], 
           Epilog -> Inset[Text[Style["(a)", 16]],
           ImageScaled[{0.9, 0.9}], Alignment -> Center], 
           ImageSize -> {Automatic, verticalSize}, 
           ImagePadding -> {{Automatic, Automatic}, {35, 4}}]

 p2 = Plot[Evaluate@Table[(1/([Sigma] Sqrt[
            2 Pi])) Exp[-0.5 (x/[Sigma])^2], {[Sigma], 1, 4}], {x,-10, 10},Frame -> True, 
        FrameLabel -> 
{"x", "[LeftBracketingBar]!(*SubscriptBox[(
[CapitalPsi]), 
(0)])(x; [Sigma])!(*SuperscriptBox[([RightBracketingBar]), 
(2)])"},                                       
            RotateLabel -> False, PlotRange -> All, 
            PlotLegends -> 
            Placed [Map[
            StringReplace["[Sigma]= x", "x" -> ToString[#, InputForm]] &, 
            Table[n, {n, 1, 4}]], {Scaled[{0, 1}], {-0.1, 1.01}}],
            Epilog -> 
            Inset[Text[Style["(b)", 16]], ImageScaled[{0.9, 0.9}], 
            Alignment -> Center], ImageSize -> {Automatic, verticalSize}, 
            ImagePadding -> {{Automatic, Automatic}, {35, 4}}]

This produces plots

Mathematica graphics

Ideally, I want to see these exact images at the size I see in the output cell side-by-side in one graphic. However, when I come to using Graphics Row, the output shows that the overall image size and the image padding have been altered

Mathematica graphics