Keybase proof
I hereby claim:
- I am mnkhouri on github.
- I am mkhouri (https://keybase.io/mkhouri) on keybase.
- I have a public key ASCseC2ubs56Jyc6LWmUXK6K_nY-YwMyGe5HSpNC9Rayjgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Update System | |
In any scripting language, write a script to update an embedded system. | |
Your embedded system's specifications are completely up to you. Please | |
write down any important details about it. | |
The script should accept two parameters: | |
- url to get the blob from | |
- md5 of the blob |
#!/usr/bin/env python | |
from getpass import getuser, getpass | |
from os.path import expanduser | |
from platform import node | |
from sys import exit | |
try: | |
import github3 | |
except ImportError: | |
print('Module github3 not installed!') | |
print('Installation: pip install --pre github3.py') |
# From http://stackoverflow.com/a/3232082 | |
confirm () { | |
# call with a prompt string or use a default | |
read -r -p "${1:-Are you sure? [y/N]} " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
true;; | |
*) | |
false;; | |
esac |
#!/usr/bin/env bash | |
# Fix locale settings | |
export LANGUAGE=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
sudo dpkg-reconfigure locales | |
sudo locale-gen en_US.UTF-8 | |
sudo dpkg-reconfigure keyboard-configuration |
#!/bin/bash | |
CD_CMD="cd "\\\"$(pwd)\\\"" && clear" | |
osascript &>/dev/null <<EOF | |
tell application "iTerm" | |
activate | |
if (count of windows) = 0 then | |
create window with default profile | |
else |
#!/usr/bin/env node | |
var testZero = 0 | |
if (testZero) { | |
console.log("int 0 evaluated TRUE") | |
} | |
else { | |
console.log("int 0 evaluated FALSE") | |
} |