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 | |
seconds_to_wait = 1*60*60 # 1 hour | |
$directories_to_watch = { | |
'/Users/blaze/Desktop/folder1' => 1*1024, #bytes | |
'/Users/blaze/Desktop/folder2' => 1*1024 #bytes | |
} | |
def alert_size_exceeded directory, size | |
# you can replace this by an sending an email |
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 'open-uri' | |
require 'json' | |
print 'Github Username: ' | |
username = gets.chomp | |
# get gists | |
puts 'Downloading gists list' | |
gists_str = open("https://api.github.com/users/#{username}/gists").read |
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 'gosu' # gem install gosu | |
$width, $height = 200, 200 | |
$number_of_v_lines,$number_of_h_lines = 10, 10 | |
$chars = ('a'..'z').to_a | |
class Entity | |
def initialize(x,y,vel, win) | |
@pos, @vel = {x:x, y:y}, vel |
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
# IMPORTANT: this example is potentially out of date. The latest version can be found here: https://github.com/papertrail/remote_syslog2/blob/master/examples/remote_syslog.ebextensions.config | |
# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/ | |
# Usage: | |
# - replace <VERSION> with the version of remote_syslog2 you want to use. Example: .../download/v0.14/remote_syslog_linux_amd64.tar.gz | |
# - replace <YOUR-TRACKED-FILES> with the files you want to monitor for new log lines. Example: - /var/log/httpd/access_log | |
# - replace <YOUR-APP-NAME> with the name of the application | |
# - replace <YOUR-LOG-DESTINATION> and <YOUR-PORT-NUMBER> with the values shown under log destinations: https://papertrailapp.com/account/destinations | |
sources: |
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 | |
# Interpret whether the input needs to go to ansible, or ansible-playbook and run appropriately | |
# First update the git repos for each project | |
/usr/bin/update-git-repos | |
export ANSIBLE_FORCE_COLOR=1 | |
export ANSIBLE_RETRY_FILES_ENABLED=False |
FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.
Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:
ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4
Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.
OlderNewer