Skip to content

Instantly share code, notes, and snippets.

View halilim's full-sized avatar

Halil Özgür halilim

View GitHub Profile
@halilim
halilim / On the names.md
Last active August 29, 2015 14:05
Should we store names in a single field or in multiple fields (e.g. first/last name-wrong naming BTW)?

Security

  • If you don't have a really loaded CPU/harddisk (or have a good performance CPU/harddisk - in practice anything with an i5/i7 CPU should be OK) you should use full disk encryption - FileVault 2 if you have anything in your computer that needs security/privacy.

Hardware/drivers etc

(["Developers"]*3).join(", ")

@halilim
halilim / Copy_districts.sql
Last active August 29, 2015 14:03
Copy districts from one db to another with differing province id's.
INSERT districts
SELECT
NULL
, district_other.name
, district_other.province_other_id
, IFNULL(province_other.name, '')
FROM other_db.district_other
LEFT JOIN other_db.province_other ON province_other.id = district_other.province_other_id
;
@halilim
halilim / git_pull_subdirs.sh
Created June 17, 2014 19:57
Git pull subdirectories
for dir in ./*; do (echo "- $dir" && cd "$dir" && git pull); done
* -A in SSH enables agent forwarding.
* -p 2122 is not needed if you use the default port of 22.
* Replace SSH_USER and example.com with your own values.
* Example run: $ envoy run deploy_demo
* --no-scripts because Laravel composer.json's post-install-cmd includes optimize, which is already done by php artisan dump-autoload
@servers(['test' => '-A -p 2122 -l user test.example.com', 'prod' => '-A -p 2122 -l user example.com'])
@task('install_test', ['on' => ['test']])
cd project
@halilim
halilim / Solr Field Manual.md
Last active August 29, 2015 13:59
Solr Field Manual

Solr Field Manual

This is a specific setup for use with periodic MySQL import, but can be used as a general solution by excluding the irrelevant parts.

Legend

Code Description
<SOLR> E.g.: /var/lib/tomcat#/solr, /etc/solr, ...
<CORE> Core name
@halilim
halilim / Nginx and Phusion Passenger on Ubuntu 12.04.md
Created April 3, 2014 08:12
Install Nginx and Phusion Passenger on Ubuntu 12.04

Nginx

sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx

@halilim
halilim / PostgreSQL 9.3-latest on Ubuntu 12.04.md
Created April 2, 2014 15:30
Install PostgreSQL 9.3/latest on Ubuntu 12.04
sudo nano /etc/apt/sources.list.d/pgdg.list
# - Add
# deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
# - and save
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 libpq-dev
sudo nano /etc/postgresql/9.3/main/pg_hba.conf
@halilim
halilim / rails_admin.tr.yml
Last active September 28, 2019 10:17 — forked from paracycle/rails_admin.tr.yml
rails_admin tr locale
tr:
admin:
js:
true: Doğru
false: Yanlış
is_present: Mevcut
is_blank: Boş
date: Tarih ...
between_and_: ... ile ... arası
today: Bugün
@halilim
halilim / CentOS_searchd_initd.sh
Last active February 26, 2019 17:16
CentOS sphinx searchd service init.d template
#!/bin/bash
#
# chkconfig: 2345 95 20
# description: Sphinx searchd for example app.
# processname: searchd_example
SEARCHD=/usr/local/bin/searchd
CONF=/home/user/app/sphinx.conf
# Source function library.