Learning More Windows 10 Stuff

My last post talked about using xcopy to copy a bunch of files from one server to another. I had been running this for a day, but a couple of times the command failed with the error "Insufficient Memory". Since my new server has four times as much memory and three or four times as much disk space, I didn't think that error was actually true. A quick google search shows that this message usually comes up when filenames are over 255 characters long, which was going to be a problem for me. Instead, robocopy (robust copy) should be used. The command I'm now trying is:

robocopy U:\ F:\data /MIR /Z /XA:H /W:10

/MIR = specifies that robocopy should mirror the source directory and the destination directory. Beware that this may delete files at the destination
/Z = ensures robocopy can resume the transfer of a large file in mid-file instead of restarting
/XA:H = makes robocopy ignore hidden files, which is usually system stuff that we don't care about
/W:10 = reduces the wait time between failures to 10 seconds instead of the 30 second default

Windows 10 – More Stuff I Didn’t Know

I'm installing a new Windows 10 computer in our office to replace the old Windows XP one. All this computer is going to do is host our shared windows disk. Not a lot of people use this disk, but it's really good for sharing files or if a student is going to work at different computers in the lab.

I have about 1tb of data on the old XP computer that I want to copy to the new Windows 10 computer. And I'd like to keep permissions, ownership, etc. of all the files. I googled around and found that xcopy is the command that I want. Specifically, something like this:

xcopy s:\sw f:\sw /O /X /E /H /K

I started windows powershell and tried to run this as me, since my account is a domain administrator. That didn't work. I always got access denied errors. So I tried to start powershell as administrator. Here, I couldn't "see" the s: drive, which was a mapped drive. I even tried logging in as a local computer account and then manually mounting the s: drive. Powershell would not see the drive mounted that way.

The solution was to login with my local administrator account. Then start windows powershell as administrator. The in powershell, run net use s: \\XPcomputer\sw, where I'd be prompted for my login credentials on our samba/ldap domain. Then, I could run:

xcopy s:\* f:\sw /O /X /E /H /K

What I found interesting is that after I did the net use command, I couldn't see the S: drive if I went to "This PC" even though it was currently copying from the S: drive. The screenshot below shows this. I found this weird. This may also have been true in earlier versions of windows, but I had never come across this before.

Windows 10 in My Samba PDC

I had recently installed windows 10 on one of our computers at work. I was able to successfully add it to the domain, but then none of my users could login. The error message was:

We can't sign you in with this credential because your domain isn't available.  Make sure your device is 
connected to your organization's network and try again.  If you previously signed in on this device with 
another credential, you can sign in with that credential.

This error message contains pretty much no information about the problem. The domain is/was available, as I was able to join it. After some looking around, I found that the problem is I missed a setting in my smb.conf file on my samba server. I needed to add this line for windows 10 computers:

server max protocol = NT1

Restart samba and things worked fine.

Note, this page gives you all the required settings for samba domains. Since I have been using the same smb.conf file for years, I didn't have the line needed because it's a more recent addition.

Time for Change

On October 29, 2013, I bought unlocked iphone 5s for $689.56 plus $99 more for AppleCare. The phone works ok, but the battery wasn't lasting very long. If I listed to music and tracked my ride to work and then went to the gym after work, it wouldn't last through a short workout. That seemed pretty short to me, so I bought a new battery from ifixit to replace it. I put it in this morning. First of all, it was a royal pain to take the old battery out because it was basically glued into place with sticky strips. I had to just continually pry around the battery to get it unglued. And while I was prying, I know I cracked some plastic stuff. As far as I could tell, I got everything back together. However, when I turned the phone back on, I got a message that touch id didn't work and the speaker wasn't working either. I don't use touch id at all, so I don't care about that. The speaker is a bigger deal. I don't know why it doesn't work. I've taken the phone apart three more times to check all the connections and it still doesn't work. Most importantly, the phone will no longer take a charge. So it's basically junk because the battery is now dead. I find this incredibly annoying. I should not break my phone by just changing the battery. I'm done with Apple because this is bs. I'm basically paying $200/year for my phone, not including the service. This to me, is ridiculous. So I'm looking for a new phone. And the primary feature that I'm looking for is repairability. Here's the list I'm looking at:

