Skip to content

Instantly share code, notes, and snippets.

View janhenrik's full-sized avatar

Jan Henrik Gundelsby janhenrik

View GitHub Profile
@janhenrik
janhenrik / artifactory.rb
Created September 20, 2012 10:54
artifactory
printf "Laster opp #{local_file} til #{rest_of_path}..."
begin
res = RestClient.put(url, File.new(local_file))
unless res.code >= 200 and res.code < 300
raise "Opplasting til Artifactory svarte ikke med HTTP OK, feilmelding var: #{res.message}"
end
puts "Opplasting vellykket! Status: #{res.code}"
rescue => e
@janhenrik
janhenrik / git_reset.sh
Created September 20, 2012 10:54
git_reset
git reset --hard origin/HEAD
#!/bin/bash
HASH="6d1c3b49ec99b098212d357e0d8e6add"
URL="http://store.apple.com/no/browse/home/shop_iphone/family/iphone"
NEW_HASH=`curl -s $URL | md5 -q`
if [[ "${HASH}" == "${NEW_HASH}" ]]; then
echo "NOTICE: hasn't changed"
else
echo "ALERT: [$URL] CHANGED from [$HASH] to [$NEW_HASH]"
mail -s "ALERT: [$URL] CHANGED from [$HASH] to [$HASHVALUE] - buy the iPhone 5!!!" my@email.com </dev/null
fi
### Keybase proof
I hereby claim:
* I am janhenrik on github.
* I am sirjanhenrik (https://keybase.io/sirjanhenrik) on keybase.
* I have a public key ASAiO9kOuwbi1bop_hYVS3Esc3hPtbUEFWxuXcPRQ-713go
To claim this, I am signing this object: