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
import cv2 | |
import sys | |
import os | |
class FaceCropper(object): | |
CASCADE_PATH = "data/haarcascades/haarcascade_frontalface_default.xml" | |
def __init__(self): | |
self.face_cascade = cv2.CascadeClassifier(self.CASCADE_PATH) |
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 | |
#======================= | |
# | |
# IAM Switch Role Shell | |
# | |
#======================= | |
script_name=`basename $0` | |
INI_FILE=$HOME/.aws/config |
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 | |
#--------------------------------------------- | |
# EC2 SSH | |
# | |
# select target from instace list | |
#--------------------------------------------- | |
# | |
# ssh example) $ ec2ssh profile1 | |
# | |
# download file example) |
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
#!/usr/bin/env ruby | |
require 'date' | |
require 'net/smtp' | |
$ACCESS_WRONG_STATUS_MIN = 400 | |
$ACCESS_WRONG_STATUS_MAX = 500 | |
$ACCESS_TIMERANGE_SEC = 3 | |
$ACCESS_COUNT_THRESHOLDS = 2 |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'exifr' | |
filename = ARGV.pop | |
exif = EXIFR::JPEG.new(filename) | |
puts exif.width |
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
db.votes.aggregate([ | |
{ "$unwind": "$votes" }, | |
{ "$group" : {"_id": "$votes", "count": {"$sum": 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
$ brew install python | |
$ sudo pip install ansible |
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
Public Function ExportDatabaseSources(exportDir As String) As Boolean | |
On Error GoTo ErrHandler: | |
Dim db, td, d, c | |
Dim strRootPath As String | |
Set db = Application.CurrentDb | |
strRootPath = exportDir & "\" | |
If Len(Dir(strRootPath, vbDirectory)) = 0 Then |
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
#!/usr/bin/env ruby | |
# | |
# Sending Munin Alert to hipchat | |
# | |
require 'hipchat-api' | |
# | |
# Settings |