This file contains 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 | |
[ $# -ne 1 ] && echo "$(basename $0) <dir>" && exit 1 | |
[ ! -d $1 ] && echo "$1 is not a directory." && exit 1 | |
if [ $(uname) == "Darwin" ]; then | |
find "$1" -type f -print0 | xargs -0 stat -f '%z ' | paste -sd+ - | bc | |
else | |
find "$1" -type f -printf %s\\n | paste -sd+ | bc |
This file contains 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 | |
[ $# -ne 1 ] && echo "$(basename $0) <dir>" && exit 1 | |
[ ! -d $1 ] && echo "$1 is not a directory." && exit 1 | |
find "$1" -type f | wc -l |
This file contains 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 os | |
import chardet | |
for n in os.listdir('.'): | |
print(chardet.detect(os.fsencode(n))) |
This file contains 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
package unimelb.utils; | |
import java.io.BufferedInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.nio.file.Path; | |
import java.util.zip.CRC32; | |
import java.util.zip.CheckedInputStream; |
This file contains 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 zlib | |
import sys | |
BUFFER_SIZE=8192 | |
def get_crc32(path): | |
with open(path, 'rb') as f: | |
crc = 0 | |
while True: | |
data = f.read(BUFFER_SIZE) |
This file contains 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" |
This file contains 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 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 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 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; |
NewerOlder