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
/** | |
* @file endianness.h | |
* @brief Convert Endianness of shorts, longs, long longs, regardless of architecture/OS | |
* | |
* Defines (without pulling in platform-specific network include headers): | |
* bswap16, bswap32, bswap64, ntoh16, hton16, ntoh32 hton32, ntoh64, hton64 | |
* | |
* Should support linux / macos / solaris / windows. | |
* Supports GCC (on any platform, including embedded), MSVC2015, and clang, | |
* and should support intel, solaris, and ibm compilers as well. |
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
rsync -avz -e "ssh -p 222" hostname.inter.net:/data/filename.ext . --progress --bwlimit=1000 |
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
# Server /etc/ssh/sshd_config | |
AllowTCPForwarding yes | |
# PermitOpen any | |
ssh PROXY_HOSTNAME -D 8888 | |
google-chrome --proxy-server="socks5://localhost:8888" |
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
# Make the clean target work without having to specify anything | |
ifneq ($(filter clean,$(MAKECMDGOALS)),) | |
IMPORTANT_PARAMETER=none | |
endif | |
ifndef IMPORTANT_PARAMETER | |
INTERACT_WITH_USER=1 | |
endif | |
ifeq ($(INTERACT_WITH_USER),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
# Inside the directory that needs to be hashed | |
# recursive, show estimated time, relative paths | |
md5deep -rle -W /path/to/result.md5 * | |
# List files with the same hash, printing the hash-path of each file (remember to keep at least one of them) | |
sort result.md5 | uniq -D -w 32 | |
# Count the number of duplicate files, path to first encountered file with that hash is shown only | sort by frequency | |
sort result.md5 | uniq -cd -w 32 | sort -nr |
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 | |
if [[ ($# -eq 2) ]]; then | |
echo "$0 $@" | |
else | |
echo "Specify IMAGE PROGRAMMER" | |
echo "$0 main.srec mote_0101_ABCD" | |
exit 1 | |
fi |
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 | |
if [[ ($# -eq 2) ]]; then | |
echo "$0 $@" | |
else | |
echo "Specify IMAGE PROGRAMMER" | |
echo "$0 main.srec mote_0101_ABCD" | |
exit 1 | |
fi |