Disable Windows Defender real time protection with a Desktop Shortcut

Published 2017-10-05, 17:31

I love how Microsoft made third party anti virus protection obsolete with Defender – it just works.

Unfortunately sometimes I need to disable (and later enable again) it’s real time protection feature because it slows down processes I know are secure – for example Gradle builds in Android Studio.

It normally takes 7 clicks to enable or disable Defender real time protection: Systray -> double click on icon -> „Virus & threat protection“ -> „Virus & threat protection settings“ -> Toggle „Real-time protection“ -> User Account Control „Yes“.

Fortunately there is a way to automate this in Powershell:

Set-MpPreference -DisableRealtimeMonitoring $true

Which means we can also create a desktop shortcut (Right click on Desktop -> New -> Shortcut):

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:/disable.ps1"

(„C:/disable.ps1“ is the file where I put the first code snippet)

In the properties you have to click „Advanced“ to activate „Run as Administrator“ so it can actually be executed.

Then to give it a nice icon, click „Change Icon“ in the shortcut properties and „open“ the icons from „%systemroot%\system32\imageres.dll“. There you’ll find a nice dark red Defender like „badge“ icon with a white x:

The real time protection feature will turn itself back on after some time. Alternatively you could replace „$true“ with „$false“ in a copy of that script to have a shortcut to enable it again. Or spend some time to figure out how to actually „toggle“ in on and off with the same shortcut by somehow doing this in the Powershell script. (Let me know if you do!)

Source: Script via StackOverflow answer by ‚djsmiley2k‘ to my question and icons file for the shortcut

