Skip to content

Instantly share code, notes, and snippets.

@realsby
realsby / https2http_redirect.conf
Last active April 23, 2018 17:42
Apache2 https to http
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName maindomain.com
ServerAlias otherdomain.com
SSLEngine on
SSLCertificateFile /var/Certs/star-bundle.cert
SSLCertificateKeyFile /var/Certs/cert.key
SSLProtocol -ALL +SSLv3 +TLSv1
@realsby
realsby / sudoers
Created April 17, 2018 22:50
/etc/sudoers sample
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults
@realsby
realsby / Vagrantfile
Created April 23, 2018 16:03
Vagrant Windows Sample
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box_check_update = false
config.vm.network :private_network, ip: "192.192.0.92"
config.vm.synced_folder "./vagrant", "/vagrant", id: "vagrant-root", :owner => "www-data", :group => "www-data", mount_options: ["dir_mode=0777,file_mode=0777"], smb_username:"WindowsUserName", smb_password:"WindowsUserPassword", type: "smb"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
end
end
@realsby
realsby / mobile_os.js
Created April 23, 2018 17:41
Redirect mobile app in browser
getMobileOperatingSystem();
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/android/i.test(userAgent)) {
window.location = "https://play.google.com/store/apps/details?id=TTTTTTT"
return "Android";
}
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
window.location = "https://itunes.apple.com/us/app/TTTTTTT/TTTTTTT";
return "iOS";
@realsby
realsby / prepare_disk.sh
Last active May 3, 2018 18:04
vagrant new ubuntu
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install zsh zip git-core -y
sudo apt-get install python-virtualenv python-pip python-dev python-yaml python-lxml python-cffi python3-venv python3-pip python3-dev python3-yaml python3-lxml python3-cffi libpq-dev gettext -y
sudo apt-get install build-essential libssl-dev libffi-dev -y
sudo apt-get install libxml2-dev libxslt1-dev libjpeg-dev libpng-dev libtiff5 libfreetype6-dev libwebp-dev openjpeg-tools libcairo2 libpango1.0-0 libgdk-pixbuf2.0-0 shared-mime-info -y
# If GZIP issue : sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev -y
# sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
@realsby
realsby / Vagrantfile
Last active April 24, 2018 22:03
Vagrant ubuntu mac config
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box_check_update = false
config.vm.network :private_network, ip: "192.192.0.92"
config.vm.synced_folder "vagrant", "/Vagrant", id: "vagrant-root", :nfs => true
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
end
end
@realsby
realsby / .zshrc
Created April 24, 2018 08:33
pyenv support for zsh
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then;
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"
fi
@realsby
realsby / sublime_preferences
Last active April 25, 2018 17:59
SublimeText3 Settings
Favorite Packages
[
"All Autocomplete",
"Anaconda",
"BracketHighlighter",
"Cobalt2 Flat Theme",
"GitGutter",
"Markdown Extended",
"Package Control",
@realsby
realsby / yusuf.public_key
Last active May 2, 2018 19:50
My Global Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSNkDOWVNxTy/qM21B/ws3o8mXJCUce7Q0nu2+/lYYZS/JsBUdd+YtjLrLpv0xkhJYKVBv2BPrJLKOJKTjDEa5AOZ1+7iFmeSydPsSDecmb2e8Q4zm3SCIW5dHyUcY53VsFnmaOg4Gk9C8aMZ4UoJbzlZprqeZcSrv3uSKVxBM5VwMMrenIVPeOcmiYp4LfwTwolEBDkJJfibHTF+0FgS990p7sYA9p9ASvdHR9FVFQtyo1VXAozWrBOp/aKtCgp+lPsBoTpdxsCOnDvUsxW13JHydjcV02ZjICpxdjnpRiCWhVf9xUplMfhj008RuAsYGYT5jsEfB1Kn97N2LNRy7 yusuf@ozer
@realsby
realsby / tips.sh
Last active May 4, 2018 13:20
Common needs
Cache kullanmaz herseyi sifirdan tekrar indirip kurar..
pip install -r requirements.txt --ignore-installed --force-reinstall --upgrade --no-cache-dir
Gitde silmesini ama localde silmek istemedigin dosyayi boyle diyip commit atarsin. ornegin .db dosyasi
git rm --cached filename
Gitde ignore edilmis dosyalari zorla commite eklemek icin force kullanilir
git add -f html/.