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 / spacemacs-change-font-size.txt
Created September 16, 2017 09:34
Change font size
$ vim ~/.spacemacs
...
...
;; Default font, or prioritized list of fonts. `powerline-scale' allows to
;; quickly tweak the mode-line size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro"
:size 20 ;; In here
:weight normal
:width normal
:powerline-scale 1.1)
@f9n
f9n / qemu.sh.md
Last active February 25, 2019 21:36
Virtualization with cli tools
$ sudo pacman -S qemu
$ qemu-image create -f raw new_qemu_image 20G
OR
$ qemu-image create -f qcow2 new_qemu_image 20G

$ qemu-system-x86_64 -smp 2 -m 2G -enable-kvm -cdrom CentOS-7-x86_64-DVD-1708.iso -boot order=d new_qemu_image
# Installing CentOs...
$ qemu-system-x86_64 -k en-us -vga std -enable-kvm -m 2G -smp 2 -boot c new_qemu_image
# Running CentOs...
@f9n
f9n / windows10qemu.md
Last active November 12, 2022 09:41
Running Windows 10 in a UEFI enabled QEMU environment with KVM.
@f9n
f9n / AnsibleSsh.md
Last active October 22, 2017 13:57
Ansible Ssh Config

For Slaves

You must install openssh-server to slave machines.

$ sudo apt-get install openssh-server

Then, restart sshd service

$ sudo systemctl restart sshd

@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 / 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 / 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 / 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 / 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