Skip to content

Instantly share code, notes, and snippets.

@dogukancagatay
dogukancagatay / index.md
Created January 23, 2013 16:33
Showing latest posts on the index (or whatever) page on a Jekyll Bootstrap system. Simply add latest_posts.html to _includes/JB/ and copy the code on index.md file where you want to add the posts.

{% for post in site.posts limit:5 %} {% include JB/latest_posts.html %} {% endfor %}

@dogukancagatay
dogukancagatay / linuxorgtr.repo
Created April 3, 2013 10:22
CentOS linux.org.tr Repo Configuration
########################
# CentOS linux.org.tr Repo Configuration
#
# Installation : Put the *.repo file
# in /etc/yum.repos.d/ and disable other
# mirror repo entries that points to the same repo
#
# Dogukan Cagatay <dcagatay@gmail.com>
########################
@dogukancagatay
dogukancagatay / move_mysql.sh
Last active December 27, 2015 18:19
Move MySQL database and users to a new MySQL server -Doesn't copy user passwords. Ref: http://www.cyberciti.biz/tips/move-mysql-users-privileges-grants-from-one-host-to-new-host.html
#!/bin/bash
# Copyright (c) 2005 nixCraft project <http://cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# Author Vivek Gite <vivek@nixcraft.com>
# ------------------------------------------------------------
# SETME First - local mysql user/pass
_lusr="root"
_lpass="MySQLPassword"
_lhost="localhost"
@dogukancagatay
dogukancagatay / turkish_to_latex.sh
Last active December 28, 2015 17:29
Latex dökümanındaki Türkçe karakterleri gösterilebilecek hale dönüştürmek icin sed komutu.
sed -e 's/ğ/\\u{g}/g' -e 's/Ğ/\\u{G}/g' -e 's/ç/\\c{c}/g' -e 's/Ç/\\c{C}/g' -e 's/ş/\\c{s}/g' -e 's/Ş/\\c{S}/g' -e 's/ü/\\"{u}/g' -e 's/Ü/\\"{U}/g' -e 's/ö/\\"{o}/g' -e 's/Ö/\\"{O}/g' -e 's/ı/{\\i}/g' -e 's/İ/\\.{I}/g' input.txt > output.txt
@dogukancagatay
dogukancagatay / Makefile
Last active September 21, 2022 16:03
List OpenCL devices on the system using OpenCL C++ Wrapper.
UNAME_S := $(shell uname -s)
# -std=c++11 -Wall -march=native
ifeq ($(UNAME_S),Linux)
CXX=clang++
CPPFLAGS=-O3
LDFLAGS=-O3
LDLIBS=-lOpenCL
endif
ifeq ($(UNAME_S),Darwin)
@dogukancagatay
dogukancagatay / Makefile
Created June 27, 2014 18:14
Simple latex Makefile using latexmk
# Latex Makefile using latexmk
# Modified by Dogukan Cagatay <dcagatay@gmail.com>
# Originally from : http://tex.stackexchange.com/a/40759
#
# Change only the variable below to the name of the main tex file.
PROJNAME=main
# You want latexmk to *always* run, because make does not have all the info.
# Also, include non-file targets in .PHONY so they are run regardless of any
# file of the given name existing.
@dogukancagatay
dogukancagatay / gcc_compile.sh
Last active April 17, 2016 14:53
Scripts for compiling compilers gcc-4.8.3 and llvm-clang-3.4.
#!/usr/bin/env bash
#####################
## Set build prefix and source code dir
#####################
BUILD_PREFIX="/home/dogukan/local"
SRC_DIR="/home/dogukan/src"
BUILD_DIR="/home/dogukan/src/build"
@dogukancagatay
dogukancagatay / oracle_java_install_ubuntu.sh
Last active November 21, 2019 12:00
Oracle Java Install Ubuntu 16.04
#!/usr/bin/env bash
JAVA_VERSION="8"
sudo apt-get install --yes python-software-properties
sudo add-apt-repository --yes ppa:webupd8team/java
sudo apt-get update
sudo apt-get install --yes "oracle-java$JAVA_VERSION-installer"
sudo apt-get install --yes "oracle-java$JAVA_VERSION-set-default"
@dogukancagatay
dogukancagatay / generate_password.sh
Created June 28, 2018 14:56
Terminal generate password
LC_ALL=C tr -dc 'A-Za-z0-9_!@#$%^&*()\-+=' < /dev/urandom | fold -w30 | head -n1
@dogukancagatay
dogukancagatay / build.gradle
Last active July 18, 2018 06:43
Downloads JAR dependencies with Gradle and saves them on `lib` path.
apply plugin: 'groovy'
repositories {
jcenter()
}
dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
compile 'org.apache.commons:commons-io:1.3.2'
}