iFixit Repairability List

I'm looking at phones that have come out since 2016 or later only because it'll be hard to get parts for the older models. So right now, I'm looking at an LG G5, which has a score of 8. (Ironically, the newer G6 drops to a rating of 5.)

On the plus side, I now don't have to deal with a phone for a while, which is mildly relaxing.

New Speaker

I bought this speaker yesterday to give to my Mom.

I bought the speaker because my Mom wants to listen to my brother's podcast, but her ipad doesn't get loud enough for her to hear. My brother bought the JBL - Xtreme Portable Bluetooth Speaker and recommended that I buy it for my Mom, which was my intention. However, when I got to Best Buy, I found it cost $300, which was a lot more than what I wanted to spend. Instead I found the one above, which I bought for basically $100. I charged it last night and have been listening to it and it should work fine. But I'm not crazy about this speaker.

I understand that this is entirely a portable speaker, so it runs on a battery. The battery is recharged using a usb cable. So periodically, you need to plug it in to your laptop. When I was looking at these in the store, a guy came up to me and started talking about these speakers. He said that the usb cord only charges the battery. So if your battery is dead, you can't just plug this in to your laptop and use it. You have to wait for the battery to charge. And in a year or two, when the battery no longer takes a charge, the speaker will be garbage because there's no other way to run it. I'm not sure if he's right, but he said that he has the jbl one that my brother has and had wished that he knew that before he bought it. If that is true, and I'm leaning to believe that, it's really poor design. So I was looking for something that I could just plug in to use. I get that it means it wouldn't be portable at that point, but at least it would be usable if the battery died.

Then I started to think about how I'd use the speaker and I realized that for me, portability isn't that big of a deal. But I like the idea of connecting via bluetooth. I mainly have Apple products and I have an airport express that is connected to my stereo to use, so I could play sound via that. But, it limits me to Apple products, like iTunes. I listed to lots of podcasts and I'd like to be able to play them on my bluetooth speaker. And I could use iTunes for my podcasts, but I like using Clementine. And I'll be honest, part of this is that I want to move away from Apple products. This could be an entirely different post, but Apple is moving in a direction that I don't necessarily want to go. As an example, they've taken most built-in connections off of their laptops. You get a single usb-c connection. Then you have to spend even more to buy all these dongles to do things that used to be built-in. I still use my ethernet connection a lot. I'm a system administrator and have to check if jacks are live or not. I also use usb a lot. I really don't want to have to carry a handful of dongles everytime I go to someone's office to check things. Right now, I need to be able to support Apple, Windows and linux. My macbook pro has been great in that I can run virtual machines with each of those operating systems, so I check things in all of those. The one improvement that I would like from Apple would be to be able to get more ram to make my virtual machines run better. I've upgraded my macbook pro from 2012 to 16gb of ram. Five years later and that's still the most I can get. In fact, I bought a new (to me) macbook pro from Apple's clearance section because it still had usb connections. It doesn't have the network one, but Apple has definitely given up on that port. In my mind, I'm thinking this is probably the last laptop I'll be buying that I'll use at work. Once I'm not longer working, I can use whatever OS I want and these days I'm leaning toward linux. And so I've been looking at programs that I want to use that run on linux. That's how I found Clementine and it's worked fine for me. So getting off this tangent I just took, I like the idea of a bluetooth speaker because it doesn't care what the OS is.

I haven't been able to find a bluetooth speaker that I like, so my idea now is to build what I like. I like the YouTube channel Kirby Meets Audio and I actually bought some plans from him. It looks like a fun project and I think it would be exactly what I want. We'll see how it goes.

RHEL7 Kickstart

