This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ARC=`uname -m` | |
if [[ `echo $ARC | egrep 'i[3456]86'` ]]; then | |
ARC=i386 | |
else | |
ARC=x86_64 | |
fi | |
# NOMACHINE NX binary packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## locate the JDK | |
JDK=$(basename $(ls -l -d /usr/java/jdk1.* | awk '{print $NF}' | tail -n 1)) | |
[[ -z $JDK ]] && echo "No Oracle JDK 7 installed in /usr/java" 1>&2 && exit 1 | |
## java | |
alternatives --install /usr/bin/java java /usr/java/${JDK}/jre/bin/java 20000 | |
alternatives --set java /usr/java/${JDK}/jre/bin/java |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
LOCAL_HOST="localhost" | |
LOCAL_PORT="" | |
GATEWAY_USER="" | |
GATEWAY_HOST="" | |
GATEWAY_PORT=22 | |
TARGET_HOST="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
osascript -e 'tell application "Microsoft Database Daemon" to quit' | |
rm -R '/Applications/Microsoft Communicator.app/' | |
rm -R '/Applications/Microsoft Messenger.app/' | |
rm -R '/Applications/Microsoft Office 2011/' | |
rm -R '/Applications/Remote Desktop Connection.app/' | |
rm -R '/Library/Application Support/Microsoft/' | |
rm -R '/Library/Automator/*Excel*' | |
rm -R '/Library/Automator/*Office*' | |
rm -R '/Library/Automator/*Outlook*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# replace apple with orange | |
puts [string map {"apple" "orange"} "I like apple."] | |
# remove . in the string 3.8.001, prints 38001 | |
puts [string map {. ""} 3.8.001] | |
# more about string map, see http://wiki.tcl.tk/10170 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mylist "1 2 3 4 5" | |
# prints the last element of mylist: 5 | |
puts [lindex $mylist end] | |
# prints the first element of mylist: 1 | |
puts [lindex $mylist 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="my_output_div"></div> | |
<script src="http://java.com/js/deployJava.js"></script> | |
<script type="text/javascript"> | |
var html = '<ul>'; | |
html += '<li><b>Installed JREs:</b>' + deployJava.getJREs() + '</li>'; | |
html += '<li><b>Version Check (>= 1.6.0?):</b>' + deployJava.versionCheck('1.6.0+') + '</li>'; | |
html += '<li><button onClick="deployJava.installLatestJRE();">Install latest JRE</button></li>'; | |
var div = document.getElementById('my_output_div'); | |
div.innerHTML=html; | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GWTExample { | |
public static void openRelativeURL(String path, String name) { | |
String url = GWT.getHostPageBaseURL() + path; | |
com.google.gwt.user.client.Window.open(url, name, null); | |
} | |
public static void main(String[] args){ | |
openRelativeURL("about.html"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GWTExample { | |
public static void openUrlInNewWindow(String url, String name) { | |
// Open a new browser window | |
com.google.gwt.user.client.Window.open(url, name, "menubar=no,location=false,resizable=yes,scrollbars=yes,status=no,dependent=true"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Locate matlab binary executable file. | |
# | |
MATLAB=$(which matlab) | |
if [ -z ${MATLAB} ]; then | |
if [ -n ${MATLAB_HOME} ]; then | |
MATLAB=${MATLAB_HOME}/bin/matlab |