Skip to content

Instantly share code, notes, and snippets.

View gayanhewa's full-sized avatar
🦧
I may be slow to respond.

Gayan gayanhewa

🦧
I may be slow to respond.
View GitHub Profile
@gayanhewa
gayanhewa / wifi-reconnect
Last active August 29, 2015 14:07
WIFI disconnection restart script - Realtek drivers
#!/bin/bash
# Unload kernel module , replace rtl8821ae with your device module.
modprobe -r rtl8821ae
#reload kernel module
modprobe rtl8821ae
# set wireless interface to down , replace wlp3s0 with your wifi device name
ip link set wlp3s0 down
#restart wpa_supplicant
systemctl reenable wpa_supplicant
@gayanhewa
gayanhewa / htaccess
Created November 2, 2014 17:08
Remove index.php from the url
Remove index.php from the url
http://stackoverflow.com/questions/10474740/how-to-remove-index-php-from-urls
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1
http://forumsarchive.laravel.io/viewtopic.php?pid=21255
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/
@gayanhewa
gayanhewa / server.block
Created November 18, 2014 09:22
Nginx Server Block
server {
listen 80;
root /vagrant/public;
index index.html index.htm index.php app.php app_dev.php;
# Make site accessible from ...
server_name customer1.abc.com 192.168.22.10.xip.io vaprobash.dev;
access_log /var/log/nginx/vagrant.com-access.log;
<?php
$databasehost = "localhost";
$databasename = "db";
$databasetable = "temp";
$databaseusername ="root";
$databasepassword = "root";
$fieldseparator = ",";
$lineseparator = "\n";
$csvfile = "csv.csv";
@gayanhewa
gayanhewa / signature.php
Created January 19, 2015 03:48
Signature ( POST with json_encode )
<?php
/**
* This snippet implements the logic behing https://github.com/philipbrown/signplz , simply to explain the functionality of generating the auth signature
* for non-php programmers so that they can authenticate with the API without a problem.
**/
$api_key = "key";
$api_sec = "sec";
$url = "http://abc.com/api/signin";
@gayanhewa
gayanhewa / signature-get-requests.php
Created February 6, 2015 03:21
Signature ( GET requests )
<?php
/**
* This snippet implements the logic behing https://github.com/philipbrown/signplz , simply to explain the functionality of generating the auth signature
* for non-php programmers so that they can authenticate with the API without a problem.
**/
$api_key = "";
$api_sec = "";
$url = "http://abc.com/programs/1";
// Method specific options
@gayanhewa
gayanhewa / .vimrc
Last active August 29, 2015 14:20 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@gayanhewa
gayanhewa / cracking.md
Last active August 29, 2015 14:27 — forked from vertexclique/cracking.md
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@gayanhewa
gayanhewa / Guide
Created August 28, 2015 18:11
Arch Linux Installation - UEFI Configuration steps
Simple steps for me to remember how I did this
==============================================
1. Partition
/root - /dev/sdx2 - Ext4 parition
/boot/efi - /dev/sdx1 - EFI partition
2. Install the system
3. chroot to the system