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
#!/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
#!/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/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/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
function doGet() { | |
return HtmlService.createHtmlOutputFromFile('Form').setSandboxMode( | |
HtmlService.SandboxMode.IFRAME); | |
} | |
function createFolder(parentFolderId, folderName) { | |
try { | |
var parentFolder = DriveApp.getFolderById(parentFolderId); | |
var folders = parentFolder.getFoldersByName(folderName); | |
var folder; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<base target="_top"> | |
</head> | |
<body> | |
<form id="uploaderForm"> | |
<label for="uploaderForm">Upload multiple Files</label> | |
<div> | |
<input type="text" name="applicantName" id="applicantName" |
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
import java.io.BufferedOutputStream; | |
import java.io.IOException; | |
import java.io.PrintStream; | |
import java.nio.file.FileVisitResult; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.nio.file.SimpleFileVisitor; | |
import java.nio.file.attribute.BasicFileAttributes; | |
import java.util.concurrent.atomic.AtomicLong; |
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
if (-Not (Test-Path Env:JAVA_HOME)) { | |
Write-Output "JAVA_HOME environment variable is not set." | |
Exit 1 | |
} | |
$Env:PATH = $Env:JAVA_HOME + "\bin;" + $Env:PATH | |
$VERSION_LINE = (java -version 2>&1 | Select-String version) | |
$NAME = ($VERSION_LINE | %{$_.Line.Split(' ')[0];}) | |
$VERSION = ($VERSION_LINE | %{$_.Line.Split(' ')[2].Replace("`"", "");}) |
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
#!/usr/bin/env bash | |
if [[ ! -d "/media/$(whoami)/Parallels Tools" ]]; then | |
echo "Please mount parallels tools disk before install" | |
exit | |
fi | |
echo "Copy install files to /tmp/parallels_fixed" | |
cp -rf "/media/$(whoami)/Parallels Tools" /tmp/parallels_fixed | |
chmod -R 755 /tmp/parallels_fixed | |
cd /tmp/parallels_fixed/kmods | |
echo "Unpack prl_mod.tar.gz" |