Now that I'm in a place where all ip addresses are handled by dhcp, I need to change how I do kickstart installs.

  1. Boot the new system and start the installation process. Be sure to note what the name of the network card is and the mac address of the network card. Example: enp7s0f0 and 00:25:ab:cd:ef:aa
  2. Manually register the mac address with our dhcp system.
  3. Create a kickstart file and put it on a website.
  4. Boot the system and enter this on the boot line:
    vmlinuz initrd=initrd.img inst.ks=http://www.example.com/ks/server.cfg ip=enp7s0f0:dhcp inst.noverifyssl

If the install fails and you get a python error that near the end says something like:
"xfs filesystem is not valid as a default fs type"

It likely means the disk you're booting from is not the same version as the os you're downloading. Look in your kickstart file for the url line. It should look something like this:

url --noverifyssl --url=https://rhn01.example.com/pub/build/7

Put that link in your browser and look at the file media.repo. Mine looks like this:

name=Red Hat Enterprise Linux 7.2

This is telling me that it's expecting the boot disk to be redhat 7.2. So make sure you're using the correct install disk.

Season Over

Today, I finished pulling up all my tomato and pepper plants. I also took down the old chickenwire fence I had around my raised bed. And I filled five grass clipping bags full of plants and weeds that I pulled. I had thought of trying to make my own compost pile. But I found out that the city will pick up the paper bags and I can pick up as much free mulch as I can carry from a city building not too far from my house. So this year at least, I've decided not to do any composting. I may change my mind in the future.

How did the season go? I had lots of tomatoes. A success. I had a pretty good turnout of mini red peppers. A success. I also got some type of hot green pepper that I didn't plant. A success. Lots of beans. A success. A couple of zucchini after which the plants died. So that's probably more of a failure. I now know zucchini plants need a lot more space. Next year, I think I'll plant them by themselves on the back of the house. This year, the pumpkin vine was there. It grew a ton, but I only got one pumpkin. That's a failure. I found one cucumber somewhere in the raised bed. And it was such an odd shape that I didn't realize it was a cucumber. That was a failure. Tons of flowers by the garage, so that was a success.

Yesterday, I cut off most of the grapevine and moved it to where the beans were. I never thought it was going to grow, so I didn't put any thought where I planted it. Now if it grows, I'll try to get it to go up the garage. I now have some space next to the garage. Ideally, I'd like to build a greenhouse there. When I run new power lines to the garage, I can put an outlet near there so that I could plug in some kind of electric heater and an arduino to control it. That would be a very fun project. I've been thinking of designs where basically I extend the roof of the garage down with windows and then put windows all around. I'd have to build some type of door or access, but I think it would be possible.

What have I learned? I put way too many plants in my large raised bed. Zucchini need lots of space. They got so big that they blocked the sun of some of the other plants. I got a couple of really big zucchini and then the plants just seemed to die. I'm not sure what happened. Next year, I think the zucchini will go by the house by themselves. They'll have lots of room there. The miniature red peppers were good, but some were ridiculously tiny. Cutting them up and pulling out the seeds was a pain, but they were good. I'd like it better if they got a little bigger, but I'm not sure such a thing exists. So I'll plant those again next year. I wasn't crazy about the beans, but I think it's because I waited too long to pick them. I read somewhere they're tastier if you pick them before you see the shape of the seeds inside. I thought you were supposed to wait until you saw the seeds, so I definitely waited too long. I'll try those again next year. The Jack and the Beanstalk story is much funnier now. Beans do go really fast. And they climb up anything. It's kind of cool. Think I'll pass on watermelon again because I only got two. They were small and I never even cut them. They just didn't look that good. I'll probably also pass on the pumpkin. They grew like crazy, but I only got one. So I just don't think I have the space for them. I like the lettuce a lot and have already planted some more in the fall. I put some in the smaller raised beds and have a glass window on them. I'm hoping to still get some more lettuce before it gets really cold.

The biggest lesson is that I enjoy gardening. And the more I read about food, the more I want to be able to grow more of what I eat. I also like the idea of building a greenhouse. It seems like a good challenge.

My Latest Obsession

