Skip to content

Instantly share code, notes, and snippets.

View adamchilcott's full-sized avatar

Adam Chilcott adamchilcott

View GitHub Profile
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@jabenninghoff
jabenninghoff / osx-mount-drives-on-boot.md
Created September 10, 2016 16:07
Configure OS X to mount external drives at boot

By default, OS X only mounts external drives (USB, Firewire, Thunderbolt, etc.) when you log in, and unmounts them when you log out or reboot. To change this behavior, enable AutomountDisksWithoutUserLogin.

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

Installing OS X Server also enables this setting.

Alternatively, you can create the /Library/Preferences/SystemConfiguration/autodiskmount.plist with the following content:

@kuznero
kuznero / WinUSBFromLinux.md
Last active August 23, 2021 13:20
How to make Windows 7 USB flash install media from Linux?

How to make Windows 7 USB flash install media from Linux?

StackOverflow

  • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
  • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
# cfdisk /dev/sdb
or fdisk /dev/sdb (partition type 7, and bootable flag)
@u8sand
u8sand / masquerade_as_mac.sh
Created April 2, 2016 02:36
El-Capitan Mac OS X VM Oracle Virtualbox configuration
#!/bin/bash
vm="OSX"
VBoxManage modifyvm $vm --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata $vm "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata $vm "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata $vm "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-F2238BAE"
VBoxManage setextradata $vm "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata $vm "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
@selahssea-zz
selahssea-zz / elcapitan.sh
Created January 21, 2016 08:52
Create bootable OS X El Capitan ISO
#!/bin/bash
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Create the ElCapitan Blank ISO Image of 7316mb with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/ElCapitan.cdr -size 7316m -layout SPUD -fs HFS+J
# Mount the ElCapitan Blank ISO Image
hdiutil attach /tmp/ElCapitan.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@rheid
rheid / makecab.ps1
Created October 16, 2015 15:02
Creating .CAB files with Powershell
<#
.SYNOPSIS
Creates a new cabinet .CAB file on disk.
.DESCRIPTION
This cmdlet creates a new cabinet .CAB file using MAKECAB.EXE and adds
all the files specified to the cabinet file itself.
.PARAMETER Name
The output file name of the cabinet .CAB file, such as MyNewCabinet.cab.
@u1735067
u1735067 / MkBootUSB.bat
Last active June 14, 2021 12:52
Windows All-In-One bootable USB key maker script
@echo off
:: MkBootUSB
:: @author: u1735067
:: @date: 2015-07-30
:: @url: https://gist.github.com/Alex131089/0d742138b978c28a1695
setlocal enableextensions
set debug=0
:: Print some informations
@igorpopovio
igorpopovio / download-with-name.ps1
Created July 16, 2014 13:56
Download a file in PowerShell using the wget style - guess filename, don't hard-code anything!
function DownloadFileFrom($link) {
$filename = [System.IO.Path]::GetFileName($link)
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($link, $filename)
}
@spion
spion / screenshot.js
Last active May 27, 2022 01:38
Take website screenshots of any resolution using phantomjs
// Usage: phantomjs screenshot.js 1920x1080 site.domain.com
// outputs to site.domain.com-1920x1080.png
// dont add http to the URL
// If the page didnt render in time add a delay argument
// e.g. 3000 for 3 seconds
var page = require('webpage').create();
var args = require('system').args;
var wh = args[1].split('x');