Skip to content

Instantly share code, notes, and snippets.

View halilim's full-sized avatar

Halil Özgür halilim

View GitHub Profile
@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.
@halilim
halilim / Server Security and Performance - Base OS.md
Last active July 20, 2018 20:04
Server Security / Performance - Base OS
Notes
Preliminary packages
  • Development packages, you'll most probably need them
    • Ubuntu: sudo apt-get install build-essential
    • CentOS: yum groupinstall 'Development Tools'
  • Git

Keybase proof

I hereby claim:

  • I am halilim on github.
  • I am halil (https://keybase.io/halil) on keybase.
  • I have a public key ASCTFoy6Tqz9aQRrOCeOjMkn9M_xyoPNpU3g5_mbYMCpTgo

To claim this, I am signing this object:

CIPHER = { 'a' => 'n', 'b' => 'o', 'c' => 'p', 'd' => 'q',
'e' => 'r', 'f' => 's', 'g' => 't', 'h' => 'u',
'i' => 'v', 'j' => 'w', 'k' => 'x', 'l' => 'y',
'm' => 'z', 'n' => 'a', 'o' => 'b', 'p' => 'c',
'q' => 'd', 'r' => 'e', 's' => 'f', 't' => 'g',
'u' => 'h', 'v' => 'i', 'w' => 'j', 'x' => 'k',
'y' => 'l', 'z' => 'm' }.freeze
REVERSE_CIPHER = CIPHER.invert.freeze
@halilim
halilim / Chrome_remove_auto_search_engines.js
Last active July 4, 2017 11:58
Remove automatically created search engines from Chrome.
var others = document.querySelectorAll("#other-search-engine-list .deletable-item:not([lead=lead])");
var toBeRemoved = [...others].filter(function(listItem) {
var keyword = listItem.querySelector(".keyword-column .static-text").innerText;
return keyword.includes(".") &&
listItem.querySelector(".url-column .static-text").innerText.toLowerCase().includes(
keyword.toLowerCase()
);
});
if (confirm(`Search engines: \
${document.querySelectorAll("#default-search-engine-list .deletable-item").length} default, \
@halilim
halilim / daily_whois_halil_im.js
Last active May 24, 2017 18:57
Simple AWS Lambda script to notify by SNS if a domain is expiring within 3 days
// Simple AWS Lambda function to notify if the domain halil.im is expiring within 3 days.
// Tested on Node.js 6.10 runtime.
// * Create an SNS topic and an SNS subscription with the email you want to be notified
// * Create the function with a trigger of "CloudWatch Events - Schedule" with rate: 1 day
// * Provide the SNS topic ARN to the function as an environment variable
// * Create and attach a policy to the role of this function with sns:Publish on the SNS topic ARN
// (logs:CreateLogGroup, logs:CreateLogStream & logs:PutLogEvents on a logs ARN should already be there)
/* eslint-env node,es6 */
/* eslint no-console: "off" */
@halilim
halilim / Testing & quality assurance - tools and the list of the things to test.md
Last active May 13, 2017 18:49
Testing & Q&A - tools and the list of the things to test

A list of things that can/should be tested, preferably before commit/receive.

General

Tools

@halilim
halilim / Ubuntu 13.10 Install (Windows Dual Boot).md
Last active March 18, 2017 16:57
Ubuntu 13.10 Install (Windows Dual Boot) - Some issues and how-to for installing

Notes

  • Replace “halil” with your username.
  • Work in progress.

GPU/Graphics Driver

Nvidia

@halilim
halilim / Amazon Elastic Beanstalk Rails.md
Last active December 23, 2016 09:42
"Actually" getting Amazon Elastic Beanstalk to work for a Rails 4 application with 12 Factor and Heroku compatibility

Last Status

  • 2015-11-10: Abandoned AWS EB.

    Got Create environment operation is complete, but with errors. For more information, see troubleshooting documentation..

    Tried to set up CloudWatch Logs but got The following resource(s) failed to create: [AWSEBCWLHttp4xxMetricFilter, AWSEBCWLHttp5xxMetricFilter].

require 'set'
def find_uniq(ids)
# O(n) space
# uniqs = Set.new
# ids.each do |id|
# uniqs.delete(id) unless uniqs.add?(id)
# end
# uniqs.first
# O(1) space