In my second summer of gardening, I'm thoroughly enjoying it. This year, in addition to tomatoes and peppers. Ted also gave me some beans, watermelon and pumpkin. And I also had zucchini. The pumpkin was weird. The vine grew like crazy all over the back of my house, but then died for some reason. I ended up getting one pumpkin, about the size of a 16" softball. It was green when I picked it, but as it's been sitting on my counter, it's turning more orange. I picked one small watermelon and there are a couple more still growing. I haven't yet cut it open to see how it looks or how it tastes. The tomatoes have been reliable. I planted some miniature red peppers and I like eating those the best. There are a lot of green ones out there now, so I think they tend to come a little later in the season than the tomatoes. I got a few good size zucchini. However, after I picked them, the plants seemed to die. Since I think I planted them too close together, I ended up pulling them out last month.

Now however, I'm thinking about what's next. I had a bunch of lettuce plants in one of my boxes. After it got hot, I noticed that the lettuce tasted pretty bitter. So I was mainly letting them grow to get the seeds, which I ended up not harvesting. Oh well. But in their place, I planted some green onions. They went in the ground on Labor Day. Yes, that seems pretty late for planting, but I feel like we're getting longer growing seasons now. The past winter wasn't really that bad and this summer didn't get blazingly hot. Of course, this is just my own judgement. I haven't consulted any tables of temps in Chicago. But it seems like climate change is starting to affect things. With the hurricanes this year and crazy high temperatures in San Francisco, I think we've reached a tipping point. So, if our winters aren't as cold, perhaps we'll have a longer growing season. Again, I haven't quantified any of this, but I'm planting now because I feel like it's a good idea. Today, I also moved some pea plants and lettuce outside. We'll see if those take.

So, my latest obsession is to try to garden year round. Now I don't think that we won't get any snow, but I feel that it might be workable for growing. I need to build a greenhouse of some sort. I tried a cold frame last year, but that didn't really work with my simple box and plastic window on top. I think if I were to use two pieces of glass (my own double-pane window) and perhaps put some thermal mass inside the greenhouse to collect the heat during the day and distribute it at night...I may be able to grow stuff year round. I've been spending most of the afternoon looking stuff up to see how I might do this. And it's another crazy idea, that I totally would like to try.

Merge Three Files into One Using Command Line

I have three pdf files that I want to merge into a single file. But I don't want the three files to be on three separate pages. I want one big page with the three files all there.

First, get the sizes of my files:

$ identify PusherDisc32017.pdf 
PusherDisc32017.pdf PDF 1224x792 1224x792+0+0 16-bit sRGB 58413B 0.000u 0:00.000
$ identify PressBlockShort32017.pdf 
PressBlockShort32017.pdf PDF 1224x792 1224x792+0+0 16-bit sRGB 51523B 0.010u 0:00.000
$ identify LongPressBlock32117.pdf 
LongPressBlock32117.pdf PDF 1224x792 1224x792+0+0 16-bit sRGB 49860B 0.000u 0:00.000

So I want my final image to be 1224 x (3x792) or 1224 x 2376. Now make an empty image that size. I'm using a white background.

convert -size 1224x2376 canvas:white hold.png

Now, one at a time, merge the files together:

$ composite PusherDisc32017.pdf hold.png out1.png
$ composite PressBlockShort32017.pdf -gravity center out1.png  out2.png
$ composite  LongPressBlock32117.pdf -gravity south  out2.png  out3.png

Now my file out3.png has what I want.

Problems with mp4 files in Firefox

We had some students who took a video with their phone and wanted to post it on an html page. The html code we used was:

In Chrome, this worked fine. But in Firefox, it would show like this.

When that happened, I went to Tools -> Web Developer -> Browser Console. I got a message like this:

HTTP "Content-Type" of "video/3gpp" is not supported.  Load of media resource http://www.example.com/Robot.3gp failed.

This message was strange because I wasn't posting a file called Robot.3gp, but one called Robot.mp4. So on my server, I checked the file.

$ file Robot.mp4
Robot.mp4: ISO Media, MPEG v4 system, 3GPP 

So whatever created this file, actually made a 3gpp file and not a legit mp4. However, I found that you can convert a 3gpp file to mp4 using ffmpeg. I renamed my Robot.mp4 file to Robot.3gp and then converted it.

