Skip to content

Instantly share code, notes, and snippets.

Omar A hagope

Block or report user

Report or block hagope

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View system_test_gsheets.py
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
View temp_log.txt
timestamp,temp_f
2017-04-30 13:05:01,71.375
2017-04-30 13:10:01,71.487
2017-04-30 13:15:01,71.487
2017-04-30 13:20:01,71.600
2017-04-30 13:25:01,71.600
2017-04-30 13:30:01,71.600
2017-04-30 13:35:01,71.713
2017-04-30 13:40:01,71.825
2017-04-30 13:45:01,71.825
View temps.csv
timestamp temp_f
2017-04-30 13:05:01 71.375
2017-04-30 13:10:01 71.487
2017-04-30 13:15:01 71.487
2017-04-30 13:20:01 71.600
2017-04-30 13:25:01 71.600
2017-04-30 13:30:01 71.600
2017-04-30 13:35:01 71.713
2017-04-30 13:40:01 71.825
2017-04-30 13:45:01 71.825
@hagope
hagope / fix_exif_dates.sh
Created Jan 19, 2016
There's a bug in the Android Camera that doesn't set Create Date and Date Time Original in the photo's EXIF meta data, but only when the images are NOT set to HDR+
View fix_exif_dates.sh
# There's a bug in the Android Camera that doesn't set Create Date and Date Time Original in the photo's EXIF meta data, but only when the images are NOT set to HDR+
# The following is fix using exiftool (brew install exiftool) to set these fields
# Run these in the terminal in sequence
# First fix DateTimeOriginal
exiftool "-datetimeoriginal<filemodifydate" -r -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' *.jpg
# Then fix CreateDate
exiftool "-createdate<datetimeoriginal" -r -if '(not $createdate or ($createdate eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' *.jpg
@hagope
hagope / dash-listen-3.py
Last active Nov 21, 2015 — forked from courtsimas/dash-listen-3.py
listen on network for push of Amazon dash button; this version uses arp-scan instead of scapy
View dash-listen-3.py
import subprocess
import requests
import time
import os,sys
MAGIC_FORM_URL = 'http://api.cloudstitch.io/...your_url'
def record_wake():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
@hagope
hagope / rename-pictures-for-dropbox.sh
Created Nov 20, 2015
renames jpg files using exif creation date as filename in the same format as Dropbox Camera Uploads folder YYYY-MM-DD HH.MM.SS.jpg
View rename-pictures-for-dropbox.sh
#!/bin/bash
# requires exif command line utility
shopt -s nocaseglob #find both *.jpg and *.JPG
for i in *.JPG; do
j=`exif -t 0x9003 "$i" | grep Value: | sed 's/Value://' | sed s/:/-/g | sed s/-/./3 | sed s/-/./3`.jpg
mv -i "$i" "$j"
done
@hagope
hagope / windows-power-commands.txt
Created Aug 3, 2015
useful command line hacks for windows command prompt and powershell
View windows-power-commands.txt
# Get hard drive info
wmic logicaldisk get
# Quicky create a system image backup
wbAdmin start backup -backupTarget:E: -include:C: -allCritical -quiet
View QlikView_Convert_from_Unix_Timestamp.qvs
// Solution 1:
Timestamp = ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (<timestamp_field> / 86400)), '<time_zone>')
// Solution 2:
Timestamp = ConvertToLocalTime(Date(25569 + (<timestamp_field> / 86400)), '<time_zone>')
// my need
ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (epoch_ts / 86400)))
View pthread_join.c
/*****************************************************************************
* FILE: join.c
* DESCRIPTION:
* This example demonstrates how to "wait" for thread completions by using
* the Pthread join routine. Threads are explicitly created in a joinable
* state for portability reasons. Use of the pthread_exit status argument is
* also shown. Compare to detached.c
* AUTHOR: 8/98 Blaise Barney
* LAST REVISED: 01/30/09
******************************************************************************/
@hagope
hagope / stock.sh
Created Aug 6, 2014
Realtime Stock Quote from Google Finance using cURL
View stock.sh
#!/bin/bash
# Usage: stock.sh TWTR 30
# Say TWTR current price every 30 seconds
while true
do
curl -s https://www.google.com/finance?q=$1 | grep ref_ -m 1 | sed 's|<[^>]*>||g' | say
sleep $2
done
You can’t perform that action at this time.