title | updated | layout | category | prism_languages | intro | |
---|---|---|---|---|---|---|
AppleScript |
2023-04-05 |
2017/sheet |
macOS |
|
AppleScript is a scripting language for automating macOS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To customise your terminal or iTerm to identify if you are in a Rosetta or Arm64 Architecture terminal, | |
add the following code in your ~/.zshrc file before the Powerlevel 10k statements. | |
# MacOS Architecture detection | |
function prompt_architecture() { | |
arch_name="$(uname -m)" | |
if [ "${arch_name}" = "x86_64" ]; then | |
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then | |
p10k segment -b 7 -f 0 -t 'x86' | |
else |
Especially when developing new query logic, it's helpful to query elasticsearch from the command line.
If your Elasticsearch cluster uses SAML authentication or some other SSO, it's not simple or sometimes not even
possible to query using curl
directly. I wrote an auth plugin for HTTPie that should greatly simplify this process
if you have rights to create API keys via the Kibana dev console (talk to your administrator and see the link below).
This process is also super handy for shell scripting because you can provide fine-grained limits of what your API key can do, making their use much safer and easier to manage than embedding native realm username/passwords.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_index=source_index | |
target_index=target_index | |
elastic_search_server=elasticsearch:9200 | |
# Make sure the source index is actually open | |
curl -X POST "${elastic_search_server}/${source_index}/_open" | |
# Put the source index in read-only mode | |
curl -X PUT "${elastic_search_server}/${source_index}/_settings" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube.com##.ytp-ce-covering-overlay | |
youtube.com##.ytp-ce-element-shadow | |
youtube.com##.ytp-ce-covering-image | |
youtube.com##.ytp-ce-expanding-image | |
youtube.com##.ytp-ce-element.ytp-ce-video.ytp-ce-element-show |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
NewerOlder