Skip to content

Instantly share code, notes, and snippets.

View mehmetboraezer's full-sized avatar

Mehmet Bora Ezer mehmetboraezer

View GitHub Profile
@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 / 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 / without-disconnect.md
Last active June 23, 2017 08:48
Lock OSX without wireless disconnect
cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en1 prefs DisconnectOnLogout=NO
  • create new cron script

     touch /etc/cron.daily/cleanup
    
  • set executable permission

sudo chmod +x /etc/cron.daily/cleanup

@mehmetboraezer
mehmetboraezer / fstrim
Created June 22, 2017 22:07
/etc/cron.daily/fstrim
#!/bin/sh
LOG=/var/log/fstrim/trim.log
echo "Starting trim $(date -R) " >> $LOG
fstrim -v -a >> $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 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.
#
# 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.
#
@mehmetboraezer
mehmetboraezer / read-only.sql
Created April 26, 2017 08:17
Create read-only user for postgresql
CREATE ROLE 'new_username' WITH LOGIN PASSWORD 'new_password' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL 'infinity';
GRANT CONNECT ON DATABASE 'db_name' TO 'new_username';
GRANT USAGE ON SCHEMA public TO 'new_username';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO 'new_username';
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO 'new_username';
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO 'new_username';
@mehmetboraezer
mehmetboraezer / permission.md
Last active March 23, 2017 13:53
Resolve of the permission denied error in Brew
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
@mehmetboraezer
mehmetboraezer / appium.md
Created March 17, 2017 16:41
Appium iOS Environment Setup Steps without GUI

Appium iOS Environment Setup Steps

After Installation OSX

  • Remove unnecessary dock items.

  • Allow remote login (ssh) and screen sharing on system preferences.

iTunes Configuration