Skip to content

Instantly share code, notes, and snippets.

View xenatt's full-sized avatar

Nattapong Pullkhow xenatt

View GitHub Profile
@xenatt
xenatt / FusionLoadNvram.command
Created February 1, 2014 05:11
Fusion Nvram Load and Save
osascript -e 'do shell script "sudo echo \"nvram -xp > /nvram.plist;chflags hidden /nvram.plist;\" >> /etc/rc.shutdown.local;sudo nvram -xp > /tmp/nvram;sudo cp -r /tmp/nvram /nvram.plist;sudo rm -rf /tmp/nvram;sudo chflags hidden /nvram.plist;sudo rm -rf /tmp/com.xenatt.fusion.nvram.plist;sudo cat >> /tmp/com.xenatt.fusion.nvram.plist << EOF
<?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>Label</key>
<string>com.xenatt.fusion.nvram</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
set u to do shell script "uuidgen"
set the clipboard to u
display dialog "UUID in Clipboard:" with title "UUID Generator" default answer u buttons "OK" default button "OK"
@xenatt
xenatt / MacGen
Created February 10, 2014 17:48
Mac Address Generator For Hackintosh
set x to do shell script "perl -e 'printf \"%02X%02X%02X%02X%02X%02X
\", rand 0xFF, rand 0xFF, rand 0xFF, rand 0xFF, rand 0xFF, rand 0xFF'"
set the clipboard to x
display dialog "Mac Address in Clipboard:" with title "Mac Adress Generator" default answer x buttons "OK" default button "OK"
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Tweetbot") then
tell application "Tweetbot" to activate
end if
if not (exists application process "iTunes") then
--Original form
-- TweetViaTwitter.applescript
-- Copy title and URL in the front most window of Safari to Twitter with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Wedge") then
tell application "Wedge" to activate
end if
if not (exists application process "iTunes") then
tell application "iTunes" to activate
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Wedge") then
tell application "Wedge" to activate
end if
if not (exists application process "iTunes") then
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Appetizer") then
tell application "Appetizer" to activate
end if
if not (exists application process "iTunes") then
@xenatt
xenatt / FinderToTerminal.applescript
Last active December 16, 2015 16:19
Finder To Terminal License GPL
try
tell application "Finder" to set fdir to (target of front Finder window) as text
tell application "Terminal"
do script "cd " & (quoted form of POSIX path of fdir)
end tell
tell application "System Events"
set visible of process "Terminal" to true
set frontmost of process "Terminal" to true
end tell
on error errorMessage number errorNumber
@xenatt
xenatt / ShowDesktop.applescript
Created April 25, 2013 19:43
Show Desktop App license GPL
tell application "System Events"
repeat with X in application processes
if visible of X is true then
set visible of X to false
else
set visible of X to true
end if
end repeat
end tell