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 | |
set -euo pipefail | |
# Collect serial number | |
SERIAL=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $NF}') | |
HOSTNAME=$(scutil --get ComputerName 2>/dev/null || echo "UnknownHost") | |
OUTDIR="/tmp/fv-diagnostics-${SERIAL}-$(date +%s)" | |
ZIPFILE="/tmp/${SERIAL}.zip" |
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
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' | |
git clone --bare [email protected]:osdouglas/.dotfiles.git $HOME/.dotfiles | |
dotfiles checkout | |
dotfiles config status.showUntrackedFiles no |
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
for idx = 1, 5 do repeat | |
print(1) | |
print(2) | |
print(3) | |
do break end -- goes to next iteration of for | |
print(4) | |
print(5) | |
until true end |
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 <CommonCrypto/CommonDigest.h> | |
@interface NSString (MD5) | |
- (NSString *)MD5String; | |
@end | |
@implementation NSString (MD5) |
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
#include <CommonCrypto/CommonDigest.h> | |
unsigned char digest[CC_SHA1_DIGEST_LENGTH]; | |
NSData *stringBytes = [someString dataUsingEncoding: NSUTF8StringEncoding]; /* or some other encoding */ | |
if (CC_SHA1([stringBytes bytes], [stringBytes length], digest)) { | |
/* SHA-1 hash has been calculated and stored in 'digest'. */ | |
... | |
} |
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
tshark -r <file> -O nfs -P |
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
#include <stdio.h> | |
typedef union | |
{ | |
short s; | |
char c; | |
} | |
sc; | |
int main( void ) | |
{ | |
sc u; |
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 | |
path="$( which $1 )" | |
echo $1 path is $path | |
sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' $path | |
ldid -s $path |