Skip to content

Instantly share code, notes, and snippets.

View f9n's full-sized avatar
💭
I may be slow to respond.

Fatih Sarhan f9n

💭
I may be slow to respond.
View GitHub Profile
@f9n
f9n / convert-pptX-pdf.sh
Created January 19, 2018 22:33
Convert all ppt files to pdf
#!/usr/bin/env bash
libreoffice --headless --invisible --convert-to pdf *.ppt
@f9n
f9n / Readme.md
Last active February 2, 2018 22:56
Vagrant Vms for Ansible

Vagrant Vms for Ansible

$ ls                                      #(Host)
Vagranfile sshd_config
$ vagrant up                              #(Host)
...
$ vagrant ssh ansible
...
$ ssh-keygen                             #(ansible)
@f9n
f9n / convertJpgToPngAndResize.sh
Last active April 1, 2018 18:49
Suitable picture for telegram
#!/usr/bin/env bash
mkdir suitablepics
for file in $(ls *.jpg); do
convert $file -resize 512x512 suitablepics/${file/%jpg/png}
done
@f9n
f9n / chef-apply.md
Last active August 9, 2018 14:42
Chef Dk Setup
vagrant@bionic:~$ cat hello.rb 
file '/tmp/hello.txt' do
 content 'hello universe'
end
vagrant@bionic:~$ chef-apply hello.rb 
Recipe: (chef-apply cookbook)::(chef-apply recipe)
  * file[/tmp/hello.txt] action create
    - create new file /tmp/hello.txt
 - update content in file /tmp/hello.txt from none to 2935ea
@f9n
f9n / Postgresql-Arch-Error
Last active August 10, 2018 13:53
Postgresql error
(root)# systemctl start postgresql
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details
(root)# systemctl status postgresql
● postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-03-06 07:52:38 UTC; 12s ago
Process: 10052 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=1/FAILURE)
CPU: 6ms
@f9n
f9n / VagrantMacosBox.md
Last active November 26, 2018 19:21
Vagrant kullanarak Macos kurmak.
$ # Ilk once Virtualbox'in yaninda <Oracle VM VirtualBox Extension Pack> 'ide indirmelisiniz.
$ ### Arch Linux
$ yay virtualbox-ext-oracle
Vagrant.configure("2") do |config|
  # Box'in boyutu yaklasik 9GB'dir.
 config.vm.box = "jhcook/macos-sierra"
@f9n
f9n / phantomjs-installation.md
Last active December 14, 2018 19:27
PhantomJs
    $ export PHANTOMJS_VERSION=2.1.1
    $ export PHANTOMJS_PLATFORM=linux-x86_64
    $ wget "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-${PHANTOMJS_PLATFORM}.tar.bz2"
    $ echo "86dd9a4bf4aee45f1a84c9f61cf1947c1d6dce9b9e8d2a907105da7852460d2f *phantomjs-${PHANTOMJS_VERSION}-${PHANTOMJS_PLATFORM}.tar.bz2" > phantomjs.sha256
    $ sha256sum --check phantomjs.sha256
    $ rm -f phantomjs.sha256
    $ sudo mkdir -p /usr/local/phantomjs-${PHANTOMJS_VERSION}
    $ sudo tar -xjf phantomjs-${PHANTOMJS_VERSION}-${PHANTOMJS_PLATFORM}.tar.bz2 -C /usr/local/phantomjs-$PHANTOMJS_VERSION
 $ sudo ln -s /usr/local/phantomjs-${PHANTOMJS_VERSION}/phantomjs-${PHANTOMJS_VERSION}-${PHANTOMJS_PLATFORM}/bin/phantomjs /usr/local/bin/phantomjs
@f9n
f9n / aur-package-downloading.txt
Last active December 14, 2018 19:28
ArchLinux-Aur
### Aur package Downloading
## First Way
$ git clone http://aur.archlinux.org/package.git
$ cd package
$ makepkg -Sri
## Second Way
$ git clone http://aur.archlinux.org/package.git
$ makepkg -s
$ sudo pacman -U package.tar.[xz|gz]
@f9n
f9n / Vagrantfile
Last active December 14, 2018 19:35
MultiVmVagrantfile
Vagrant.configure("2") do |config|
# define keyword ile birden fazla sanal makine ayarlari tanimlayabiliriz.
config.vm.define "centos-7-cli" do |centos|
centos.vm.box = "centos/7"
centos.vm.network "private_network", ip: "10.0.0.10"
centos.vm.hostname = "centos-7-cli"
centos.vm.provider "virtualbox" do |vb|
vb.name = "my-centos-7"
vb.memory = "1024"
@f9n
f9n / GeneratePdf.md
Last active January 1, 2019 10:29
Generate pdf for websites

Generate Pdf for Websites

Wkhtmltopdf

$ sudo pacman -S wkhtmltopdf
$ wkhtmltopdf  http://www.google.com google.pdf
qt5ct: using qt5ct plugin
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile