Skip to content

Instantly share code, notes, and snippets.

View Valthoron's full-sized avatar

Serdar Üşenmez Valthoron

  • Ankara, Turkey
View GitHub Profile
@Valthoron
Valthoron / Wi-Fi DNS Selector
Created April 8, 2014 10:39
AppleScript that presents a list of public domain name servers to the user, sets the Wi-Fi DNS addresses according to selection, finally clears the DNS cache.
on run
choose from list {"<Default>", "OpenDNS", "Google Public DNS", "Norton DNS for Home", "Comodo Secure DNS", "Neustar DNS Advantage", "Verizon / Level 3"} with prompt "Please select a DNS service:" with title "Wi-Fi DNS Selector" without multiple selections allowed and empty selection allowed
if the result is not false then
if item 1 of the result is "<Default>" then
do shell script "networksetup -setdnsservers Wi-Fi Empty" with administrator privileges
do shell script "dscacheutil -flushcache" with administrator privileges
else if item 1 of the result is "OpenDNS" then
do shell script "networksetup -setdnsservers Wi-Fi 208.67.222.222 208.67.220.220" with administrator privileges
@Valthoron
Valthoron / xcode-build-bump.sh
Last active December 9, 2022 10:22 — forked from sekati/xcode-build-bump.sh
Set a timestamp as the build number when an Xcode project is compiled.
# xcode-build-timestamp.sh
# @desc Set a timestamp as the build number when the project is compiled.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Target dependencies"
buildNumber=$(date +%Y%m%d%H%M)