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 | |
function main { | |
set -eo pipefail | |
local main_pid | |
main_pid="$(systemctl show --property MainPID --user k3s-rootless | cut -d '=' -f2 | tr -d '\n')" | |
local exe_pid | |
for f in /proc/*/status; do |
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 mygo { | |
MINGW_GIT="$WINDOWS_GIT/mingw64/bin"; | |
PATH=$MINGW_GIT:$PATH; | |
printf "Running go with the Windows installation of Git.\n"; | |
$GOBIN/go $@; | |
PATH=`echo $PATH | sed "s,$MINGW_GIT\:,,g"`; | |
printf "Resetting \$PATH."; | |
} | |
alias go=mygo |
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
start := time.Now() | |
getElapsed := func (start time.Time) { | |
elapsed := time.Now().Sub(start).Seconds() | |
log.Printf("Completed in %s seconds.", strconv.FormatFloat(elapsed, 'E', -1, 64)) | |
} | |
defer getElapsed(start) |
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/bash | |
host=abc-prod-db | |
dbs=(a_metrics b_metrics c_metrics) | |
ignored_table=irrelevant_table | |
time=$(date +'%H%M%S') | |
day=$(date +'%F') | |
migrate_cache=/tmp/migrate_cache |
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
// Old | |
if ((additionalFiles != null) && !additionalFiles.isEmpty()) { | |
listOfNonSyncFiles.put(Constants.ADDITIONAL_FILES, additionalFiles.stream().map( | |
// just the filename | |
doc -> doc.getName().toLowerCase())//.filter(s -> !s.startsWith(Constants.MANIFEST_FILENAME)) | |
.sorted().collect(Collectors.toList())); | |
additionalFiles.stream().forEach(s -> log.info(s.getName() + "")); | |
} | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<e:list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:e="http://www.loandox.org/ExamSchema" xsi:schemaLocation="http://www.loandox.org/ExamSchema ExamSchema.xsd "> | |
<e:file> | |
<e:name>absurdlyLargeFile.pdf</e:name> | |
</e:file> | |
<e:file> | |
<e:name>anotherAbsurdlyLargeFile.pdf</e:name> | |
</e:file> | |
<e:file> | |
<e:name>aThirdAbsurdlyLargeFile.pdf</e:name> |
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
// org.yournamespace.Store.java | |
@Service | |
public class Store { | |
private Map<String, Info> fileState; | |
public Store(Map fileState) { | |
this.fileState = fileState; | |
} | |
@Bean |
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
@Controller | |
public class Uploads { | |
// ... | |
@RequestMapping(value="/uploads", method={ RequestMethod.HEAD }) | |
public ResponseEntity<?> headUploads( | |
@RequestHeader(value="Upload-Metadata") String meta, | |
@RequestHeader(value="Tus-Resumable") String ver | |
) { | |
// ... |
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
try { | |
User user = getAuthenticatedUser(); | |
FileInfo fileInfo = InfoFactory.createFileInfo( | |
uploadLength, | |
uploadMetadata, | |
user != null ? user.getUsername() : "", | |
null | |
); |
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
@PostMapping("/resumable_uploads") | |
@Timed | |
public ResponseEntity<?> createResumableUpload( | |
@RequestHeader(value="Content-Length") Long contentLength, | |
@RequestHeader(value="Upload-Length") Long uploadLength, | |
@RequestHeader(value="Tus-Resumable") String protocolVer, | |
@RequestHeader(value="Upload-Metadata") String uploadMetadata | |
) throws URISyntaxException { |
NewerOlder