Skip to content

Instantly share code, notes, and snippets.

View xenatt's full-sized avatar

Nattapong Pullkhow xenatt

View GitHub Profile
on searchencode(theText)
set AppleScript's text item delimiters to " "
set theTextItems to text items of theText
set AppleScript's text item delimiters to "+"
set theText to theTextItems as string
set AppleScript's text item delimiters to {""}
set AppleScript's text item delimiters to "%0A"
set theTextItems to text items of theText
set AppleScript's text item delimiters to ""
set theText to theTextItems as string
display dialog "Tweet?" default answer "" buttons {"OK"} default button 1
set mytweet to text returned of result
tell application "System Events"
tell process "Notification Center"
click menu bar item 1 of menu bar 1
click button 1 of UI element 1 of row 2 of table 1 of scroll area 1 of window "window"
keystroke mytweet
keystroke "D" using {command down, shift down}
keystroke space
@xenatt
xenatt / iNVRAMPatch
Created July 28, 2013 05:06
This Shell script Use GPL (GNU GENERAL PUBLIC LICENSE)
echo "Start Patch iCloud Service .............."
sudo cat > /Library/LaunchDaemons/com.nvram.root.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.nvram.root</string>
<key>ProgramArguments</key>
<array>
@xenatt
xenatt / .maciasl
Last active January 3, 2016 08:19
GIGABYTE Z77P-D3 DSDT https://gist.github.com/xenatt/8435723/raw/f16bd30b76f655e5fc48d53b3541255612ce261b/Z77P-D3.txt
# Maintained by: xenatt for: Gigabyte Z77P-D3at: Mon Dec 30 16:01:49 UTC 2013
# Patch Name : GA-Z77P-D3
# Note : base on PJALM Gigabyte General z77 patch
# Add the DTGP method
into method label DTGP remove_entry;
into definitionblock code_regex . insert begin
Method (DTGP, 5, NotSerialized)\n
{\n
If (LEqual (Arg0, Buffer (0x10)\n
@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"