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
# set to system default proxy | |
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy() | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials | |
# or a custom one | |
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy("http://localhost:8080") | |
# or use username and password auth | |
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy("http://localhost:8080",$true) | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = New-Object System.Net.NetworkCredential($user, $passwd) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> | |
<dict> | |
<key>FullScreen</key> | |
<true/> | |
<key>Icon</key> |
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/env bash | |
@echo off | |
goto(){ | |
function checkOS() { | |
unameOut="$(uname -s)" | |
case "${unameOut}" in | |
*Microsoft*) OS="WSL";; #must be first since Windows subsystem for linux will have Linux in the name too | |
*microsoft*) OS="WSL2";; |
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/env bash | |
# Based on: http://godlessheathenmemoirs.blogspot.com.au/2015/03/homebrew-aka-brew-on-mac-os-x-behind.html | |
function usage() { | |
echo 2>&1 "" | |
echo 2>&1 "usage: $(basename $0) PROXY_HOST PROXY_PORT" | |
exit 1 | |
} | |
PROXY_HOST=${PROXY_HOST:-$1} |
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/env zsh | |
# now playing | |
# requires the last.fm API key | |
export API_KEY="fghjfghfghfghfghjfghjfjgh" | |
# requires LastFM user to follow | |
USER="hairball1975" | |
URL="http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks" | |
URL+="&user=$USER&api_key=$API_KEY&format=json&limit=1&nowplaying=true" |
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 | |
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') | |
# Get Xcode CLI tools | |
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex | |
# https://developer.apple.com/downloads/index.action | |
TOOLS=clitools.dmg | |
if [ ! -f "$TOOLS" ]; then | |
if [ "$OSX_VERS" -eq 7 ]; then | |
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg |
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 | |
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line | |
echo "Checking Xcode CLI tools" | |
# Only run if the tools are not installed yet | |
# To check that try to print the SDK path | |
xcode-select -p &> /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Xcode CLI tools not found. Installing them..." |
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
import tweepy | |
from tweepy import API | |
auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET") | |
auth.set_access_token("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET") | |
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True, compression=True) | |
path = '/location/for/list/file_with_name_list.txt' | |
with open(path, 'r') as f: |
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
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound) |