debian 8 – format partition to ntfs

G3n1k's Blog

check where the partition

unmount first

option to select

‘d’ to delete partition

‘n’ to create new partition

‘1’ for partition number

‘Enter’ for first cylinder (default 1)

‘Enter’ for last cylinder (default of max size)

‘t’ for type

‘L’ for list partition type

‘6’ in my case

‘w’ write change to disk

make quick format

if you want full format, it will take more time

Lihat pos aslinya

htaccess codeigniter in subfolder

G3n1k's Blog

i have codeigniter in subfolder, the url is http://192.168.0.80/suropati-dashboard/index.php/login

remove index.php so i get url http://192.168.0.80/suropati-dashboard/login

but it stuck with .htaccess config, this how to solve

server using ubuntu server 15.10

first create dir for logs, this is optional, i using this folder to file log file

mkdir -p /var/www/logs

second edit /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
        ServerAdmin g3n1k@x230
        DocumentRoot /var/www/html/
        <Directory />
                Options Indexes FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog /var/www/logs/error_log
        CustomLog /var/www/logs/custom_log combined
        RewriteEngine On
</VirtualHost>

third edit .htaccess in sub folder /var/www/html/suropati-dashboard/.htaccess

RewriteEngine On
RewriteBase /suropati-dashboard/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

last restart service apache2

sudo service apache2 restart

Lihat pos aslinya

vagrant – website development server

G3n1k's Blog

why using vagrant ?

mengapa menggunakan vagrant, jika bisa mengeset server virtual dengan virtualbox ?!

adalah pertanyaan pertama yang muncul saat berkenalan dengan vagrant.

pengalaman saya sebagai IT developer bertemu dengan environment berbeda, misal project A menggunakan nginx sebagai http server, Project B menggunakan Apache, atau mungkin project C harus menggunakan IIS dan database SQL Server, belum lagi dengan saat bertemu dengan software yg tergantung dengan depedensi versi tertentu,

ini bisa di atasi dengan membuat banyak virtual server, debianserver dengan apache dan mysql, debian apache dengan nginx dan postgresql, centos server dengan apache mysql, centos nginx plus mongodb, kemudian ubuntu server dengan  … dan berbagai kombinasi server lain nya,

tapi solusi ini bukan tanpa masalah, anda harus mempersiapkan hardisk yg cukup besar.

anggaplah harga hardisk bukan masalah dengan beberapa juta rupiah anda bisa mendapatkan hardisk dengan kapasitas terabyte, lalu bagaimana dengan saat implementasi di server production…

Lihat pos aslinya 209 kata lagi

git – using git to manage website

G3n1k's Blog

in web development, we always store file in htdocs/www/’anything’ in doc root config
besides git versioning, we also can make to auto update our htdocs folder

this scenario, the server use ubuntu-server
and crunchbang (debian) in workstation

at server
# create repo folder, i use [foldername].git to make easy

# and folder in

# init git repository

# buat file hooks post-receive

pada file post-receive, masukan kode berikut

buat script tersebut dapat di eksekusi

selesai config pada sisi server, sekarang configurasi pada sisi workstation anggapan disini, kita telah melakukan setting git pada local repository maka selanjut nya adalah, melakukan configurasi agar repository local tersebut dapat melakukan push dengan mudah ke server setting add remote

lakukan push pertama ke server

untuk push kedua dan seterus nya, gunakan perintah

untuk mengecek konfigurasi sudah berjalan seperti yang diharapkan,
tampilkan isi folder /htdocs/suropati.live

Lihat pos aslinya

indexing – Microsoft SQLServer

G3n1k's Blog

anggaplah ada sebuah table view dengan script seperti ini

anggaplah kita memiliki 7 column, dan pada beberapa column pembentuk memiliki nilai tetap, kita dapat melakukan indexing pada column-column tersebut agar mendapatkan performa yang lebih baik

ubah view yang telah ada, dan untuk menjaga integritas column antar table pembentuk view kita gunakan SCHEMABINDING, bisa juga menambahkan colum perhitungan lain (ex: RecordCount)

tambahkan indexing

Lihat pos aslinya

CodeIgniter Route example