Skip to content

Instantly share code, notes, and snippets.

View ismailakbudak's full-sized avatar

Ismail Akbudak ismailakbudak

View GitHub Profile
#!/bin/bash
# Yorum satırı
# İlk satırdaki komut ise yorum değildir.
# Bu satırın anlamı bu scripti bash shell de çalıştır.
# Terminali temizle komutu
clear
@ismailakbudak
ismailakbudak / ubuntu-tool.sh
Last active August 29, 2015 14:19
Install tools
#!/bin/bash
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"
}
## Debian-Ubuntu package update
fancy_echo "Updating system packages ..."
sudo apt-get update
@ismailakbudak
ismailakbudak / ubuntu-rails.sh
Last active August 29, 2015 14:19
Ubuntu install ruby on rails environment
#!/bin/bash
## Exit trap
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"
@ismailakbudak
ismailakbudak / ubuntu-laravel.sh
Last active August 29, 2015 14:19
Laravel tools installation
#!/bin/bash
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"
}
## Install php5
fancy_echo "Installing php5"
@ismailakbudak
ismailakbudak / deploy-user-ruby-environment.sh
Last active August 31, 2015 20:45
deploy-user-ruby-environment.sh
## Run this command with deploy user
# define user home path
user_path=/home/deploy
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"
}
fancy_echo "Installing rbenv..."
git clone git://github.com/sstephenson/rbenv.git $user_path/.rbenv
@ismailakbudak
ismailakbudak / usefull commands
Last active April 28, 2016 09:34
Server side commands
# Change ssh port
sudo vi /etc/ssh/sshd_config
port 22
sudo service ssh restart
# Language problem solution
sudo vi /etc/environment
LC_ALL="en_US.utf8"
LANGUAGE="en_US.utf8"
sudo dpkg-reconfigure locales
@ismailakbudak
ismailakbudak / server-base.sh
Last active July 28, 2016 12:27
server-base.sh
## Run this script with root user
# After installation check this
# vi /etc/ssh/sshd_config # Change ssh post
# vi /etc/environment # Write below locales
# LANGUAGE="en_US.utf8"
# LC_ALL="en_US.utf8"
# dpkg-reconfigure locales # Configure locales
## Fancy echo
fancy_echo() {
@ismailakbudak
ismailakbudak / add-ssh-keys.sh
Last active January 23, 2017 16:45
Add your authorized_keys to server
# Deploy user
deploy_user=deploy
# Github usernames for access with ssh to deploy user. They should be separater with one space.
usernames=(ismailakbudak)
# Check user is exist, maybe some errors occurred
id -u $deploy_user &> /dev/null
if [ $? -ne 0 ]
then
@ismailakbudak
ismailakbudak / commands
Last active March 29, 2018 18:36
Useful git commands
$ git log --oneline
$ git log --oneline --decorate
$ git log --oneline --decorate --all
$ git log --oneline --decorate --all --graph
$ git log --oneline --decorate --all --graph --simplify-by-decoration
$ git reset ~HEAD
$ git commit --amend
#!/bin/bash
# Bu kodları çalıştırmak için bu dosyayı name.sh olarak kayıt edip bulunduğu dizine gidin ve
# terminalden şu kodu çalıştırın
# sh name.sh /directory/subdirectory
# dosya isminden sonraki /directory/subdirectory yedeği oluşturulacak dizini belirtir
# Terminali temizle
clear