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 -eE | |
main() { | |
local -A physicalIds coreIds | |
local count=0 | |
local name _ value | |
while IFS=$' \t' read -r name _ value; do | |
case "$name" in | |
processor) count=$((count + 1)) ;; |
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 | |
waitPortOpen() { | |
local host=$1 | |
local port=$2 | |
local timeoutSeconds=$3 | |
local intervalSeconds=$4 | |
local connectTimeoutSeconds=$5 | |
if [[ -z "$intervalSeconds" ]]; then |
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
trap onError ERR | |
onError() { | |
local exitCode=$? command=(${BASH_COMMAND}) | |
if [[ ${BASH_SUBSHELL} -gt 0 ]]; then | |
exit ${exitCode} | |
fi | |
echo -e "\nERROR: Failed with exit code $exitCode when executing: ${command[@]}" >&2 |
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
public class WaitSpinLocksExample { | |
public static void main(String[] args) { | |
Thread thread1, thread2; | |
Base bad = new BadImplementationSubjectToSpuriousWakeup(); | |
thread1 = new Thread(bad::print); | |
thread2 = new Thread(bad::calculate); | |
thread1.start(); | |
thread2.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
import java.io.*; | |
import java.util.*; | |
import java.security.SecureRandom; | |
public class SimpleIoTest { | |
private static final int BLOCK_SIZE = 1024 * 1024; | |
private static final int TOTAL_SIZE = 1024 * 1024 * 1024; | |
private static final int SEQUENTIAL_ITERATIONS = 32; | |
private static final int RANDOM_ITERATIONS = 16; |
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 Power-Delete { | |
[CmdletBinding()] | |
param( | |
[parameter(Position = 0, ValueFromRemainingArguments = $true, ValueFromPipelineByPropertyName = $true)] | |
$FullName, | |
[switch] | |
$AllHardLinks | |
) | |
process { |
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
sudo tail -c 29 /sys/firmware/acpi/tables/MSDM && echo |
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
(module | |
(func $add (param $a i32) (param $b i32) (result i32) | |
get_local $a | |
get_local $b | |
i32.add | |
) | |
(export "add" (func $add)) | |
) |
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 com.perihelios.parser.javaregex | |
import com.perihelios.parser.javaregex.helper.TreeMatcher | |
import org.junit.Assert | |
import org.junit.Test | |
class SimpleTests { | |
private TreeMatcher treeMatcher = new TreeMatcher(JavaRegexLexer, JavaRegexParser, "regex") | |
@Test |
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
gcc -c main.c -o main.o | |
gcc -c framework.c -o framework.o | |
gcc -c test.c -o test.o | |
gcc -c mock.c -o mock.o && ar rcs mock.a mock.o; rm mock.o | |
ld custom.ld test.o main.o framework.o \ | |
-L. --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker \ | |
/lib64/ld-linux-x86-64.so.2 \ | |
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/crt1.o \ | |
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/crti.o \ |
NewerOlder