I'm updating the prices to help a brand new cordcutter. Starred prices are not yet updated.
| Philo | Sling TV | Hulu | You Tube | Fubo | DirecTV | |||||
| no local | no local | with ads | no ads | TV | Pro | Elite | Ent | Ch | Ult | Prem |
| 28 | 61 | 83 | 96 | 83 | 85 | 95 | 85 | 80 | 110 | 155 |
My thoughts on food, technology, politics, running and... nope, those are the only thoughts I've got!
I'm updating the prices to help a brand new cordcutter. Starred prices are not yet updated.
| Philo | Sling TV | Hulu | You Tube | Fubo | DirecTV | |||||
| no local | no local | with ads | no ads | TV | Pro | Elite | Ent | Ch | Ult | Prem |
| 28 | 61 | 83 | 96 | 83 | 85 | 95 | 85 | 80 | 110 | 155 |
(Updated 2/22/25)
If you're like me, you're going through every old Macintosh Toolbox programming book you can find and typing the code into THINK C to see what will happen. No? OK then.
If you're still here, maybe you've picked up Using the Macintosh Toolbox with C (2nd Edition) by Fred A Huxham, David Burnard, Jim Takatsuka.
And maybe everything in their book works perfectly well for you, but for me, and no shade to these fine authors, there are few tweaks I had to me.
On page 432, in the main() event loop, in the keyDown case, keyCodeMask is 0xff00, so c ends up being zero. If you change it to charCodeMask, which = 0xff, you'll get a valid result you can pass to MenuKey.
On page 435 *in both the rename and delete procedures* PBFlshVol should have a "u" in it.
On page 436, in the file info procedure, PBGetVolInfo should just be PBGetVInfo.
Do you wish you could turn off social media during Shabbat? Here's how I did it on my iOS devices:
1. Go to Settings → Screen Time; scroll to the bottom and turn on Share Across Devices; do this on all your devices before you set up your allowed-apps list.
2. In Settings → Screen Time, under Limit, tap Always Allowed and add the apps you will allow to run during Shabbat. I'm including my list as a guide/reference: Phone, Messages, FaceTime, Maps, App Store, Authenticator, Blink, Boston Globe, Calculator, Calendar, Camera, Docs, Drive, Find Devices, Find Items, Find People, Fitbit, Flo by Moen, Google Translate, Kindle, Lowell Sun e-Edition, Merlin Bird ID, Music, New Hampshire Union Leader, Notes, NYTimes, Overcast, Photos, Podcasts, Reminders, Sefaria, Sheets, Strava, Tasks, Venmo, Voice Memos, Wash Post, Weather, Workout, YouTube.
3. In Settings → Screen Time, under Limit, tap Downtime. Tap Customize Days. Turn all days off. Then turn on Friday from 6-ish pm to 12 am and Saturday from 12 am to 9-ish pm. Again, this is just an example.
You'll still be able to run apps you forgot to include, but to me it felt much nicer not having to press that button. Go back to Settings and add them.
One thing I didn't figure out was how best to use the browser. There were a couple times I needed to look something up, and I would have preferred white-listing certain sites to pressing the override button. Let me know if you know a good way to do this.
I should have done a better job keeping track of the memory that came installed in the Power Macs I recently bought.
Mac #1 is a 7100/66, it has four SIMM slots.
Mac #2 is a 6214CD with two SIMM slots.
I also bought 4 32MB SIMMs I figured I would split between the two new Macs.
So Mac #1 now has 64 MB plus two 8 MB that were leftovers, for a total of 80 MB. There must have been two SIMMs that were leftover, size unknown.
And Mac #2 now has 64 MB total. The sizes of its two leftovers are also unknown.
Let's see if we can figure out the size of those four SIMMs.
Or six. You see, there were a bunch of SIMMs in a shoe box, also of unknown size. I'd swear there were three, so maybe the 7100 only had one leftover? Who knows.
Here's the log of my analysis:
| SIMM # | How many? | Total inc one 32 MB simm | Size of this SIMM |
|---|---|---|---|
| 1 | 2 | 40,960 KB | 8 MB |
| 2 | 2 | 40,960 KB | 8 MB |
| 3 | 1 | 49,152 KB | 16 MB |
| 4 | 1 | 49,152 KB | 16 MB |
So the result is that I should have measured all of the memory before I re-cabled the 7100, which is a huge pain in the butt. But replacing 16 MB with 32 MB will give me a total of 96 MB in that system, which will be well worth the effort.
And I'd say MARCHintosh Day #1 was a success!
Back in the day, you could find my recipe for Sherry Noodle Soup on dave-net.com. Well that old domain is long gone. And sadly, I don't think you can even find it on The Wayback Machine!
But I found it on a hard drive and decided to cook up a batch. But nah, that recipe needed a little tweak here and there. So without further ado, here's version two...
This latest rewrite represents a simple change that made a huge difference. Cut up the chicken and mushrooms and let them marinate in the sherry. Mwah!!
Ingredients:
Combine meaty bones and water in a large pot. Bring to boil and then simmer for an hour or so.
Remove everything from the broth. Salvage whatever meat you can from the bones. Discard the bones and other yucky stuff. Set aside two cups of meat for later. The rest will make a nice sandwich! you can give to your dog!
Strain the broth. If you like, you can let it cool and skim the fat off the top.
Combine the chicken meat (diced) with the mushrooms and sherry. Let this marinate in the refrigerator until about 30 minutes before dinnertime.
Combine the broth, optional salt and herbs, and the vegetables. Bring it all to a boil and then simmer for 30 minutes, or until the carrots are al dente.
Add the sherry/mushrooms/chicken mixture and simmer for about 20 minutes.
Add the pasta or rice to each bowl as you serve it. Maybe set it out buffet style?
Enjoy!!
Funny how two posts ago I was having trouble with font size in Emacs. The other day, I don't know what I did, I don't have a cat I can blame for walking across the keyboard, but I made the JDeveloper font size SO SMALL, I could barely see it. OK, it was like 7-8 point - still, VERY SMALL!!
So I did what you do, I quit JDev. Then today when I started it up, oh damn, I never did solve the font size thing. Clearly there is some keystroke that makes fonts smaller. I know there is, because I fell into a big bucket of that.
What I did find, though, is if you go to Tools -> Preferences and just search for "font" it's under Code Editor. I made it SO BIG, it's now a pleasure to use!!
There's nothing wrong with getting older that changing your font size won't fix!!
🙂
Boy was this annoying:
Every time I'd make a big selection, I'd end up force-clicking and something odd and magical would happen. Don't need that. Don't want that. Gone.
Let me tell you a long story about... yeah, no.
Go to System Preferences. Tap Trackpad. Uncheck the box. Or check it. It's your Mac.
Emacs (on Mac OS) font size kept changing on me. I finally figured out what was causing it.
CTRL-OPT + two-finger swipe up/down
And the status line, where it shows the file type, actually shows +1, +2, etc when the font size increases by one or two steps, etc.
This was driving me crazy. I'm going to blame this, like everything else, on the enormous trackpad.
I don't usually just post links off to other sites, but here's one that
a) I don't want to forget and
b) the world needs to know about.
https://blog.winsmith.de/english/ios/2020/04/14/xcuitest-screenshots.html
It's been a while since I published an app to the App Store and either
a) something has changed or
b) I've forgotten what a pain it is to have to collect all the screenshots you need to include with your app submission.
And I've heard there is a service you could use, and I'm all for hiring experts to do difficult things, but why should that be necessary? Is this really that hard? No, it's really not.
But I should let you find out from Daniel Jilg. I took the script he posted and needed to make a few changes to suit my environment.
And it works great! It generated all the screenshots I need for the App Store! Thanks, Daniel!
I have two Logitech K400R wireless keyboards. Let's call them Fred and Barney. They're great. Each has a tiny USB thingy - dongle makes me think there's some kind of wire. It's just a tiny little thing that plugs into USB. Turns out it's a Unifying Receiver. I'll come back to that.
In my case, I'm only able to put my hands on Keyboard Fred and Receiver Barney. The other keyboard and the other receiver are probably on vacation somewhere. So I've got this mismatched set. Plugged in the receiver and turned on the keyboard and... nothing.
Well I googled and discovered there's software for the Unifying Receiver. Don't know how that could possibly solve my problem, but I download and install it.
(You'll find it here: https://www.logitech.com/en-us/manuals/11916)
To make a longish story shorter, when you plug in the Unifying Receiver (oh and it might even be from yet another Logitech device) and turn on the K400R, it will detect that keyboard and set up a connection. My mismatched Fred Keyboard and Barney Receiver are working great!
Thanks, Logitech!!
Update (29 July 2022) this appears to be out of date - NESN, for example, is not on YouTube TV, but might be on DirecTV - not sure. I'll update this soon.
All the wordy nonsense is at the bottom of the post.
| Service (Level) $$/month | Philo | Sling TV | Hulu | You Tube | Fubo | DirecTV | ||||
| Live TV | TV | Startr | Elite | Ent | Ch | Ult | Prem | |||
| 25 | 50 | 65 | 65 | 65 | 80 | 70 | 85 | 95 | 140 | |
| Local Channels | * | * | * | * | * | * | * | |||
| A&E | * | * | * | * | * | * | * | |||
| ABC News Live | * | * | * | |||||||
| ACC Network | * | * | * | * | * | * | ||||
| AccuWeather | * | * | * | * | * | * | * | |||
| ActionMAX | * | |||||||||
| AMC | * | * | * | * | * | * | * | * | * | |
| American Heroes | * | * | * | * | ||||||
| Animal Planet | * | * | * | * | * | * | * | * | * | |
| Aspire | * | * | * | |||||||
| AWE | * | * | * | |||||||
| AXS TV | * | * | * | * | * | * | ||||
| Baby First HD | * | * | * | * | ||||||
| BBC America | * | * | * | * | * | * | * | * | * | |
| BBC World News | * | * | * | * | * | |||||
| BET | * | * | * | * | * | * | * | * | * | |
| BET Her | * | * | * | * | ||||||
| BET Jams | * | |||||||||
| BET Soul | * | |||||||||
| Big Ten Network | * | * | * | * | * | * | * | |||
| Black News | * | * | * | * | ||||||
| Bloomberg TV | * | * | * | * | * | * | ||||
| Boomerang | * | * | * | * | * | * | ||||
| Bravo | * | * | * | * | * | * | * | * | * | |
| Cartoon Network | * | * | * | * | * | * | * | |||
| CBSN | * | * | * | |||||||
| CBS Sports | * | * | * | * | * | * | ||||
| Cheddar Big News | * | |||||||||
| Cheddar Business | * | * | ||||||||
| Cheddar News | * | * | * | * | * | * | * | * | ||
| Cinemax East | * | |||||||||
| CleoTV | * | * | * | * | ||||||
| CMT | * | * | * | * | * | * | * | * | ||
| CNBC | * | * | * | * | * | * | * | * | ||
| CNBC World | * | * | * | * | * | |||||
| CNN | * | * | * | * | * | * | * | |||
| CNN En Español | * | * | * | * | ||||||
| CNNi | * | * | * | * | * | |||||
| Comedy Central | * | * | * | * | * | * | * | * | * | |
| Comedy TV | * | * | * | |||||||
| Comet | * | * | * | |||||||
| Cooking Channel | * | * | * | * | * | |||||
| Cozi TV | * | * | * | * | ||||||
| Crackle | * | |||||||||
| Crime + Investigation | * | |||||||||
| C-SPAN | * | * | * | * | ||||||
| C-SPAN2 | * | * | * | * | ||||||
| Curiosity Stream | * | |||||||||
| The CW | * | * | * | * | ||||||
| Destination America | * | * | * | * | ||||||
| Discovery | * | * | * | * | * | * | * | * | * | * |
| Discovery Family | * | * | * | * | ||||||
| Discovery Life | * | * | * | * | ||||||
| Disney Channel | * | * | * | * | * | * | * | * | * | |
| Disney Junior | * | * | * | * | * | * | * | * | ||
| Disney XD | * | * | * | * | * | * | * | * | ||
| DIY Network | * | * | * | * | ||||||
| DUST | * | |||||||||
| E! | * | * | * | * | * | * | * | * | * | |
| ESPN | * | * | * | * | * | * | * | * | * | |
| ESPN2 | * | * | * | * | * | * | * | * | * | |
| ESPN3 | * | |||||||||
| ESPNEWS | * | * | * | * | * | * | ||||
| ESPNU | * | * | * | * | * | * | ||||
| ESPN Bases Loaded | * | |||||||||
| ESPN College Extra | * | |||||||||
| ESPN Goal Line | * | |||||||||
| ESTRELLA | * | * | ||||||||
| FM | * | * | ||||||||
| Food Network | * | * | * | * | * | * | * | * | * | * |
| Fox Business Network | * | * | * | * | * | * | * | * | ||
| Fox News Channel | * | * | * | * | * | * | * | * | * | |
| FOX Sports 1 | * | * | * | * | * | * | * | * | * | |
| FOX Sports 2 | * | * | * | * | * | * | ||||
| Freeform | * | * | * | * | * | * | * | * | * | |
| Fuse | * | * | * | * | * | |||||
| FX | * | * | * | * | * | * | * | * | * | |
| FX Movie Channel | * | * | * | * | * | |||||
| FXX | * | * | * | * | * | * | * | * | ||
| fyi | * | * | * | |||||||
| GAC Family | * | * | ||||||||
| Galavision | * | * | * | * | * | * | ||||
| Game Show Network | * | * | * | * | * | |||||
| getTV | * | * | * | |||||||
| GINX eSports | * | |||||||||
| Golf Channel | * | * | * | * | * | * | ||||
| Great American Country | * | * | ||||||||
| Gusto | * | * | * | |||||||
| Hallmark Channel | * | * | * | * | * | * | * | |||
| Hallmark Drama | * | * | * | |||||||
| Hallmark Movies & Mysteries | * | * | * | * | * | |||||
| HBO East | * | |||||||||
| HBO 2 East | * | |||||||||
| HBO Family East | * | |||||||||
| HBO Latino | * | |||||||||
| HGTV | * | * | * | * | * | * | * | * | * | * |
| HISTORY Channel | * | * | * | * | * | * | * | |||
| HLN | * | * | * | * | * | * | * | |||
| HSN | * | * | * | * | ||||||
| IFC | * | * | * | * | * | * | * | * | * | |
| INSP | * | * | ||||||||
| Investigation Discovery | * | * | * | * | * | * | * | * | * | * |
| Justice Central | * | * | * | |||||||
| Law & Crime | * | * | ||||||||
| Lifetime | * | * | * | * | * | * | * | |||
| LMN | * | * | * | |||||||
| Local Now | * | * | * | * | ||||||
| Logo HD | * | * | * | * | ||||||
| MLB Game of the Week | * | |||||||||
| MLB Network | * | * | * | * | * | |||||
| Motor Trend | * | * | * | * | * | * | * | * | * | * |
| MSNBC | * | * | * | * | * | * | * | * | * | |
| MTV | * | * | * | * | * | * | * | * | ||
| MTV Classic | * | * | * | * | ||||||
| MTV Live | * | * | ||||||||
| MTV2 | * | * | * | * | * | * | ||||
| MTVU | * | |||||||||
| NASA TV | * | |||||||||
| Nat Geo WILD | * | * | * | * | * | |||||
| National Geographic | * | * | * | * | * | * | * | * | * | |
| NBA TV | * | * | * | * | * | |||||
| NBCLX | * | * | ||||||||
| NBC News NOW | * | * | ||||||||
| NBC Sports | * | * | * | * | * | * | * | * | * | |
| NBC Universo | * | * | * | * | * | |||||
| NECN | * | * | * | |||||||
| NESN | * | * | * | |||||||
| Newsy | * | |||||||||
| Newsmax HD | * | * | * | * | * | * | ||||
| NewsNation | * | * | * | * | * | |||||
| NFL Network | * | * | * | |||||||
| NHL Network | * | * | * | |||||||
| Nick Jr. | * | * | * | * | * | * | * | |||
| Nickelodeon East | * | * | * | * | * | * | * | * | ||
| NickMusic | * | |||||||||
| Nicktoons | * | * | * | * | * | |||||
| Olympic Channel | * | * | * | * | * | * | ||||
| One America News | * | * | * | * | ||||||
| Ovation | * | * | * | |||||||
| OWN | * | * | * | * | * | * | ||||
| Oxygen | * | * | * | * | * | * | ||||
| Pac-12 Network | * | |||||||||
| Paramount TV | * | * | * | * | * | * | * | * | ||
| PBS Kids | * | * | * | * | ||||||
| People TV | * | * | ||||||||
| pocket.watch | * | |||||||||
| POP | * | * | * | * | * | * | * | * | ||
| QVC | * | * | * | * | ||||||
| QVC 2 | * | * | * | * | ||||||
| Reelz | * | * | * | * | ||||||
| Revolt | * | * | * | * | * | |||||
| Revry | * | |||||||||
| RFD-TV | * | * | * | * | ||||||
| Ryan and Friends | * | |||||||||
| Science | * | * | * | * | * | |||||
| SEC Network | * | * | * | * | * | * | ||||
| Shop LC | * | * | * | * | ||||||
| SHOWTIME® East | * | |||||||||
| SHOWTIME 2® East | * | |||||||||
| SHOWTIME EXTREME® | * | |||||||||
| Smithsonian Channel | * | * | * | * | ||||||
| SNY | * | |||||||||
| Sony Movie Channel | * | |||||||||
| Sounders FC | * | |||||||||
| Stadium | * | * | ||||||||
| Start TV | * | |||||||||
| Sportsman Channel | * | * | ||||||||
| STARZ | * | |||||||||
| STARZ ENCORE... | * | * | ||||||||
| STARZ Kids & Family | * | |||||||||
| SundanceTV | * | * | * | * | * | * | * | * | ||
| Syfy | * | * | * | * | * | * | * | * | * | |
| Tastemade | * | * | * | * | * | * | * | |||
| TBS | * | * | * | * | * | * | * | |||
| TCM | * | * | * | * | * | * | ||||
| TeenNick | * | * | * | * | * | * | ||||
| Telemundo | * | * | * | * | + | + | + | + | ||
| Tennis Channel HD | * | * | * | * | * | |||||
| TLC | * | * | * | * | * | * | * | * | * | * |
| TNT | * | * | * | * | * | * | * | |||
| Travel Channel | * | * | * | * | * | * | * | * | * | |
| truTV | * | * | * | * | * | * | * | |||
| TUDN | * | * | * | * | ||||||
| TV Land | * | * | * | * | * | * | * | * | ||
| TV One | * | * | * | * | ||||||
| TVG | * | * | * | * | * | |||||
| TYT | * | |||||||||
| UniMás | * | * | * | * | * | * | ||||
| Universal Kids | * | * | * | * | * | * | ||||
| Univision East | * | * | * | * | * | * | ||||
| UPtv | * | * | * | * | ||||||
| USA Network | * | * | * | * | * | * | * | * | * | |
| VH1 | * | * | * | * | * | * | * | * | ||
| VICE | * | * | * | * | * | * | * | |||
| WE tv | * | * | * | * | * | * | * | * | ||
| Weather Channel | * | * | * | * | * | |||||
| HBO Max | + | + | + | * | ||||||
| Cinemax | + | + | + | * | ||||||
| Showtime | + | + | + | * | ||||||
| Starz | + | + | + | + | * | |||||
| Epix | + | * | + | + | + | + | ||||
| And More! | Originals | YouTube | Sports++ | Sports++ | ||||||
I "cut the cord" recently and went looking for a way to get the standard set of "cable" stations as streaming. See, already this is too many words. I swear most of those sites are paid by the word. Anyway, here's my thinking: I was going to pay for Hulu anyway (the $6 one without live TV) because of their original content. So when I compared that with YouTube's Live TV, I ended up saving money. The nice thing about Fubo is they have NESN, so you can watch the Red Sox. And The Weather Channel actually has some original programming, believe it or not. I honestly don't understand why DirecTV is so expensive, but they can probably afford to test the market and adjust later. It's also nice to see some offerings at the low end, and I did initially sign up for Sling when I got off the phone with Comcast and realized I now had NO way to entertain the family. But like I said, I signed up for Hulu. Maybe I'll switch to Fubo next baseball season? Oh, and don't do like I did and call Comcast all pissed off and tell them goodbye without remembering to WRITE DOWN EVERYTHING IN YOUR DVR. Yup, had do reconstruct my whole list from memory. Also I'm using ReelGood to keep track of all my streaming shows, which is something a cord-cutter has to do, that's just life. And I'll say one other thing: I have added back HBOMax to watch Curb (coming soon) and I've signed up for Showtime to watch The Circus and American Rust. It's unlikely everything will ever add up to what I had been paying Comcast. But if it does, that's fine with me, as long as I'm only paying Comcast for Internet. And if another provider comes along (fingers crossed for fiber!!) I'll give the Internet money to them instead. Don't get me started on Comcast's monopoly. OK, enjoy the channel comparison, and if you find anything incorrect, drop me a line at "channels" at-sign "jadbury" dot com and I'll make the necessary edits.
This was driving my crazy. My Mac's Finder was asking for a password for every delete, every rename, every move, everything.
I should have put two and two together and realized it was only happening in a folder I had restored from a backup volume.
Here's how I fixed it.
My Swift/Vapor deploying adventure with lots of words, because I stand in solidarity with the Recipe People. But no pictures, because I never think of that.
I thought it would be pretty straightforward. I’ve got Linux hosting at Cloudhost (not its real name) so I can just log in and install Swift and Vapor and build my app and run it, right?
Ha ha, good one.
But my hosting is modest - 1 GB of memory is plenty for my typical needs, which is usually limited to hosting an HTML site - Apache on Ubuntu 16.04.
So try and build a Vapor site? Nope, try and try and fail and fail - fatalError kind of stuff. Try adding -v to the build and re-run just that last command directly in Swift and all of a sudden I see the real problem: I’m running out of memory.
Well hell, of course I am!
So all I need to do is build my app off-site and copy the Run file, right? *Hey, don’t get ahead of me, this is my adventure.
Oh, I almost forgot this part. I’ve got a Linux system, and in fact I’ve already built my app there. Just copy the Run file, right? No, because this is Ubuntu 20.04 and so it depends on libraries and such that are four years newer than what’s running at Cloudhost.
But I’ve got this other PC and it’s got a bunch of memory. It might even ben running Linux already, who knows. Scrounge a keyboard and mouse and monitor. Plug it in. Beep beep beep. Won’t even POST.
No problem, pull the drive and drop it into yet another PC. Boot it up and wouldn’t you know, it’s actually running Ubuntu 16.04. In fact, there are ancient Swift directories from November 2016 when I thought I’d have time to play with the compiler. I didn’t. So get a network hooked up, get Swift installed, and…
$ swift -version
blah blah (I didn’t bother saving all the output)
Illegal Instruction
Oh yeah, if you are thinking about running Swift on Linux on an older PC, do this first:
$ cat /proc/cpuinfo | grep ssse3
because if it comes up blank, you’re going to have a bad time.
So no problem, that Ubuntu 20.04 PC is willing to sacrifice itself temporarily (and I know already it’s got ssse3) so unplug its drive and drop in the Ubuntu 16.04 drive.
Now here’s something I’m not 100% sure I needed to do, but I made sure that I installed Swift in the exact same place on both Ubuntu 16.04 systems - the one on my PC and the one at Cloudhost. In both cases, I have /opt/swift-5.4.1-RELEASE-ubuntu16.04. So if there are libraries that would cause a freakout because of different locations, that’s not going to happen.
And finally I see what I’ve been hoping for:
$ export PATH=/opt/swift-5.4.1-RELEASE-ubuntu16.04/usr/bin:"${PATH}"
$ swift -version
Swift version 5.4.1 (swift-5.4.1-RELEASE)
Target: x86_64-unknown-linux-gnu
So get Vapor installed, pull down my app, and (sudden thunder clap drum roll)
It works!!
*Oh wait… connect from the browser, no it doesn’t!! And this is something I didn’t realize about Vapor, you need to have the Resources/Views directory and all its .leaf (or .html) files. And, it turns out, your Public directory. No problem, so I did a clone of my whole app to get whatever files it needs. As they change, I can pull to refresh them. Then I re-copied the Run file, but this time dropped it in the same x86_64-linux-whatever location as where it came from. This way git doesn’t think I have any untracked files.
Now run it again, and it looks like it works, then hit it from the browser, and it actually does!!
So here are the takeaways:
I think that’s it. I hope this helps somebody!
I was thinking it might be fun to have auto restart of Vapor, like you can do with NodeJS. But then I thought more about what happens when you need to change multiple files, and you make change after change, and it won't build & run until you've made all of the changes.
Anyway, if you add this to routes.swift:
app.delete("kill-switch") { (req: Request) -> Response in
exit(0)
}And you start the server like so:
$ while true ; do vapor run ; sleep 3 ; done
Then you can restart it using curl or Postman or (if you use app.get) your browser:
$ curl -s 'http://localhost:8081/kill-switch' -X DELETE
Wait, what about reloading the page when the server restarts? That should be doable, right?
tldr; if you get connection reset/connection refused errors, try using unixDomainSocketPath instead of hostname.
I've had a heck of a time connecting Vapor 4 to MySQL. I know, maybe I should be using PostgreSQL, but I've got this old database I'd like to be able to connect to and provide new functionality with Swift code.
So I put this code in configure.swift on Linux:
app.databases.use(.mysql(
hostname: "localhost",
username: "dbuser",
password: "passW0rd",
database: "whichdb",
tlsConfiguration: .forClient(certificateVerification: .none)
), as: .mysql)
and that worked great.
But connecting to my Linux system is sometimes a pain in the neck, but it turns out that for some reason I have the same database on my Mac. I connect from the command line and `show tables;` lists every table I have on the Linux database. So copy the project to the Mac and `vapor run migrate` (because I'm going to play with the galaxies sample) and I get this error:
connection reset (error set): Connection refused (errno: 61)
Well to make a long story short, I ran lsof and saw that mysqld was listening on port 3306 but also had the file /tmp/mysql.sock open. Then I knew what to search for, and discovered that there is indeed an option to connect by socket:
try app.databases.use(.mysql(
unixDomainSocketPath: "/tmp/mysql.sock",
username: "dbuser",
password: "passW0rd",
database: "whichdb"
), as: .mysql)So basically you replace hostname with unixDomainSocketPath and you don't need the TLS configuration nonsense. Oh, and that init throws, so add try.
Hope this helps somebody!
If you're like me, you've got sticky notes covering every inch of every service of your vast empire.
If you're really like me, those sticky notes are all virtual. Mostly they take the form of "hey Siri, remind me in an hour to do a thing." They end up in my Reminders app and I can route them to whatever todo app they belong to.
The Apple Watch makes that super convenient. Raise your wrist, speak the magic phrase (or hold down the giant button) and remember to include a time, so it will put a badge on the reminder app.
Sometimes, though, there's a glitch. From Apple, can you even believe it? If Steve Jobs were alive, this would be solved by now, but he's not, and that's just how life goes.
Uh oh, something's wrong. Please try again. Oddly enough, if you try again, it will work. But if you've said something brilliant and you're not sure you can re-create it, here's a way to capture it: Apple Watch Screen Capture.
So it turns out that if you press the two buttons on the side of your Apple Watch, it will take a screenshot. I think you have to go to settings to enable that, which you should do before you need it, right? This will show up in your Photo Library as a PNG. And now you've got your brilliant utterance, or whatever gibberish Siri thinks you said.
And if you're like me, you've got a reminder to look at your Photo Library every now and then, because otherwise who knows when you'd ever see it, right?
Update (5/14/21): for what it's worth, I hardly ever see this anymore - the WatchOS 7.4 update must have fixed whatever was causing so many Siri problems. So thanks, Apple!
Did you ever need to take notes while you watch your slides play, but you don't want to switch back and forth between your Keynote and your text editor? Here you go... Save this to your Mac as main.swift - no other name will work, then run it in a terminal like so:
$ swift main.swift
import Cocoa
var pid = pid_t(-1)
let bid = "com.apple.iWork.Keynote"
for x in NSWorkspace.shared.runningApplications {
if x.bundleIdentifier == bid {
pid = x.processIdentifier
break
}
}
guard let keynote = NSRunningApplication(processIdentifier: pid) else {
print("Can't find Keynote")
exit(-1)
}
let src = CGEventSource(stateID: CGEventSourceStateID.hidSystemState)
let key: UInt16 = 0x79
guard let keydown = CGEvent(keyboardEventSource: src, virtualKey: key, keyDown: true) else {
fatalError("Can't get keydown")
}
guard let keyup = CGEvent(keyboardEventSource: src, virtualKey: key, keyDown: false) else {
fatalError("Can't get keydown")
}
while (true) {
keydown.postToPid(pid)
usleep(10_000)
keyup.postToPid(pid)
usleep(15_000_000)
}
I was working through a CloudKit tutorial and needed to create a container for my app.
I tried clicking the + button to create a CloudKit container from XCode 12 directly, but nothing happened.
So I clicked the CloudKit Dashboard and could see there were no containers.
I tried to create one. I entered iCloud.com.domain.app (reverse URL format) and gave it a name. Then I got an error message in red, "Unable to find a developer."
OK, well I'm logged in as the Account Holder, not as a Developer per sé, but this should work. Kept trying. Nothing.
So I tried something a little crazy: I went to the Certificates, Identifiers & Profiles section of App Store Connect. I created an identifier for the container I was trying to create.
After I did that, I went back to XCode and clicked the plus (+) again. Lo and behold, the container I had specified in the identifier I had created, all of a sudden showed up.
Will this work? Time will tell. But if you're getting the same error trying to create a CloudKit container, maybe this will help.
If so, you can buy me a beer!
😀 🍺