Skip to content

Instantly share code, notes, and snippets.

View mehmetboraezer's full-sized avatar

Mehmet Bora Ezer mehmetboraezer

View GitHub Profile
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
@mehmetboraezer
mehmetboraezer / read-access.sql
Created October 4, 2017 08:49 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@mehmetboraezer
mehmetboraezer / letsencrypt-GAE.md
Created November 7, 2017 08:18
Set up HTTPS for Google App Engine using Let's Encrypt

Copied from https://www.jeffgodwyll.com/posts/2016/letsencrypt

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. Let’s Encrypt is a service provided by the Internet Security Research Group (ISRG)

About Let's Encrypt

This post won't go into details as to what Let's Encrypt is about. We should probably read the FAQs if we want to learn more.

Until the Google App Engine Team fully automate the process of using Let's Encrypt on Google App Engine or even provide some sort of API to handle certs, we'll probably have to find ways of either automating the process just a little bit or stick to some other easier cert authority.

@mehmetboraezer
mehmetboraezer / taggable.rb
Created October 19, 2018 12:29 — forked from ayrton/taggable.rb
Testing Active Support concerns with rspec in isolation. See first comment for more information.
module Taggable
extend ActiveSupport::Concern
included do
attr_accessible :tags
after_save :set_tags
after_destroy :unset_tags
end
@mehmetboraezer
mehmetboraezer / movie.2.gif.md
Created January 6, 2019 20:21
Convert movies to gif in OS X Mac

#OS X Movie to animated GIF

ffmpeg -i movie-name.mp4 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=0 --delay=3 > movie-name.gif

##Options

  • -r 10 tells ffmpeg to reduce the frame rate from 25 fps to 10
  • -s 600x400 tells ffmpeg the max-width and max-height
@mehmetboraezer
mehmetboraezer / analytics.rb
Created January 9, 2019 14:07 — forked from CoryFoy/analytics.rb
An example of calling the Analytics API using machine creds and the V4 API from Ruby
require 'google/apis/analyticsreporting_v4'
require 'googleauth'
include Google::Apis::AnalyticsreportingV4
include Google::Auth
VIEW_ID = "12345678" #your profile ID from your Analytics Profile
SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'
@client = AnalyticsReportingService.new
@mehmetboraezer
mehmetboraezer / clamav-mac.md
Created January 16, 2019 08:12 — forked from Uchean/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

@mehmetboraezer
mehmetboraezer / quicktime-hangouts-recording.md
Created October 15, 2019 08:25 — forked from caseywatts/quicktime-hangouts-recording.md
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:

  • the system output audio (from them)
  • the microphone audio (from you)
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session