$ ffmpeg -i Robot.3gp -ab 64k -ar 44100 -strict -2 Robot.mp4
ffmpeg version 2.8.12 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Robot.3gp':
    major_brand     : 3gp5
    minor_version   : 0
    compatible_brands: 3gp5isom
    creation_time   : 2017-07-26 17:45:04
  Duration: 00:00:20.23, start: 0.000000, bitrate: 5135 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m), 720x480, 5005 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
      rotate          : 90
      creation_time   : 2017-07-26 17:45:04
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s (default)
      creation_time   : 2017-07-26 17:45:04
[libx264 @ 0x1e6d1e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x1e6d1e0] profile High, level 3.0
[libx264 @ 0x1e6d1e0] 264 - core 148 r2699 a5e06b9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'Robot.mp4':
    major_brand     : 3gp5
    minor_version   : 0
    compatible_brands: 3gp5isom
    encoder         : Lavf56.40.101
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 480x720, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
      creation_time   : 2017-07-26 17:45:04
      encoder         : Lavc56.60.100 libx264
    Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 64 kb/s (default)
      creation_time   : 2017-07-26 17:45:04
      encoder         : Lavc56.60.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame=  607 fps=178 q=-1.0 Lsize=    1593kB time=00:00:20.22 bitrate= 645.1kbits/s    
video:1408kB audio:162kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.439324%
[libx264 @ 0x1e6d1e0] frame I:4     Avg QP:19.34  size:  9992
[libx264 @ 0x1e6d1e0] frame P:171   Avg QP:22.56  size:  4317
[libx264 @ 0x1e6d1e0] frame B:432   Avg QP:24.06  size:  1534
[libx264 @ 0x1e6d1e0] consecutive B-frames:  3.3%  2.6%  8.4% 85.7%
[libx264 @ 0x1e6d1e0] mb I  I16..4: 28.5% 58.4% 13.1%
[libx264 @ 0x1e6d1e0] mb P  I16..4:  4.2%  9.2%  1.8%  P16..4: 37.9%  7.7%  5.0%  0.0%  0.0%    skip:34.2%
[libx264 @ 0x1e6d1e0] mb B  I16..4:  0.3%  0.5%  0.1%  B16..8: 42.5%  2.7%  0.4%  direct: 1.4%  skip:52.2%  L0:48.5% L1:48.6% BI: 2.9%
[libx264 @ 0x1e6d1e0] 8x8 transform intra:59.6% inter:80.2%
[libx264 @ 0x1e6d1e0] coded y,uvDC,uvAC intra: 32.2% 41.0% 4.4% inter: 7.5% 10.5% 0.3%
[libx264 @ 0x1e6d1e0] i16 v,h,dc,p: 33% 24% 26% 18%
[libx264 @ 0x1e6d1e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 45%  3%  9%  3%  9%  2%  3%
[libx264 @ 0x1e6d1e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 14% 27%  3% 18%  4% 16%  2%  3%
[libx264 @ 0x1e6d1e0] i8c dc,h,v,p: 61% 18% 20%  1%
[libx264 @ 0x1e6d1e0] Weighted P-Frames: Y:2.3% UV:0.0%
[libx264 @ 0x1e6d1e0] ref P L0: 56.2% 10.7% 21.3% 11.6%  0.1%
[libx264 @ 0x1e6d1e0] ref B L0: 84.3% 11.6%  4.1%
[libx264 @ 0x1e6d1e0] ref B L1: 94.4%  5.6%
[libx264 @ 0x1e6d1e0] kb/s:569.65
$ ll Robot*
-rwxr--r-- 1 hep html 12988147 Jul 27 12:53 Robot.3gp
-rw-rw-r-- 1 hep html  1630980 Jul 27 13:43 Robot.mp4
$ file Robot.3gp
Robot.3gp: ISO Media, MPEG v4 system, 3GPP
file Robot.mp4
Robot.mp4: ISO Media, MPEG v4 system, version 1

Now the Robot.mp4 file plays in Firefox without a problem.