-
jq — https://jqlang.github.io/jq/ — "like sed for JSON data"
There are several options available for installing jq. I prefer to use Homebrew:
brew install jq
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
#!/bin/sh | |
test -z "$WEZTERM_CONFIG_FILE" && test -f /home/dev/src/scripts/wezterm.lua && export WEZTERM_CONFIG_FILE=/home/dev/src/scripts/wezterm.lua | |
DESKTOP_FILE='/usr/share/applications/org.wezfurlong.wezterm.desktop' | |
# get binary name by looking at 'Exec' value in .desktop file. | |
BIN=$(grep -P '^Exec=' $DESKTOP_FILE | cut -f 2 -d '=' |cut -f 1 -d ' ') | |
# wezterm does put its name in window title. so wmctrl is not able to find it. |
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
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: dns-sync | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: S | |
# Default-Stop: | |
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks | |
### END INIT INFO |
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
#!/bin/bash | |
COLLECTION=${2:-zylk} | |
SERVER=${3:-localhost} | |
PORT=${4:-8983} | |
if [ -z "$1" ]; then | |
# Usage | |
echo 'Usage: add-by-id.sh <id> [<collection> <solr-server=localhost> <port=8383>]' | |
else | |
curl -X POST "http://${SERVER}:${PORT}/solr/${COLLECTION}/update?commit=true" -H "Content-Type: text/xml" --data-binary "<add><doc><field name='id'>$1</field><field name='url'>$1</field></doc></add>" |
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
# Description: Boxstarter Script | |
# Author: Jess Frazelle <jess@linux.com> | |
# Last Updated: 2017-09-11 | |
# | |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: |
I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
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
dash_id=xxxx | |
api_key=xxx | |
app_key=xxx | |
# 1. export | |
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json | |
# 2. edit dash.json | |
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level |
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
#!/usr/bin/bash | |
# We're only processing one solr collection named notices | |
for x in `seq 1 8`; do | |
curl "http://localhost:8983/solr/admin/cores?action=UNLOAD&core=notices_shard${x}_replica3 | |
rm -rf /var/lib/solr/data/notices_shard${x}_replica3/* | |
mkdir -p /var/lib/solr/data/notices_shard${x}_replica3/data |
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
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0 |
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
; This is a complete solution to map the CapsLock key to Control and Escape without losing the ability to toggle CapsLock | |
; We use two tools here - any remapping software to map CapsLock to LControl and AutoHotkey to execute the following script | |
; This has been tested with MapKeyboard (by Inchwest) | |
; This will allow you to | |
; * Use CapsLock as Escape if it's the only key that is pressed and released within 300ms (this can be changed below) | |
; * Use CapsLock as LControl when used in conjunction with some other key or if it's held longer than 300ms | |
; * Toggle CapsLock by pressing LControl/CapsLock + RControl | |
~*LControl:: |
NewerOlder