To bookmark online knowledge resources and trendy new technologies in the field of computer science.
[TOC]
#!/bin/bash | |
#compareHash(){ | |
if [[ -f $1 ]]; then # $1 should always be a file | |
if [[ -f $2 ]]; then | |
# $2 can be a file to be compared with $1 using sha256 | |
[[ $(sha256sum "$1" | cut -d ' ' -f 1) == "$(sha256sum "$2" | cut -d ' ' -f 1)" ]] && echo "Both files are same." || echo "Files are different." | |
else | |
# $2 can be a string containing the hash to be checked for $1 | |
hash=$2 | |
if [[ ${#hash} == 32 ]]; then |
-> Get scancodes & device identification info using evtest/evemu-record.
sudo evtest | grep -B1 "value 1"