Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
Actually, that's a feature | |
Don't worry, that value is only wrong half of the time | |
Even though it doesn't work, how does it feel? | |
Everything looks fine my end | |
How is that possible? | |
I broke that deliberately to do some testing | |
I can have a look but there's a lot of if statements in that code! | |
I can't make that a priority right now | |
I can't test everything | |
I couldn't find any examples of how that can be done anywhere else in the project |
Some notes on accessing / exporting Apple's Screen Time data
#!/bin/bash | |
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont' |
You can inherit the environment variables from PID 1 by iterating over the list of null-terminated strings
in /proc/1/environ
, parsing the first characters up to the first =
as the variable name, setting the
remaining value as that variable, and exporting it.
The Code Snippet
This works with multiline environment variables, and environment variables with arbitrary values, like
strings, including =
or JSON blobs.
Paste this in your current terminal session to inherit the environment variables from PID 1:
#!/bin/bash | |
# Find existing files in download/complete that are not in movies or tvshows. | |
export DOWNLOAD_FOLDER=path/to/downloads | |
export MOVIES_FOLDER=path/to/movies | |
export TVSHOWS_FOLDER=path/to/tvshows | |
findExistingFile() { | |
file=$(find $MOVIES_FOLDER/ $TVSHOWS_FOLDER/ -samefile "$1") |
Partial evaluation means to fix some variables in the given code before execution. With a traditional implementation of a compiler or an interpreter, all variables are replaced with its value on each evaluation of that variable. This is because a variable can change at any timing. This is, however, not always true in actual applications. Almost all of large applications has setting variables and data
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>Christophe subscriptions in feedly Cloud</title> | |
</head> | |
<body> | |
<outline text="Security" title="Security"> | |
<outline type="rss" text="Schneier on Security" title="Schneier on Security" xmlUrl="http://www.schneier.com/blog/index.rdf" htmlUrl="https://www.schneier.com/blog/"/> | |
<outline type="rss" text="Rhino Security Labs" title="Rhino Security Labs" xmlUrl="http://www.rhinosecuritylabs.com/blog/feed/" htmlUrl="https://rhinosecuritylabs.com"/> |
#!/bin/bash -e | |
curl -O https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg | |
hdiutil attach googlechrome.dmg | |
SRC=/Volumes/Google\ Chrome/Google\ Chrome.app/Contents/Frameworks/Google\ Chrome\ Framework.framework/Libraries/WidevineCdm | |
DEST=/Applications/Chromium.app/Contents/Frameworks/Chromium\ Framework.framework/Libraries/ | |
cp -R "$SRC" "$DEST" | |
hdiutil detach /Volumes/Google\ Chrome/ |