Skip to content

Instantly share code, notes, and snippets.

Nattapong Pullkhow xenatt

Block or report user

Report or block xenatt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@xenatt
xenatt / MacGen
Created Feb 10, 2014
Mac Address Generator For Hackintosh
View MacGen
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"
View Generate UUID.scpt
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"
View fix-drupal-permissions.sh
#!/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
@xenatt
xenatt / FusionLoadNvram.command
Created Feb 1, 2014
Fusion Nvram Load and Save
View FusionLoadNvram.command
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>
View 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
View .maciasl
GIGABYTE Z77P-D3 DSDT https://gist.github.com/xenatt/8435723/raw/f16bd30b76f655e5fc48d53b3541255612ce261b/Z77P-D3.txt
@xenatt
xenatt / iNVRAMPatch
Created Jul 28, 2013
This Shell script Use GPL (GNU GENERAL PUBLIC LICENSE)
View iNVRAMPatch
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>
View gist:6050281
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
View iTunes2facebook.script
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
@xenatt
xenatt / iTunes_Geeklets.sh
Last active Dec 16, 2015
Shell script for iTunes Player status and Cover Geeklets Download http://xenatt.deviantart.com/art/MINIMAL-GEEKLETS-366032600
View iTunes_Geeklets.sh
itnsps=`osascript -e "tell application \"System Events\"" -e "if (exists application process \"iTunes\") then" -e "return \"yes\"" -e "else" -e "return \"no\"" -e "end if" -e "end tell"`
lasttrack=`tail /tmp/itunestrack`
if [ "$itnsps" = "yes" ]
then
itnsplst=`osascript -e "tell application \"iTunes\"" -e "return (get player state as string)" -e "end tell"`
if [ "$itnsplst" = "playing" ]
then
You can’t perform that action at this time.