Skip to content

Instantly share code, notes, and snippets.

View alex-ross's full-sized avatar

Alexander Ross alex-ross

View GitHub Profile
@alex-ross
alex-ross / macOSHighSierra_Bootable.sh
Last active August 2, 2019 23:21
Create a Bootable macOSHighSierra.iso for installing macOS High Sierra in Virtualbox or VMware with macOS High Sierra.app
# Create a Bootable macOSHighSierra.iso for installing macOS High Sierra in Virtualbox or VMware with macOS High Sierra.app
# Create a "virtual USB flash drive"/disk image:
hdiutil create -o /tmp/HighSierra -size 8G -layout SPUD -fs HFS+J -type SPARSE
# Mount it:
hdiutil attach /tmp/HighSierra.sparseimage -noverify -mountpoint /Volumes/install_build
# Write the installer files into this new disk image:

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@alex-ross
alex-ross / mysql-docker.sh
Created August 3, 2017 08:13 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
activate
end tell
#!/usr/bin/env ruby
require 'gosu' # gem install gosu --no-document
include Gosu
$dimension, $splits = 200, 20
$size = $dimension.to_f / $splits.to_f
class Worm
attr_writer :dir
def initialize() reset end
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600,700,900' rel='stylesheet' type='text/css'>
<style>
.icon-file-alt {