Topic(s): Kram No comments - :(

Website Performance, Code, Images and SEO Testing Tools

Published 2017-09-29, 12:48

There are loads of web site and page analyzer tools out there that look at them under performance, quality, image compression, code or SEO aspects. Many are just (thinly veiled) lead generation tools that don’t really tell the true story, but some are actually useful. As I need them again and again, I collected them here:

More on the marketing-y, rarely even questionable side, but sometimes still interesting to look at:

Topic(s): Kram, Technik No comments - :(

Visualize `git reflog` in a GUI (and put it in context) with SmartGit

Published 2017-09-28, 11:31

Recently I messed up an important git repository that I was working on. I had created some content in a specific file a few weeks ago. After multiple merges, commit squashing, git reset, rebases and other types of history rewrites  I noticed that this content was missing.

Oh-oh, seems what everybody warns you about when rewriting history happened: I lost some stuff.

But lucky for me, git never really deletes anything. Even if you do stupid things, each commit that was there before still is – just orphaned and without a connection to your normal branches.

Unlucky for me the tool to fix this is called git reflog and not supported by my usual git GUIs that I use, SourceTree and GitKraken.

I tried to use git reflog on the command line, but to be honest this didn’t help much. reflog just outputs a list of changes to the repository, and you have to sift through these manually to find the one you are looking for. There is no context which files where changed or what changes to these files were made. (Disclaimer: There probably is a way to work around this with some bash scripts – here or here for example – but I have no idea about how exactly. That’s why I normally use a GUI.) I had no idea when in the last month stuff broke, so I had no idea where to start looking.

After quite some time googling around I (re)found SmartGit.
SmartGit is also a Git GUI and calls itself „Git for Professionals.“. This means it doesn’t look as fancy as SourceTree or Gitkraken (its design reminded me of working in the Delphi IDE back in the day…), but it is indeed powerful. And most importantly, it can visualize lost commits in a way that is useful!

Funny enough this feature is only very lightly mentioned in the documentation, so here is how it works:

How to visualize lost and „orphaned“ commits with SmartGit

We are looking for the „Recyclable Commits“ branch in the „Log“ view: Open the repository in SmartGit, right click on the repository in the „Repositories“ panel,  select „Log“ in the context menu, then in the opened „Log“ view, select „Recyclable Commits“ in the „Branches“ panel additionally to the already selected branch or „HEAD“:

The light orange-dot entries (vs. the bold black-dot ones) are the „orphans“ that are not part of the current tree any more.

You can filter these down by using a „Filter“ input, which optionally can search for File name and even File content! (So I could just type the filename I knew I had put my content into, and look only through these relevant commits – and even search for a few words I knew I wrote about in the file – how awesome is that!)

Important and super useful is that these commits are shown in the context of the current tree, so you can click the individual commits and see the file changes it includes, click the files to see the diff as you normally would. So much easier than on the command line.

After you found the missing commit, either copy the text over to your editor manually or cherry pick that commit with all its changes to your current branch by right clicking on it and selecting „Cherry-Pick…“. Then commit as usual (and dance a bit as you just saved a few days of work).

Topic(s): Technik No comments - :(

About StackOverflow

Published 2017-09-22, 16:35

I tried to post a few questions on StackOverflow in the last days which at times was a very negative experience: I was downvoted, got negative comments and of course got my questions closed as „offtopic“.

I am not the only one with that problem:

  1. https://hackernoon.com/the-decline-of-stack-overflow-7cb69faa575d
  2. https://movingfulcrum.com/stackoverflow-modding-itself-out-of-existence/

Why do I write this down now? So I don’t start googling for exactly these posts and experiences the next time I am in this position, but can just go to this post, read some of these rants and accept it.

Then I can go back and see that maybe someone actually did provide a great comment or answer. Sometimes that still happens.

Topic(s): Kram No comments - :(

How to commit and version changes in a git fork/branch but not merge them back

Published 2017-09-21, 11:38

Recently I tried to figure out how to have both a production and staging environment of a Jekyll website hosted with Github Pages.

This turned out to be not that simple, as both repositories (Github Pages can only host one branch per repository, so you need two – one organization repository and one personal for example) need to have a CNAME and _config.yml file with different content.

So the actual question to answer was how can one commit and version changes to files in a git fork/branch but then not merge them back into the source, while still having a fully merged branch (so actual changes can be merged back via Pull Requests)?

The answer is to use the ours merging strategy when merging the changes that should be skipped:

  1. Assume we have our production repo and staging repo both checked out locally, for now being identical (and having the same CNAME and _config.yml).
  2. Check out staging, make the changes to the files and commit and push them.
  3. If we were to do a normal merge to production, this change would now get merged over.
  4. But now we run these commands:
    git checkout production
    git merge --strategy=ours staging

    (Source)
    --strategy=ours makes sure that during this merge, the production file remain unchanged. But the commit is still marked as merged.
    If we want, we can now also edit the merge commit messageto be a bit more descriptive what we just did: We merged the two branches, but made it keep „our“ (in this case: production) version of the files.
  5. Then push the changes to production:
    git push production production:master

Your next changes to staging can the be merged with production normally, without getting the CNAME and _config.yml changes.

Topic(s): Technik 1 single comment - :/

Rewriting history in Git

Published 2017-09-20, 21:00

Once again I was confused about rewriting history in Git:

As I am not a git power user – I use a GUI, SourceTree of GitKraken – for the more complicated commands and features, my mind tends to just „crash“ now and then and forget what they are and how they work.

A bit later I had it figured out again:

During these 15 minutes I googled around and found some nice explanations I now want to conserve for future reference:

And an additional nice thing to know and use when playing around with those:

Topic(s): Kram No comments - :(

Move (clone and close) Github issues to a different repository

Published 2017-08-04, 11:45

If you have any projects on Github that span multiple repositories you know the pain when someone creates a valid issue, but uses the wrong repo to do so. Of course you could tell them to „Create another issue in the correct repo and gtfo“ but that a) wouldn’t be very nice and b) is a quite a lot of work and c) probably wouldn’t have the intended effect to grow your Github community.

So you need a way to move issues betweens repos.

Github doesn’t support this out of the box, but of course some other people jumped in and created things that do. Here is an overview of my research on this:

Topic(s): Link No comments - :(

How to develop iOS 10.3.x apps in Xcode 8.2.x

Published 2017-07-10, 18:44

If you work on an older version of Mac OS, for example because Apple decided your Macbook is to old to upgrade to a recent version, you might be stuck with Xcode 8.2.x to develop and test your iOS apps. Unfortunately this can lead to this nice error message if you made the mistake to upgrade your iPhone to iOS 10.3:

Could not locate device support files
This iPhone 6s is running iOS 10.3.1 (14E304), which may not be supported by this version of Xcode.

This is because the old Xcode doesn’t get these „device support files“ via updates any more. Luckily the internet is here to rescue you.

  1. Download https://www.dropbox.com/s/i1f7q8w3vgr2ozl/10.3%20%2814E269%29.zip?dl=0 and extract it
  2. Click on „Finder“ in MAC OS
  3. Click on „Go to Folder“
  4. Paste this path:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
  5. Paste your extracted „10.3 (14E269)“ directory to that place.
  6. Quit Xcode and restart it (and maybe the whole Mac).
  7. You can now run your projects successfully on your real device again.

Adapted from source: https://gist.github.com/steipete/d9b44d8e9f341e81414e86d7ff8fb62d#gistcomment-2041802

Topic(s): Link, Notiz No comments - :(

Overview of the trakt.tv API Concepts and Endpoints

Published 2017-07-03, 17:24

trakt.tv offers a very comprehensive API with an amazing documentation. But thorough as it is – and the technical details like authentication, data formats, parameters etc. are really, really well covered – it can also feel a bit overwhelming when you jump in and want to get a first overview, or are only looking for some specific data or type of data.

As I just did exactly that, I went through the whole documentation and extracted the most relevant information. The order of this article, especially the API endpoints, follows the official API documentation. I only added some more headlines to group the endpoints in a better way:

Concepts

The API only defines some terms in „Terminology“, but there is a lot more to understand what there is and how it is all connected:

Use the checkboxes next to the terms to deactivate them in the list below. You can also set if they only should be deactivated or completely hidden.

Emojis Legend

These Emojis are used in the official documentation to indicate what functionality is offered by or needed for an endpoint.

Data Endpoints

These return the nitty-gritty of Trakt: Lots of data about shows and movies and all the things related to them:

User Endoints

If it matters which user is logged in via OAuth, these endpoints are collected here:

Master Data Endpoints

These endpoints offer mostly static data that should be retrieved once and then be cached for further use:

And that’s it! All essential API endpoints of the trakt.tv API, groupd by type and explained a bit more.

Topic(s): Kram, Link, Research No comments - :(

Google Spreadsheet: Output current date (statically)

Published 2017-06-30, 13:03

Imagine you have a Google Spreadsheet with a „last active“ column where you e.g. log the date when you last worked on the line item. You don’t want to have to type the date every time you change something as a) typing is cumbersome and b) you don’t even know the current date anyway.

Normally there is a default keyboard shortcut for that in Google Spreadsheets:

Insert time: Ctrl + Shift + ;

Unfortunately this doesn’t really work with a German keyboard (in Windows 10 with English OS language). In Chrome you can replace the Semicolon with Ü, but in Firefox this doesn’t work and I found no way to trigger this shortcut :(

Two solutions:

  1. Create a field with formula `=TODAY()`, maybe in the second row of the headline of the table. (Unfortunately this value will be recalculated on every change – so you can’t just use THAT everywhere to get the date – this value will change.) Now you can just Ctrl + C to copy that value and then Ctrl + Shift + V to output its value (and not copy the formula) to the target cell.
  2. Add a „Date“ validation to your column. Now you can double click the cell to get a nice calendar tooltip thingie where you can just click on the date you want.

To be honest 1) doesn’t really solve b), but you can leave the formula from 1) in the subheader for that anyway and just use 2) use this instead of the value pasting from 1).

Topic(s): Kram No comments - :(

19 queries. 0,213 seconds.